Skip to content

Data Flows — learn-ai

Generated 2026-06-24 13:33 UTC · c4gen dev

Each scenario below replays one interaction as a C4 Dynamic diagram. Amber steps are asynchronous (queued / scheduled / event-driven).

How to read these diagrams

These are C4 model diagrams (C4-PlantUML). Read them top-down: System Context (the whole SOA) → Container (one system's runtime units) → Dynamic (a single data flow, step by step).

  • People are rounded boxes; systems and containers are rectangles; databases and queues have distinct shapes.
  • Each arrow is a data flow labelled with what moves.
  • Solid arrows are synchronous (request/response, caller blocks).
  • Amber dashed arrows are asynchronous (queued, scheduled, or event-driven — caller does not block).
  • Drag to pan, scroll to zoom. Boxes with a link drill into the next level.

Agentic chat turn with MIT Learn tool calls (synchronous, streamed)

A learner asks a question. APISIX authenticates via Keycloak OIDC and proxies to the ASGI consumer, which loads/creates a LangGraph checkpoint in Postgres. The ReAct agent calls the LLM via LiteLLM; the model emits a tool call, the agent queries the MIT Learn vector/content API, feeds results back to the LLM, and streams the final answer over SSE. The turn is traced to LangSmith/PostHog.

Canvas tutor agent (server-to-server, key-auth)

Canvas calls the tutor/syllabus agent with a static canvas_token. APISIX validates the key (no OIDC) and proxies through. The TutorBot fetches the problem set + solution from the MIT Learn tutor API and runs the open-learning-ai-tutor agent loop via LiteLLM, streaming guidance back.

Stale anonymous session cleanup (asynchronous)

Celery Beat periodically triggers delete_stale_sessions, which removes anonymous chat sessions older than the configured expiry from Postgres.