Parser Service: - Add /ocr/ingest endpoint (PARSER → RAG in one call) - Add RAG_BASE_URL and RAG_TIMEOUT to config - Add OcrIngestResponse schema - Create file_converter utility for PDF/image → PNG bytes - Endpoint accepts file, dao_id, doc_id, user_id - Automatically parses with dots.ocr and sends to RAG Service Router Integration: - Add _handle_rag_query() method in RouterApp - Combines Memory + RAG → LLM pipeline - Get Memory context (facts, events, summaries) - Query RAG Service for documents - Build prompt with Memory + RAG documents - Call LLM provider with combined context - Return answer with citations Clients: - Create rag_client.py for Router (query RAG Service) - Create memory_client.py for Router (get Memory context) E2E Tests: - Create e2e_rag_pipeline.sh script for full pipeline test - Test ingest → query → router query flow - Add E2E_RAG_README.md with usage examples Docker: - Add RAG_SERVICE_URL and MEMORY_SERVICE_URL to router environment
159 lines
3.7 KiB
YAML
159 lines
3.7 KiB
YAML
services:
|
|
# DAGI Router - Core routing service
|
|
router:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: dagi-router
|
|
ports:
|
|
- "9102:9102"
|
|
environment:
|
|
- DAGI_ROUTER_CONFIG=/app/router-config.yml
|
|
- RBAC_BASE_URL=http://rbac:9200
|
|
- DEVTOOLS_BASE_URL=http://devtools:8008
|
|
- CREWAI_BASE_URL=http://crewai:9010
|
|
- RAG_SERVICE_URL=http://rag-service:9500
|
|
- MEMORY_SERVICE_URL=http://memory-service:8000
|
|
volumes:
|
|
- ./router-config.yml:/app/router-config.yml:ro
|
|
- ./logs:/app/logs
|
|
depends_on:
|
|
- devtools
|
|
- crewai
|
|
- rbac
|
|
networks:
|
|
- dagi-network
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:9102/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 10s
|
|
|
|
# DevTools Backend
|
|
devtools:
|
|
build:
|
|
context: ./devtools-backend
|
|
dockerfile: Dockerfile
|
|
container_name: dagi-devtools
|
|
ports:
|
|
- "8008:8008"
|
|
volumes:
|
|
- ./workspace:/workspace
|
|
- ./logs:/app/logs
|
|
networks:
|
|
- dagi-network
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8008/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
# CrewAI Orchestrator
|
|
crewai:
|
|
build:
|
|
context: ./orchestrator
|
|
dockerfile: Dockerfile
|
|
container_name: dagi-crewai
|
|
ports:
|
|
- "9010:9010"
|
|
environment:
|
|
- ROUTER_URL=http://router:9102
|
|
volumes:
|
|
- ./logs:/app/logs
|
|
networks:
|
|
- dagi-network
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:9010/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
# Bot Gateway (with DAARWIZZ)
|
|
gateway:
|
|
build:
|
|
context: ./gateway-bot
|
|
dockerfile: Dockerfile
|
|
container_name: dagi-gateway
|
|
ports:
|
|
- "9300:9300"
|
|
environment:
|
|
- ROUTER_URL=http://router:9102
|
|
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN:-}
|
|
- DISCORD_BOT_TOKEN=${DISCORD_BOT_TOKEN:-}
|
|
- DAARWIZZ_NAME=DAARWIZZ
|
|
- DAARWIZZ_PROMPT_PATH=/app/gateway-bot/daarwizz_prompt.txt
|
|
volumes:
|
|
- ./logs:/app/logs
|
|
depends_on:
|
|
- router
|
|
networks:
|
|
- dagi-network
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:9300/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
# microDAO RBAC Service
|
|
rbac:
|
|
build:
|
|
context: ./microdao
|
|
dockerfile: Dockerfile
|
|
container_name: dagi-rbac
|
|
ports:
|
|
- "9200:9200"
|
|
environment:
|
|
- DATABASE_URL=${RBAC_DATABASE_URL:-sqlite:///rbac.db}
|
|
volumes:
|
|
- ./data/rbac:/app/data
|
|
- ./logs:/app/logs
|
|
networks:
|
|
- dagi-network
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:9200/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
# RAG Service
|
|
rag-service:
|
|
build:
|
|
context: ./services/rag-service
|
|
dockerfile: Dockerfile
|
|
container_name: dagi-rag-service
|
|
ports:
|
|
- "9500:9500"
|
|
environment:
|
|
- PG_DSN=${PG_DSN:-postgresql+psycopg2://postgres:postgres@city-db:5432/daarion_city}
|
|
- EMBED_MODEL_NAME=${EMBED_MODEL_NAME:-BAAI/bge-m3}
|
|
- EMBED_DEVICE=${EMBED_DEVICE:-cpu}
|
|
- ROUTER_BASE_URL=http://router:9102
|
|
volumes:
|
|
- ./logs:/app/logs
|
|
- rag-model-cache:/root/.cache/huggingface
|
|
depends_on:
|
|
- router
|
|
networks:
|
|
- dagi-network
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:9500/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
volumes:
|
|
rag-model-cache:
|
|
driver: local
|
|
|
|
networks:
|
|
dagi-network:
|
|
driver: bridge
|
|
name: dagi-network
|