From aa89a3fb0060a9079e9c6ed1891da5ea48418962 Mon Sep 17 00:00:00 2001 From: Francwa Date: Sun, 4 Jan 2026 13:30:54 +0100 Subject: [PATCH] doc: updated README.md --- README.md | 651 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 423 insertions(+), 228 deletions(-) diff --git a/README.md b/README.md index 3afe6b0..44727b6 100644 --- a/README.md +++ b/README.md @@ -1,89 +1,277 @@ -# Agent Media 🎬 +# Alfred Media Organizer 🎬 -An AI-powered agent for managing your local media library with natural language. Search, download, and organize movies and TV shows effortlessly. +An AI-powered agent for managing your local media library with natural language. Search, download, and organize movies and TV shows effortlessly through a conversational interface. -## Features +[![Python 3.14](https://img.shields.io/badge/python-3.14-blue.svg)](https://www.python.org/downloads/) +[![Poetry](https://img.shields.io/badge/dependency%20manager-poetry-blue)](https://python-poetry.org/) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) +[![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff) -- πŸ€– **Natural Language Interface**: Talk to your media library in plain language -- πŸ” **Smart Search**: Find movies and TV shows via TMDB -- πŸ“₯ **Torrent Integration**: Search and download via qBittorrent -- 🧠 **Contextual Memory**: Remembers your preferences and conversation history -- πŸ“ **Auto-Organization**: Keeps your media library tidy -- 🌐 **API Compatible**: OpenAI-compatible API for easy integration +## ✨ Features -## Architecture +- πŸ€– **Natural Language Interface** β€” Talk to your media library in plain language +- πŸ” **Smart Search** β€” Find movies and TV shows via TMDB with rich metadata +- πŸ“₯ **Torrent Integration** β€” Search and download via qBittorrent +- 🧠 **Contextual Memory** β€” Remembers your preferences and conversation history +- πŸ“ **Auto-Organization** β€” Keeps your media library tidy and well-structured +- 🌐 **OpenAI-Compatible API** β€” Works with any OpenAI-compatible client +- πŸ–₯️ **LibreChat Frontend** β€” Beautiful web UI included out of the box +- πŸ”’ **Secure by Default** β€” Auto-generated secrets and encrypted credentials -Built with **Domain-Driven Design (DDD)** principles: +## πŸ—οΈ Architecture + +Built with **Domain-Driven Design (DDD)** principles for clean separation of concerns: ``` -agent_media/ -β”œβ”€β”€ agent/ # AI agent orchestration -β”œβ”€β”€ application/ # Use cases & DTOs -β”œβ”€β”€ domain/ # Business logic & entities -└── infrastructure/ # External services & persistence +alfred/ +β”œβ”€β”€ agent/ # AI agent orchestration +β”‚ β”œβ”€β”€ llm/ # LLM clients (Ollama, DeepSeek) +β”‚ └── tools/ # Tool implementations +β”œβ”€β”€ application/ # Use cases & DTOs +β”‚ β”œβ”€β”€ movies/ # Movie search use cases +β”‚ β”œβ”€β”€ torrents/ # Torrent management +β”‚ └── filesystem/ # File operations +β”œβ”€β”€ domain/ # Business logic & entities +β”‚ β”œβ”€β”€ movies/ # Movie entities +β”‚ β”œβ”€β”€ tv_shows/ # TV show entities +β”‚ └── subtitles/ # Subtitle entities +└── infrastructure/ # External services & persistence + β”œβ”€β”€ api/ # External API clients (TMDB, qBittorrent) + β”œβ”€β”€ filesystem/ # File system operations + └── persistence/ # Memory & repositories ``` -See [architecture_diagram.md](docs/architecture_diagram.md) for architectural details. +See [docs/architecture_diagram.md](docs/architecture_diagram.md) for detailed architectural diagrams. -## Quick Start +## πŸš€ Quick Start ### Prerequisites -- Python 3.12+ -- Poetry -- qBittorrent (optional, for downloads) -- API Keys: - - DeepSeek API key (or Ollama for local LLM) - - TMDB API key +- **Python 3.14+** (required) +- **Poetry** (dependency manager) +- **Docker & Docker Compose** (recommended for full stack) +- **API Keys:** + - TMDB API key ([get one here](https://www.themoviedb.org/settings/api)) + - Optional: DeepSeek, OpenAI, Anthropic, or other LLM provider keys ### Installation ```bash # Clone the repository -git clone https://github.com/your-username/agent-media.git -cd agent-media +git clone https://github.com/francwa/alfred_media_organizer.git +cd alfred_media_organizer # Install dependencies -poetry install +make install -# Copy environment template -cp .env.example .env +# Bootstrap environment (generates .env with secure secrets) +make bootstrap # Edit .env with your API keys nano .env ``` -### Configuration - -Edit `.env`: +### Running with Docker (Recommended) ```bash -# LLM Provider (deepseek or ollama) -LLM_PROVIDER=deepseek -DEEPSEEK_API_KEY=your-api-key-here +# Start all services (LibreChat + Alfred + MongoDB + Ollama) +make up -# TMDB (for movie/TV show metadata) -TMDB_API_KEY=your-tmdb-key-here +# Or start with specific profiles +make up p=rag,meili # Include RAG and Meilisearch +make up p=qbittorrent # Include qBittorrent +make up p=full # Everything -# qBittorrent (optional) -QBITTORRENT_HOST=http://localhost:8080 -QBITTORRENT_USERNAME=admin -QBITTORRENT_PASSWORD=adminadmin +# View logs +make logs + +# Stop all services +make down ``` -### Run +The web interface will be available at **http://localhost:3080** + +### Running Locally (Development) ```bash +# Install dependencies +poetry install + # Start the API server -poetry run uvicorn app:app --reload - -# Or with Docker -docker-compose up +poetry run uvicorn alfred.app:app --reload --port 8000 ``` -The API will be available at `http://localhost:8000` +## βš™οΈ Configuration -## Usage +### Environment Bootstrap + +Alfred uses a smart bootstrap system that: + +1. **Generates secure secrets** automatically (JWT tokens, database passwords, encryption keys) +2. **Syncs build variables** from `pyproject.toml` (versions, image names) +3. **Preserves existing secrets** when re-running (never overwrites your API keys) +4. **Computes database URIs** automatically from individual components + +```bash +# First time setup +make bootstrap + +# Re-run after updating pyproject.toml (secrets are preserved) +make bootstrap +``` + +### Configuration File (.env) + +The `.env` file is generated from `.env.example` with secure defaults: + +```bash +# --- CORE SETTINGS --- +HOST=0.0.0.0 +PORT=3080 +MAX_HISTORY_MESSAGES=10 +MAX_TOOL_ITERATIONS=10 + +# --- LLM CONFIGURATION --- +# Providers: 'local' (Ollama), 'deepseek', 'openai', 'anthropic', 'google' +DEFAULT_LLM_PROVIDER=local + +# Local LLM (Ollama - included in Docker stack) +OLLAMA_BASE_URL=http://ollama:11434 +OLLAMA_MODEL=llama3.3:latest +LLM_TEMPERATURE=0.2 + +# --- API KEYS (fill only what you need) --- +TMDB_API_KEY=your-tmdb-key-here # Required for movie search +DEEPSEEK_API_KEY= # Optional +OPENAI_API_KEY= # Optional +ANTHROPIC_API_KEY= # Optional + +# --- SECURITY (auto-generated, don't modify) --- +JWT_SECRET= +JWT_REFRESH_SECRET= +CREDS_KEY= +CREDS_IV= + +# --- DATABASES (auto-generated passwords) --- +MONGO_PASSWORD= +POSTGRES_PASSWORD= +``` + +### Security Keys + +Security keys are defined in `pyproject.toml` and generated automatically: + +```toml +[tool.alfred.security] +jwt_secret = "32:b64" # 32 bytes, base64 URL-safe +jwt_refresh_secret = "32:b64" +creds_key = "32:hex" # 32 bytes, hexadecimal (AES-256) +creds_iv = "16:hex" # 16 bytes, hexadecimal (AES IV) +mongo_password = "16:hex" +postgres_password = "16:hex" +``` + +**Formats:** +- `b64` β€” Base64 URL-safe (for JWT tokens) +- `hex` β€” Hexadecimal (for encryption keys, passwords) + +## 🐳 Docker Services + +### Service Architecture + +``` +β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” +β”‚ alfred-net (bridge) β”‚ +β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ +β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ LibreChat │───▢│ Alfred │───▢│ MongoDB β”‚ β”‚ +β”‚ β”‚ :3080 β”‚ β”‚ (core) β”‚ β”‚ :27017 β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ β”‚ β”‚ +β”‚ β”‚ β–Ό β”‚ +β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ β”‚ Ollama β”‚ β”‚ +β”‚ β”‚ β”‚ (local) β”‚ β”‚ +β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ β”‚ +β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ +β”‚ β”‚ Optional Services (profiles) β”‚ β”‚ +β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ +β”‚ β”‚ Meilisearch β”‚ RAG API β”‚ VectorDB β”‚qBittor- β”‚ β”‚ +β”‚ β”‚ :7700 β”‚ :8000 β”‚ :5432 β”‚ rent β”‚ β”‚ +β”‚ β”‚ [meili] β”‚ [rag] β”‚ [rag] β”‚[qbit..] β”‚ β”‚ +β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ +β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ +``` + +### Docker Profiles + +| Profile | Services | Use Case | +|---------|----------|----------| +| (default) | LibreChat, Alfred, MongoDB, Ollama | Basic setup | +| `meili` | + Meilisearch | Fast search | +| `rag` | + RAG API, VectorDB | Document retrieval | +| `qbittorrent` | + qBittorrent | Torrent downloads | +| `full` | All services | Complete setup | + +```bash +# Start with specific profiles +make up p=rag,meili +make up p=full +``` + +### Docker Commands + +```bash +make up # Start containers (default profile) +make up p=full # Start with all services +make down # Stop all containers +make restart # Restart containers +make logs # Follow logs +make ps # Show container status +make shell # Open bash in Alfred container +make build # Build production image +make build-test # Build test image +``` + +## πŸ› οΈ Available Tools + +The agent has access to these tools for interacting with your media library: + +| Tool | Description | +|------|-------------| +| `find_media_imdb_id` | Search for movies/TV shows on TMDB by title | +| `find_torrent` | Search for torrents across multiple indexers | +| `get_torrent_by_index` | Get detailed info about a specific torrent result | +| `add_torrent_by_index` | Download a torrent by its index in search results | +| `add_torrent_to_qbittorrent` | Add a torrent via magnet link directly | +| `set_path_for_folder` | Configure folder paths for media organization | +| `list_folder` | List contents of a folder | +| `set_language` | Set preferred language for searches | + +## πŸ’¬ Usage Examples + +### Via Web Interface (LibreChat) + +Navigate to **http://localhost:3080** and start chatting: + +``` +You: Find Inception in 1080p +Alfred: I found 3 torrents for Inception (2010): + 1. Inception.2010.1080p.BluRay.x264 (150 seeders) - 2.1 GB + 2. Inception.2010.1080p.WEB-DL.x265 (80 seeders) - 1.8 GB + 3. Inception.2010.1080p.REMUX (45 seeders) - 25 GB + +You: Download the first one +Alfred: βœ“ Added to qBittorrent! Download started. + Saving to: /downloads/Movies/Inception (2010)/ + +You: What's downloading right now? +Alfred: You have 1 active download: + - Inception.2010.1080p.BluRay.x264 (45% complete, ETA: 12 min) +``` ### Via API @@ -91,219 +279,177 @@ The API will be available at `http://localhost:8000` # Health check curl http://localhost:8000/health -# Chat with the agent +# Chat with the agent (OpenAI-compatible) curl -X POST http://localhost:8000/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ - "model": "agent-media", + "model": "alfred", "messages": [ - {"role": "user", "content": "Find Inception 1080p"} + {"role": "user", "content": "Find The Matrix 4K"} ] }' + +# List available models +curl http://localhost:8000/v1/models + +# View memory state (debug) +curl http://localhost:8000/memory/state + +# Clear session memory +curl -X POST http://localhost:8000/memory/clear-session ``` -### Via OpenWebUI +### Via OpenWebUI or Other Clients -Agent Media is compatible with [OpenWebUI](https://github.com/open-webui/open-webui): +Alfred is compatible with any OpenAI-compatible client: 1. Add as OpenAI-compatible endpoint: `http://localhost:8000/v1` -2. Model name: `agent-media` -3. Start chatting! +2. Model name: `alfred` +3. No API key required (or use any placeholder) -### Example Conversations +## 🧠 Memory System -``` -You: Find Inception in 1080p -Agent: I found 3 torrents for Inception: - 1. Inception.2010.1080p.BluRay.x264 (150 seeders) - 2. Inception.2010.1080p.WEB-DL.x265 (80 seeders) - 3. Inception.2010.720p.BluRay (45 seeders) - -You: Download the first one -Agent: Added to qBittorrent! Download started. - -You: List my downloads -Agent: You have 1 active download: - - Inception.2010.1080p.BluRay.x264 (45% complete) -``` - -## Available Tools - -The agent has access to these tools: - -| Tool | Description | -|------|-------------| -| `find_media_imdb_id` | Search for movies/TV shows on TMDB | -| `find_torrents` | Search for torrents | -| `get_torrent_by_index` | Get torrent details by index | -| `add_torrent_by_index` | Download torrent by index | -| `add_torrent_to_qbittorrent` | Add torrent via magnet link | -| `set_path_for_folder` | Configure folder paths | -| `list_folder` | List folder contents | - -## Memory System - -Agent Media uses a three-tier memory system: +Alfred uses a three-tier memory system for context management: ### Long-Term Memory (LTM) -- **Persistent** (saved to JSON) -- Configuration, preferences, media library -- Survives restarts +- **Persistent** β€” Saved to JSON files +- **Contents:** Configuration, user preferences, media library state +- **Survives:** Application restarts ### Short-Term Memory (STM) -- **Session-based** (RAM only) -- Conversation history, current workflow -- Cleared on restart +- **Session-based** β€” Stored in RAM +- **Contents:** Conversation history, current workflow state +- **Cleared:** On session end or restart ### Episodic Memory -- **Transient** (RAM only) -- Search results, active downloads, recent errors -- Cleared frequently +- **Transient** β€” Stored in RAM +- **Contents:** Search results, active downloads, recent errors +- **Cleared:** Frequently, after task completion -## Development +## πŸ§ͺ Development -### Project Structure +### Project Setup -``` -agent_media/ -β”œβ”€β”€ agent/ -β”‚ β”œβ”€β”€ agent.py # Main agent orchestrator -β”‚ β”œβ”€β”€ prompts.py # System prompt builder -β”‚ β”œβ”€β”€ registry.py # Tool registration -β”‚ β”œβ”€β”€ tools/ # Tool implementations -β”‚ └── llm/ # LLM clients (DeepSeek, Ollama) -β”œβ”€β”€ application/ -β”‚ β”œβ”€β”€ movies/ # Movie use cases -β”‚ β”œβ”€β”€ torrents/ # Torrent use cases -β”‚ └── filesystem/ # Filesystem use cases -β”œβ”€β”€ domain/ -β”‚ β”œβ”€β”€ movies/ # Movie entities & value objects -β”‚ β”œβ”€β”€ tv_shows/ # TV show entities -β”‚ β”œβ”€β”€ subtitles/ # Subtitle entities -β”‚ └── shared/ # Shared value objects -β”œβ”€β”€ infrastructure/ -β”‚ β”œβ”€β”€ api/ # External API clients -β”‚ β”‚ β”œβ”€β”€ tmdb/ # TMDB client -β”‚ β”‚ β”œβ”€β”€ knaben/ # Torrent search -β”‚ β”‚ └── qbittorrent/ # qBittorrent client -β”‚ β”œβ”€β”€ filesystem/ # File operations -β”‚ └── persistence/ # Memory & repositories -β”œβ”€β”€ tests/ # Test suite (~500 tests) -└── docs/ # Documentation +```bash +# Install all dependencies (including dev) +poetry install + +# Install pre-commit hooks +make install-hooks + +# Run the development server +poetry run uvicorn alfred.app:app --reload ``` ### Running Tests ```bash -# Run all tests -poetry run pytest +# Run all tests (parallel execution) +make test -# Run with coverage -poetry run pytest --cov +# Run with coverage report +make coverage # Run specific test file -poetry run pytest tests/test_agent.py +poetry run pytest tests/test_agent.py -v # Run specific test -poetry run pytest tests/test_agent.py::TestAgent::test_step +poetry run pytest tests/test_config_loader.py::TestBootstrapEnv -v ``` ### Code Quality ```bash -# Linting -poetry run ruff check . +# Lint and auto-fix +make lint -# Formatting -poetry run black . +# Format code +make format -# Type checking (if mypy is installed) -poetry run mypy . +# Clean build artifacts +make clean ``` ### Adding a New Tool -Quick example: +1. **Create the tool function** in `alfred/agent/tools/`: ```python -# 1. Create the tool function in agent/tools/api.py -def my_new_tool(param: str) -> Dict[str, Any]: - """Tool description.""" +# alfred/agent/tools/api.py +def my_new_tool(param: str) -> dict[str, Any]: + """ + Short description of what this tool does. + + This will be shown to the LLM to help it decide when to use this tool. + """ memory = get_memory() - # Implementation - return {"status": "ok", "data": "result"} - -# 2. Register in agent/registry.py -Tool( - name="my_new_tool", - description="What this tool does", - func=api_tools.my_new_tool, - parameters={ - "type": "object", - "properties": { - "param": {"type": "string", "description": "Parameter description"}, - }, - "required": ["param"], - }, -), + + # Your implementation here + result = do_something(param) + + return { + "status": "success", + "data": result + } ``` -## Docker +2. **Register in the registry** (`alfred/agent/registry.py`): -### Build +```python +tool_functions = [ + # ... existing tools ... + api_tools.my_new_tool, # Add your tool here +] +``` + +The tool will be automatically registered with its parameters extracted from the function signature. + +### Version Management ```bash -docker build -t agent-media . +# Bump version (must be on main branch) +make patch # 0.1.7 -> 0.1.8 +make minor # 0.1.7 -> 0.2.0 +make major # 0.1.7 -> 1.0.0 ``` -### Run - -```bash -docker run -p 8000:8000 \ - -e DEEPSEEK_API_KEY=your-key \ - -e TMDB_API_KEY=your-key \ - -v $(pwd)/memory_data:/app/memory_data \ - agent-media -``` - -### Docker Compose - -```bash -# Start all services (agent + qBittorrent) -docker-compose up -d - -# View logs -docker-compose logs -f - -# Stop -docker-compose down -``` - -## API Documentation +## πŸ“š API Reference ### Endpoints #### `GET /health` Health check endpoint. -**Response:** ```json { "status": "healthy", - "version": "0.2.0" + "version": "0.1.7" } ``` #### `GET /v1/models` List available models (OpenAI-compatible). +```json +{ + "object": "list", + "data": [ + { + "id": "alfred", + "object": "model", + "owned_by": "alfred" + } + ] +} +``` + #### `POST /v1/chat/completions` Chat with the agent (OpenAI-compatible). **Request:** ```json { - "model": "agent-media", + "model": "alfred", "messages": [ {"role": "user", "content": "Find Inception"} ], @@ -317,7 +463,7 @@ Chat with the agent (OpenAI-compatible). "id": "chatcmpl-xxx", "object": "chat.completion", "created": 1234567890, - "model": "agent-media", + "model": "alfred", "choices": [{ "index": 0, "message": { @@ -330,71 +476,120 @@ Chat with the agent (OpenAI-compatible). ``` #### `GET /memory/state` -View full memory state (debug). +View full memory state (debug endpoint). #### `POST /memory/clear-session` Clear session memories (STM + Episodic). -## Troubleshooting +## πŸ”§ Troubleshooting ### Agent doesn't respond -- Check API keys in `.env` -- Verify LLM provider is running (Ollama) or accessible (DeepSeek) -- Check logs: `docker-compose logs agent-media` + +1. Check API keys in `.env` +2. Verify LLM provider is running: + ```bash + # For Ollama + docker logs alfred-ollama + + # Check if model is pulled + docker exec alfred-ollama ollama list + ``` +3. Check Alfred logs: `docker logs alfred-core` ### qBittorrent connection failed -- Verify qBittorrent is running -- Check `QBITTORRENT_HOST` in `.env` -- Ensure Web UI is enabled in qBittorrent settings + +1. Verify qBittorrent is running: `docker ps | grep qbittorrent` +2. Check Web UI is enabled in qBittorrent settings +3. Verify credentials in `.env`: + ```bash + QBITTORRENT_URL=http://qbittorrent:16140 + QBITTORRENT_USERNAME=admin + QBITTORRENT_PASSWORD= + ``` + +### Database connection issues + +1. Check MongoDB is healthy: `docker logs alfred-mongodb` +2. Verify credentials match in `.env` +3. Try restarting: `make restart` ### Memory not persisting -- Check `memory_data/` directory exists and is writable -- Verify volume mounts in Docker + +1. Check `data/` directory exists and is writable +2. Verify volume mounts in `docker-compose.yaml` +3. Check file permissions: `ls -la data/` + +### Bootstrap fails + +1. Ensure `.env.example` exists +2. Check `pyproject.toml` has required sections: + ```toml + [tool.alfred.settings] + [tool.alfred.security] + ``` +3. Run manually: `python scripts/bootstrap.py` ### Tests failing -- Run `poetry install` to ensure dependencies are up to date -- Check logs for specific error messages -## Contributing +1. Update dependencies: `poetry install` +2. Check Python version: `python --version` (needs 3.14+) +3. Run specific failing test with verbose output: + ```bash + poetry run pytest tests/test_failing.py -v --tb=long + ``` -Contributions are welcome! +## 🀝 Contributing -### Development Workflow +Contributions are welcome! Please follow these steps: -1. Fork the repository -2. Create a feature branch: `git checkout -b feature/my-feature` -3. Make your changes -4. Run tests: `poetry run pytest` -5. Run linting: `poetry run ruff check . && poetry run black .` -6. Commit: `git commit -m "Add my feature"` -7. Push: `git push origin feature/my-feature` -8. Create a Pull Request +1. **Fork** the repository +2. **Create** a feature branch: `git checkout -b feature/my-feature` +3. **Make** your changes +4. **Run** tests: `make test` +5. **Run** linting: `make lint && make format` +6. **Commit**: `git commit -m "feat: add my feature"` +7. **Push**: `git push origin feature/my-feature` +8. **Create** a Pull Request -## Documentation +### Commit Convention -- [Architecture Diagram](docs/architecture_diagram.md) - System architecture overview -- [Class Diagram](docs/class_diagram.md) - Class structure and relationships -- [Component Diagram](docs/component_diagram.md) - Component interactions -- [Sequence Diagram](docs/sequence_diagram.md) - Sequence flows -- [Flowchart](docs/flowchart.md) - System flowcharts +We use [Conventional Commits](https://www.conventionalcommits.org/): -## License +- `feat:` New feature +- `fix:` Bug fix +- `docs:` Documentation +- `refactor:` Code refactoring +- `test:` Adding tests +- `chore:` Maintenance -MIT License - see [LICENSE](LICENSE) file for details. +## πŸ“– Documentation -## Acknowledgments +- [Architecture Diagram](docs/architecture_diagram.md) β€” System architecture overview +- [Class Diagram](docs/class_diagram.md) β€” Class structure and relationships +- [Component Diagram](docs/component_diagram.md) β€” Component interactions +- [Sequence Diagram](docs/sequence_diagram.md) β€” Sequence flows +- [Flowchart](docs/flowchart.md) β€” System flowcharts -- [DeepSeek](https://www.deepseek.com/) - LLM provider -- [TMDB](https://www.themoviedb.org/) - Movie database -- [qBittorrent](https://www.qbittorrent.org/) - Torrent client -- [FastAPI](https://fastapi.tiangolo.com/) - Web framework +## πŸ“„ License -## Support +MIT License β€” see [LICENSE](LICENSE) file for details. + +## πŸ™ Acknowledgments + +- [LibreChat](https://github.com/danny-avila/LibreChat) β€” Beautiful chat interface +- [Ollama](https://ollama.ai/) β€” Local LLM runtime +- [DeepSeek](https://www.deepseek.com/) β€” LLM provider +- [TMDB](https://www.themoviedb.org/) β€” Movie database +- [qBittorrent](https://www.qbittorrent.org/) β€” Torrent client +- [FastAPI](https://fastapi.tiangolo.com/) β€” Web framework +- [Pydantic](https://docs.pydantic.dev/) β€” Data validation + +## πŸ“¬ Support - πŸ“§ Email: francois.hodiaumont@gmail.com -- πŸ› Issues: [GitHub Issues](https://github.com/your-username/agent-media/issues) -- πŸ’¬ Discussions: [GitHub Discussions](https://github.com/your-username/agent-media/discussions) +- πŸ› Issues: [GitHub Issues](https://github.com/francwa/alfred_media_organizer/issues) +- πŸ’¬ Discussions: [GitHub Discussions](https://github.com/francwa/alfred_media_organizer/discussions) --- -Made with ❀️ by Francwa +

Made with ❀️ by Francwa