Containers — learn-ai
Generated 2026-06-24 13:33 UTC · c4gen dev
The runtime/deployable units inside learn-ai and how data moves between them and adjacent systems.
Containers
| Container | Technology | Responsibility |
|---|---|---|
| APISIX Gateway | Apache APISIX 3.13 (apisix.yaml static config) | Edge gateway for /http/* agent routes. Enforces Keycloak OIDC (openid-connect, pass-or-require) for learner routes and static key-auth (canvas_token) for the Canvas syllabus/tutor routes; sets CORS and Referrer-Policy. Upstreams to Nginx. |
| Nginx | Nginx (uwsgi_pass templates) | Reverse proxy in front of the ASGI app; forwards APISIX-authenticated requests. |
| ASGI / Channels Web | Django + DRF + Channels, Granian ASGI (Python 3.12) | Single ASGI app (main.asgi). AsyncHttpConsumer subclasses per bot (recommendation, syllabus, canvas syllabus, tutor, canvas tutor, video GPT) stream SSE; non-agent paths fall through to the Django ASGI app (admin, user_meta, healthz). Runs the LangGraph agent loop. |
| Celery Worker (default, edx_content; -B beat) | Celery worker + embedded beat (RedBeat) | Housekeeping only — prunes stale anonymous chat sessions. No ETL or LLM calls run here today; the conversational path is fully synchronous in the ASGI app. |
| PostgreSQL | PostgreSQL 18 (RDS in prod) | System of record for users, UserChatSession, and LangGraph checkpoints (DjangoCheckpoint / DjangoCheckpointWrite) backing the AsyncDjangoSaver checkpointer. Also hosts the LiteLLM proxy DB. |
| Redis / Valkey | Redis 7 (ElastiCache Valkey in prod) | channels_redis Channel layer, Django cache (incl. cached prompts), and Celery broker / RedBeat schedule store. |
| LiteLLM Proxy | LiteLLM proxy (ghcr.io berriai/litellm) | OpenAI-compatible proxy shipped alongside the app (config/litellm_config.yml). Routes to OpenAI-compatible models and AWS Bedrock; enforces per-end-user budgets/rate limits. The app talks to it via langchain_litellm.ChatLiteLLM. |