Fast-Chat is a multi-service conversational AI system with:
chat-ui: Chainlit frontendchat-api: OpenAI-compatible BFF APIchat-app: LangGraph multi-agent orchestratordocproc: document processing and vector-store utilities
Browser
|
v
chat-ui (Chainlit, :8080)
|
v
chat-api (FastAPI BFF, :8000)
|
v
chat-app (LangGraph orchestrator, :8001)
|
+--> Redis (state + cancellation, :6379)
+--> Postgres (checkpoints + memory, :5432)
chat-api also owns vector-search API and persists API-layer data.
User message
-> chat-ui
-> chat-api `/v1/chat/completions` or `/v1/responses`
-> chat-app supervisor graph
-> tools/agents (web, RAG, code)
-> SSE stream back through chat-api
-> chat-ui renders tokens + status + usage events
- Docker + Docker Compose plugin
uvinstalled- OpenAI API key
cp .env.example .env
# edit .env and set required keysMinimum required for end-to-end chat:
OPENAI_API_KEY
Common optional keys:
PERPLEXITY_API_KEY(if enabled for web search provider)LITELLM_BASE_URL,LITELLM_API_KEY(if routing via LiteLLM)CHAINLIT_AUTH_SECRET(chat-ui auth/session hardening)
docker compose up --build -dAccess:
- UI:
http://localhost:8080 - API docs:
http://localhost:8000/docs - Orchestrator health:
http://localhost:8001/health
docker compose downdocker compose up --build -d
docker compose ps
docker compose logs -f chat-api
docker compose logs -f chat-app
docker compose logs -f chat-ui
docker compose down# sync environments
(cd docproc && uv sync --all-groups --frozen)
(cd chat-api && uv sync --all-groups --frozen)
(cd chat-app && uv sync --all-groups)
(cd chat-ui && uv sync --all-groups)
# terminal 1: chat-api
(cd chat-api && uv run uvicorn src.main:app --port 8000)
# terminal 2: chat-app
(cd chat-app && uv run langgraph dev)
# terminal 3: chat-ui
(cd chat-ui && uv run chainlit run app.py --port 8080)(cd docproc && uv run pytest -q)
(cd chat-api && uv run pytest -q)
(cd chat-app && uv run pytest -q)
(cd chat-ui && uv run pytest -q)These files are high-value anchors for agents because they define system contracts:
-
docker-compose.ymlReason: canonical runtime topology and container env wiring. -
.env.exampleReason: authoritative environment-variable schema and defaults. -
chat-api/src/main.pyReason: API service bootstrap, middleware, and route registration. -
chat-app/src/chat_app/graphs/app.pyReason: compiled LangGraph entrypoint used at runtime. -
chat-app/src/chat_app/api.pyReason: OpenAI-compatible adapter and streaming interface. -
chat-ui/app.pyReason: frontend runtime behavior, SSE handling, and model selection flow.
If file-level paths drift, use these folder-level anchors:
chat-api/src/routers/: external API contracts and route behavior.chat-app/src/chat_app/agents/: agent role definitions.chat-app/src/chat_app/tools/: tool execution surface available to agents.chat-app/prompts/: system prompts and role instructions.docproc/docproc/services/: document extraction, chunking, summarization, and vector-store workflows.tests/: cross-service behavioral contracts and integration checks.
POST /v1/chat/completionsPOST /v1/responsesGET /v1/modelsPOST /v1/searchGET /health
POST /v1/chat/completionsPOST /v1/chat/resumeGET /v1/chat/interrupt/{thread_id}GET /health
chat-api:- BFF request normalization
- model policy / registry surfaces
- search endpoint ownership
chat-app:- supervisor routing
- tool orchestration
- memory/checkpoint interactions
- Redis:
- cancellation and transient coordination state
- Postgres:
- durable checkpoints/memory backing
- Single canonical Compose file:
docker-compose.yml. - Default service ports:
8080chat-ui8000chat-api8001chat-app (container internal maps to host8001)6379Redis5432Postgres
- Health checks are defined in Compose; use
docker compose psfor status.
- Service fails at startup:
- run
docker compose logs -f <service> - verify
.envvalues against.env.example
- run
- API timeout from UI:
- verify
CHAT_API_URLwiring indocker-compose.yml
- verify
- No model responses:
- verify
OPENAI_API_KEY - check
chat-apiandchat-applogs for provider/auth errors
- verify
chat-api/ FastAPI BFF and OpenAI-compatible API layer
chat-app/ LangGraph orchestration, agents, tools, prompts
chat-ui/ Chainlit frontend and user interaction layer
docproc/ Document extraction/summarization/vector utilities
tests/ Cross-service tests and contract checks
docs/ Supplemental design and behavior notes