Deployment
-
Docker-First
Compose stack for Postgres, Neo4j, exporter, and API.
-
Configurable
All behavior via Pydantic config and environment variables.
-
Portable
Works on local dev, CI, or container platforms.
Persistent Volumes
Keep DB data outside the repo. Default bind-mount path is ../tribrid-rag-db/. Override with TRIBRID_DB_DIR.
Environment Template
Copy the provided environment configuration to .env, fill in DB credentials and API keys, and export it into your shell for local runs.
Production Secrets
Use a secret manager for API keys and DB credentials in production. Do not rely on .env files in containerized environments.
Services and Ports
| Service | Port | Purpose |
|---|---|---|
| API (uvicorn) | 8000 | REST endpoints |
| PostgreSQL | 5432 | Chunk + vector + FTS storage |
| Neo4j Bolt | 7687 | Graph driver |
| Neo4j Browser | 7474 | Admin UI |
| Prometheus | 9090 | Metrics |
| Grafana | 3001 | Dashboards |
flowchart LR
Dev["Developer"] --> Compose["Docker Compose"]
Compose --> API["API"]
Compose --> Postgres["Postgres"]
Compose --> Neo4j["Neo4j"]
Postgres --> Exporter["Postgres Exporter"] Bring-Up Tasks
- Create
.envwith DB creds and API keys -
docker compose up -d -
uv run scripts/generate_types.py - Start API service
import subprocess, os
# Generate types from Pydantic (1)!
subprocess.check_call(["uv", "run", "scripts/generate_types.py"]) # (1) Pydantic → TS types
# Start FastAPI via uvicorn (2)!
os.system("uvicorn server.main:app --reload --port 8000") # (2) Dev server
// Frontend dev typically proxies to :8000
console.log("Ensure generated.ts exists and API ready at /ready");
flowchart TB
Env[".env"] --> Compose
P["Pydantic"] --> Types["generated.ts"]
Types --> UI["Frontend"]
Compose --> API["API"]
API --> READY["/api/ready"] Container Logs
Use /docker/{container}/logs to fetch current log lines via API for basic troubleshooting when UI access is limited.