infra: renamed broken references to alfred

This commit is contained in:
2025-12-24 08:09:26 +01:00
parent 1f88e99e8b
commit d10c9160f3
8 changed files with 40 additions and 42 deletions

View File

@@ -41,10 +41,10 @@ RAG_EMBEDDINGS_MODEL=text-embedding-3-small
# OpenAI API Key (required for RAG embeddings) # OpenAI API Key (required for RAG embeddings)
OPENAI_API_KEY=your-openai-api-key-here OPENAI_API_KEY=your-openai-api-key-here
# Deepseek API Key (for LLM in agent-brain) # Deepseek API Key (for LLM in alfred)
DEEPSEEK_API_KEY=your-deepseek-api-key-here DEEPSEEK_API_KEY=your-deepseek-api-key-here
# Agent Brain Configuration # Alfred Configuration
# LLM Provider (deepseek or ollama) # LLM Provider (deepseek or ollama)
LLM_PROVIDER=deepseek LLM_PROVIDER=deepseek
@@ -52,8 +52,8 @@ LLM_PROVIDER=deepseek
# Memory storage directory (inside container) # Memory storage directory (inside container)
MEMORY_STORAGE_DIR=/data/memory MEMORY_STORAGE_DIR=/data/memory
# API Key for agent-brain (used by LibreChat custom endpoint) # API Key for alfred (used by LibreChat custom endpoint)
AGENT_BRAIN_API_KEY=agent-brain-secret-key ALFRED_API_KEY=alfred-secret-key
# External Services (Optional) # External Services (Optional)
# TMDB API Key (for movie metadata) # TMDB API Key (for movie metadata)

View File

@@ -63,7 +63,6 @@ jobs:
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: . context: .
file: ./brain/Dockerfile
push: true push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}

View File

@@ -30,7 +30,7 @@ RUN --mount=type=cache,target=/root/.cache/pip \
WORKDIR /tmp WORKDIR /tmp
# Copy dependency files # Copy dependency files
COPY brain/pyproject.toml brain/poetry.lock* brain/uv.lock* Makefile ./ COPY pyproject.toml poetry.lock* uv.lock* Makefile ./
# Install dependencies as root (to avoid permission issues with system packages) # Install dependencies as root (to avoid permission issues with system packages)
RUN --mount=type=cache,target=/root/.cache/pip \ RUN --mount=type=cache,target=/root/.cache/pip \
@@ -59,12 +59,12 @@ RUN --mount=type=cache,target=/root/.cache/pip \
uv pip install --system -e .[dev]; \ uv pip install --system -e .[dev]; \
fi fi
COPY brain/agent/ ./agent/ COPY alfred/agent/ ./agent/
COPY brain/application/ ./application/ COPY alfred/application/ ./application/
COPY brain/domain/ ./domain/ COPY alfred/domain/ ./domain/
COPY brain/infrastructure/ ./infrastructure/ COPY alfred/infrastructure/ ./infrastructure/
COPY brain/tests/ ./tests/ COPY alfred/tests/ ./tests/
COPY brain/app.py . COPY alfred/app.py .
# =========================================== # ===========================================
# Stage 3: Runtime # Stage 3: Runtime
@@ -103,11 +103,11 @@ COPY --from=builder /usr/local/lib/python${PYTHON_VERSION_SHORT}/site-packages /
COPY --from=builder /usr/local/bin /usr/local/bin COPY --from=builder /usr/local/bin /usr/local/bin
# Copy application code (already owned by appuser) # Copy application code (already owned by appuser)
COPY --chown=appuser:appuser brain/agent/ ./agent/ COPY --chown=appuser:appuser alfred/agent/ ./agent/
COPY --chown=appuser:appuser brain/application/ ./application/ COPY --chown=appuser:appuser alfred/application/ ./application/
COPY --chown=appuser:appuser brain/domain/ ./domain/ COPY --chown=appuser:appuser alfred/domain/ ./domain/
COPY --chown=appuser:appuser brain/infrastructure/ ./infrastructure/ COPY --chown=appuser:appuser alfred/infrastructure/ ./infrastructure/
COPY --chown=appuser:appuser brain/app.py . COPY --chown=appuser:appuser alfred/app.py .
# Create volumes for persistent data # Create volumes for persistent data
VOLUME ["/data/memory", "/data/logs"] VOLUME ["/data/memory", "/data/logs"]

View File

@@ -3,14 +3,14 @@
.DEFAULT_GOAL := help .DEFAULT_GOAL := help
# --- SETTINGS --- # --- SETTINGS ---
CORE_DIR = brain CORE_DIR = alfred
IMAGE_NAME = agent_media IMAGE_NAME = alfred_media_organizer
# renovate: datasource=docker depName=python # renovate: datasource=docker depName=python
PYTHON_VERSION = $(shell grep "python" $(CORE_DIR)/pyproject.toml | head -n 1 | sed -E 's/.*[=<>^~"]+ *([0-9]+\.[0-9]+(\.[0-9]+)?).*/\1/') PYTHON_VERSION = $(shell grep "python" $(CORE_DIR)/pyproject.toml | head -n 1 | sed -E 's/.*[=<>^~"]+ *([0-9]+\.[0-9]+(\.[0-9]+)?).*/\1/')
PYTHON_VERSION_SHORT = $(shell echo $(PYTHON_VERSION) | cut -d. -f1,2) PYTHON_VERSION_SHORT = $(shell echo $(PYTHON_VERSION) | cut -d. -f1,2)
# Change to 'uv' when ready. # Change to 'uv' when ready.
RUNNER ?= poetry RUNNER ?= poetry
SERVICE_NAME = agent_media SERVICE_NAME = alfred
export IMAGE_NAME export IMAGE_NAME
export PYTHON_VERSION export PYTHON_VERSION
@@ -157,7 +157,7 @@ init-dotenv:
@sed -i.bak "s|CREDS_KEY=.*|CREDS_KEY=$$(openssl rand -hex 16)|" .env @sed -i.bak "s|CREDS_KEY=.*|CREDS_KEY=$$(openssl rand -hex 16)|" .env
@sed -i.bak "s|CREDS_IV=.*|CREDS_IV=$$(openssl rand -hex 8)|" .env @sed -i.bak "s|CREDS_IV=.*|CREDS_IV=$$(openssl rand -hex 8)|" .env
@sed -i.bak "s|MEILI_MASTER_KEY=.*|MEILI_MASTER_KEY=$$(openssl rand -base64 32)|" .env @sed -i.bak "s|MEILI_MASTER_KEY=.*|MEILI_MASTER_KEY=$$(openssl rand -base64 32)|" .env
@sed -i.bak "s|AGENT_BRAIN_API_KEY=.*|AGENT_BRAIN_API_KEY=$$(openssl rand -base64 24)|" .env @sed -i.bak "s|ALFRED_API_KEY=.*|ALFRED_API_KEY=$$(openssl rand -base64 24)|" .env
@rm -f .env.bak @rm -f .env.bak
@echo "$(G)✅ .env created with generated secrets!$(R)" @echo "$(G)✅ .env created with generated secrets!$(R)"
@echo "$(T)⚠️ Don't forget to add your API keys:$(R)" @echo "$(T)⚠️ Don't forget to add your API keys:$(R)"

View File

@@ -1,14 +1,12 @@
version: "3.4" version: "3.4"
services: services:
# Da brain alfred:
agent-brain:
build: build:
context: ./brain context: .
dockerfile: Dockerfile
args: args:
RUNNER: ${RUNNER} # Get it from Makefile RUNNER: ${RUNNER} # Get it from Makefile
container_name: agent-brain container_name: alfred
restart: unless-stopped restart: unless-stopped
env_file: .env env_file: .env
ports: ports:
@@ -18,7 +16,7 @@ services:
- agent-memory:/data/memory - agent-memory:/data/memory
- agent-logs:/data/logs - agent-logs:/data/logs
# Development: mount code for hot reload (comment out in production) # Development: mount code for hot reload (comment out in production)
# - ./brain:/app # - ./alfred:/app
environment: environment:
# LLM Configuration # LLM Configuration
LLM_PROVIDER: ${LLM_PROVIDER:-deepseek} LLM_PROVIDER: ${LLM_PROVIDER:-deepseek}
@@ -46,7 +44,7 @@ services:
- mongodb - mongodb
- meilisearch - meilisearch
- rag_api - rag_api
- agent-brain - alfred
env_file: .env env_file: .env
environment: environment:
# MongoDB connection (no auth, matching LibreChat default) # MongoDB connection (no auth, matching LibreChat default)
@@ -80,8 +78,8 @@ services:
# Endpoints # Endpoints
ENDPOINTS: custom ENDPOINTS: custom
# Custom endpoint pointing to agent-brain # Custom endpoint pointing to alfred
CUSTOM_API_KEY: ${AGENT_BRAIN_API_KEY:-agent-brain-secret-key} CUSTOM_API_KEY: ${ALFRED_API_KEY:-alfred-secret-key}
# Debug (optional) # Debug (optional)
DEBUG_LOGGING: ${DEBUG_LOGGING:-false} DEBUG_LOGGING: ${DEBUG_LOGGING:-false}
@@ -195,7 +193,7 @@ volumes:
librechat-logs: librechat-logs:
driver: local driver: local
# Agent Brain data # Alfred data
agent-memory: agent-memory:
driver: local driver: local
agent-logs: agent-logs:

View File

@@ -22,7 +22,7 @@ endpoints:
manifest: manifest:
schema: schema:
type: openapi type: openapi
url: "http://agent-brain:8000/manifests/find_media_imdb_id.json" url: "http://alfred:8000/manifests/find_media_imdb_id.json"
auth: auth:
type: none type: none
@@ -32,7 +32,7 @@ endpoints:
manifest: manifest:
schema: schema:
type: openapi type: openapi
url: "http://agent-brain:8000/manifests/find_torrent.json" url: "http://alfred:8000/manifests/find_torrent.json"
auth: auth:
type: none type: none
@@ -42,7 +42,7 @@ endpoints:
manifest: manifest:
schema: schema:
type: openapi type: openapi
url: "http://agent-brain:8000/manifests/add_torrent_by_index.json" url: "http://alfred:8000/manifests/add_torrent_by_index.json"
auth: auth:
type: none type: none
@@ -52,7 +52,7 @@ endpoints:
manifest: manifest:
schema: schema:
type: openapi type: openapi
url: "http://agent-brain:8000/manifests/set_language.json" url: "http://alfred:8000/manifests/set_language.json"
auth: auth:
type: none type: none
@@ -60,7 +60,7 @@ endpoints:
# Backend Local Agent # Backend Local Agent
- name: "Local Agent" - name: "Local Agent"
apiKey: "dummy_key" apiKey: "dummy_key"
baseURL: "http://agent-brain:8000/v1" baseURL: "http://alfred:8000/v1"
models: models:
default: ["local-deepseek-agent"] default: ["local-deepseek-agent"]
fetch: false fetch: false
@@ -75,7 +75,7 @@ endpoints:
manifest: manifest:
schema: schema:
type: openapi type: openapi
url: "http://agent-brain:8000/manifests/find_media_imdb_id.json" url: "http://alfred:8000/manifests/find_media_imdb_id.json"
auth: auth:
type: none type: none
@@ -85,7 +85,7 @@ endpoints:
manifest: manifest:
schema: schema:
type: openapi type: openapi
url: "http://agent-brain:8000/manifests/find_torrent.json" url: "http://alfred:8000/manifests/find_torrent.json"
auth: auth:
type: none type: none
@@ -95,7 +95,7 @@ endpoints:
manifest: manifest:
schema: schema:
type: openapi type: openapi
url: "http://agent-brain:8000/manifests/add_torrent_by_index.json" url: "http://alfred:8000/manifests/add_torrent_by_index.json"
auth: auth:
type: none type: none
@@ -105,6 +105,6 @@ endpoints:
manifest: manifest:
schema: schema:
type: openapi type: openapi
url: "http://agent-brain:8000/manifests/set_language.json" url: "http://alfred:8000/manifests/set_language.json"
auth: auth:
type: none type: none

View File

@@ -1,5 +1,5 @@
[tool.poetry] [tool.poetry]
name = "agent-media" name = "alfred"
version = "0.1.6" version = "0.1.6"
description = "AI agent for managing a local media library" description = "AI agent for managing a local media library"
authors = ["Francwa <francois.hodiaumont@gmail.com>"] authors = ["Francwa <francois.hodiaumont@gmail.com>"]

View File

@@ -3,8 +3,9 @@
import sys import sys
from pathlib import Path from pathlib import Path
#TODO: Moved directory, should not be necessary anymore but need to check !!
# Ajouter le dossier parent (brain) au PYTHONPATH # Ajouter le dossier parent (brain) au PYTHONPATH
sys.path.insert(0, str(Path(__file__).parent.parent)) # sys.path.insert(0, str(Path(__file__).parent.parent))
import shutil import shutil
import tempfile import tempfile