CAPSTONE: DocuMind AI Platform
This capstone chapter joins asynchronous ingestion, hybrid retrieval, reranking, streamed generation, a checkpointed reasoning graph, evaluation gates, Kubernetes scaling, and observable token and retrieval costs.
- Explain Sprint 1: Core RAG backend by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Sprint 2: LangGraph agent by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Sprint 3: Production by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Trace the chapter's complete execution path and identify where memory, I/O, concurrency, persistence, or rendering cost accumulates.
- Build the worked example, make one failure visible, and defend the design in a review.
How to use this chapter
For CAPSTONE: DocuMind AI Platform, read the explanations first and predict every example before running it. Keep a learning repository containing code, tests, command output, and the short written submission. The roadmap checklist at the end audits coverage; the chapter itself follows the capstone learning arc appropriate to this subject.
The problem this chapter solves
This capstone chapter joins asynchronous ingestion, hybrid retrieval, reranking, streamed generation, a checkpointed reasoning graph, evaluation gates, Kubernetes scaling, and observable token and retrieval costs.
A model alone has limited freshness, reliability, context, and agency. Engineering layers constrain outputs, ground claims in data, and make decisions inspectable and recoverable.
Learning outcomes
- Explain Sprint 1: Core RAG backend by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Sprint 2: LangGraph agent by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Explain Sprint 3: Production by naming its input, guarantee, internal lifecycle, important failure, and proof.
- Trace the chapter's complete execution path and identify where memory, I/O, concurrency, persistence, or rendering cost accumulates.
- Build the worked example, make one failure visible, and defend the design in a review.
Chapter progression
The order below is intentional: later sections depend on guarantees established earlier.
Runtime or system overview
Text is tokenized and processed autoregressively: each output token is sampled from a conditional distribution. Retrieval adds selected external context; tool calling asks normal code to perform actions; agent graphs persist explicit state and routes. None of these mechanisms guarantee truth, so evaluation and validation remain mandatory. In CAPSTONE: DocuMind AI Platform, use that execution model to decide where the chapter's validation, state ownership, cleanup, and evidence belong.
Execution trace
- Deterministic code validates the request, identity, tenant, budgets, schemas, and permitted tools before assembling model context.
- Retrieval or memory selection chooses bounded, provenance-bearing evidence; tokenization converts the assembled messages into the model's input sequence.
- The provider generates or streams tokens, or proposes typed tool arguments; application code validates every output and executes only authorized bounded actions.
- Parsers and business rules accept, repair once under policy, route, or reject the result; citations and state transitions are persisted with model, prompt, index, and dataset versions.
- Offline evaluation and production telemetry measure retrieval, faithfulness, latency, token cost, tool errors, safety outcomes, and regressions by cohort.
Memory and performance lens
Context windows hold tokens, not durable memory. Conversation memory is application-managed storage that is selected and inserted into later prompts. Embedding indexes store vectors plus metadata; agent checkpoints store state transitions. Token budgets, cache policy, and data retention must be designed explicitly. For CAPSTONE: DocuMind AI Platform, connect those costs to the concrete operations in the topic sections rather than assuming the friendly surface syntax is cheap.
When tuning CAPSTONE: DocuMind AI Platform, measure end-to-end correctness under representative load, tail latency, saturation, duplicate/lost effects, recovery time, security denials, and cost rather than optimizing from source-code appearance.
1. Sprint 1: Core RAG backend
The Sprint 1: Core RAG backend unit begins with FastAPI async + lifespan (DB pool/Redis/ML models): The first DocuMind sprint creates a durable ingestion-to-answer pipeline: streamed upload, asynchronous extraction/chunking, versioned embeddings, tenant-filtered hybrid retrieval, reranking, and citation-aware streaming generation. Keep upload status explicit, version every parser/splitter/model, and make reprocessing replace-safe. The rest of this section connects that guarantee to this unit's related roadmap concepts instead of treating each term as an isolated flashcard.
The vertical slice: Sprint 1: Core RAG backend
| Concept | Meaning | Engineering decision |
|---|---|---|
| FastAPI async + lifespan (DB pool/Redis/ML models) | The first DocuMind sprint creates a durable ingestion-to-answer pipeline: streamed upload, asynchronous extraction/chunking, versioned embeddings, tenant-filtered hybrid retrieval, reranking, and citation-aware streaming generation. | Keep upload status explicit, version every parser/splitter/model, and make reprocessing replace-safe. |
| PDF/DOCX/TXT upload → Celery → chunking → embeddings → pgvector | The first DocuMind sprint creates a durable ingestion-to-answer pipeline: streamed upload, asynchronous extraction/chunking, versioned embeddings, tenant-filtered hybrid retrieval, reranking, and citation-aware streaming generation. | Keep upload status explicit, version every parser/splitter/model, and make reprocessing replace-safe. |
| hybrid search + BGE reranker + GPT-4o streaming | The first DocuMind sprint creates a durable ingestion-to-answer pipeline: streamed upload, asynchronous extraction/chunking, versioned embeddings, tenant-filtered hybrid retrieval, reranking, and citation-aware streaming generation. | Keep upload status explicit, version every parser/splitter/model, and make reprocessing replace-safe. |
| Redis idempotency keys for uploads | The first DocuMind sprint creates a durable ingestion-to-answer pipeline: streamed upload, asynchronous extraction/chunking, versioned embeddings, tenant-filtered hybrid retrieval, reranking, and citation-aware streaming generation. | Keep upload status explicit, version every parser/splitter/model, and make reprocessing replace-safe. |
Ownership across the system: Sprint 1: Core RAG backend
FastAPI async + lifespan (DB pool/Redis/ML models). A transaction records the document and outbox identity; workers replace the document's indexed chunks idempotently. Query-time lexical and vector candidates fuse, a reranker narrows evidence, and generation streams only after provenance is attached.
PDF/DOCX/TXT upload → Celery → chunking → embeddings → pgvector. A transaction records the document and outbox identity; workers replace the document's indexed chunks idempotently. Query-time lexical and vector candidates fuse, a reranker narrows evidence, and generation streams only after provenance is attached.
hybrid search + BGE reranker + GPT-4o streaming. A transaction records the document and outbox identity; workers replace the document's indexed chunks idempotently. Query-time lexical and vector candidates fuse, a reranker narrows evidence, and generation streams only after provenance is attached.
Redis idempotency keys for uploads. A transaction records the document and outbox identity; workers replace the document's indexed chunks idempotently. Query-time lexical and vector candidates fuse, a reranker narrows evidence, and generation streams only after provenance is attached.
Read these as one system: FastAPI async + lifespan (DB pool/Redis/ML models) establishes the starting contract, PDF/DOCX/TXT upload → Celery → chunking → embeddings → pgvector changes how that contract is executed or represented, and Redis idempotency keys for uploads exposes a later boundary or failure condition. A local optimization is useful only when the combined behavior stays correct and observable.
Implementation checkpoint: Sprint 1: Core RAG backend
1ORDER BY embedding <=> :query_vector LIMIT 20This Sprint 1: Core RAG backend slice makes FastAPI async + lifespan (DB pool/Redis/ML models) observable. Read it from the boundary inward: identify the input, the validation point, the state or operation, and the value that proves the result. Before extending it toward Redis idempotency keys for uploads, predict its behavior for empty, invalid, repeated, and large input.
Integration risks: Sprint 1: Core RAG backend
| Risk | Why it matters |
|---|---|
| FastAPI async + lifespan (DB pool/Redis/ML models) | Publishing work before the document transaction commits or mixing embedding versions creates phantom jobs and inconsistent retrieval. |
| PDF/DOCX/TXT upload → Celery → chunking → embeddings → pgvector | Publishing work before the document transaction commits or mixing embedding versions creates phantom jobs and inconsistent retrieval. |
| hybrid search + BGE reranker + GPT-4o streaming | Publishing work before the document transaction commits or mixing embedding versions creates phantom jobs and inconsistent retrieval. |
| Redis idempotency keys for uploads | Publishing work before the document transaction commits or mixing embedding versions creates phantom jobs and inconsistent retrieval. |
Sprint submission: Sprint 1: Core RAG backend
- Foundation: implement or demonstrate FastAPI async + lifespan (DB pool/Redis/ML models) with one valid input and one invalid input. Record the exact output or failure.
- Integration: combine FastAPI async + lifespan (DB pool/Redis/ML models) with PDF/DOCX/TXT upload → Celery → chunking → embeddings → pgvector. Explain which component owns validation and cleanup.
- Production: design a test or experiment that exposes the failure described for Redis idempotency keys for uploads. State the metric, assertion, or query plan that proves the correction.
What a strong checkpoint answer contains
- A precise boundary and typed or validated input.
- One named guarantee, not only a library call.
- A negative case that fails for the intended reason.
- Cleanup, transaction, retry, or cancellation behavior where applicable.
- Evidence: assertion, command output, plan, trace, metric, or accessible UI state.
2. Sprint 2: LangGraph agent
The Sprint 2: LangGraph agent unit begins with Multi-document reasoning StateGraph (5 nodes): The DocuMind agent is an explicit state graph whose nodes analyze a question, retrieve and rerank evidence, synthesize an answer, format citations, and route incomplete or no-context cases. Keep routing predicates deterministic, cap cycles and tool calls, and record node-level inputs, outputs, latency, and error state. The rest of this section connects that guarantee to this unit's related roadmap concepts instead of treating each term as an isolated flashcard.
The vertical slice: Sprint 2: LangGraph agent
| Concept | Meaning | Engineering decision |
|---|---|---|
| Multi-document reasoning StateGraph (5 nodes) | The DocuMind agent is an explicit state graph whose nodes analyze a question, retrieve and rerank evidence, synthesize an answer, format citations, and route incomplete or no-context cases. | Keep routing predicates deterministic, cap cycles and tool calls, and record node-level inputs, outputs, latency, and error state. |
| query_analyzer→retriever→reranker→synthesizer→citation_formatter | The DocuMind agent is an explicit state graph whose nodes analyze a question, retrieve and rerank evidence, synthesize an answer, format citations, and route incomplete or no-context cases. | Keep routing predicates deterministic, cap cycles and tool calls, and record node-level inputs, outputs, latency, and error state. |
| conditional routing: single vs multi-doc vs no-context | The DocuMind agent is an explicit state graph whose nodes analyze a question, retrieve and rerank evidence, synthesize an answer, format citations, and route incomplete or no-context cases. | Keep routing predicates deterministic, cap cycles and tool calls, and record node-level inputs, outputs, latency, and error state. |
| PostgreSQL checkpointer + Kafka ingest events | The DocuMind agent is an explicit state graph whose nodes analyze a question, retrieve and rerank evidence, synthesize an answer, format citations, and route incomplete or no-context cases. | Keep routing predicates deterministic, cap cycles and tool calls, and record node-level inputs, outputs, latency, and error state. |
Ownership across the system: Sprint 2: LangGraph agent
Multi-document reasoning StateGraph (5 nodes). Each node consumes typed state and returns a partial update; conditional edges select the next node; checkpoints make interruption, inspection, approval, and resume reproducible.
query_analyzer→retriever→reranker→synthesizer→citation_formatter. Each node consumes typed state and returns a partial update; conditional edges select the next node; checkpoints make interruption, inspection, approval, and resume reproducible.
conditional routing: single vs multi-doc vs no-context. Each node consumes typed state and returns a partial update; conditional edges select the next node; checkpoints make interruption, inspection, approval, and resume reproducible.
PostgreSQL checkpointer + Kafka ingest events. Each node consumes typed state and returns a partial update; conditional edges select the next node; checkpoints make interruption, inspection, approval, and resume reproducible.
Read these as one system: Multi-document reasoning StateGraph (5 nodes) establishes the starting contract, query_analyzer→retriever→reranker→synthesizer→citation_formatter changes how that contract is executed or represented, and PostgreSQL checkpointer + Kafka ingest events exposes a later boundary or failure condition. A local optimization is useful only when the combined behavior stays correct and observable.
Implementation checkpoint: Sprint 2: LangGraph agent
1graph = StateGraph(State); graph.add_node("retrieve", retrieve); graph.add_conditional_edges(...)This Sprint 2: LangGraph agent slice makes Multi-document reasoning StateGraph (5 nodes) observable. Read it from the boundary inward: identify the input, the validation point, the state or operation, and the value that proves the result. Before extending it toward PostgreSQL checkpointer + Kafka ingest events, predict its behavior for empty, invalid, repeated, and large input.
Integration risks: Sprint 2: LangGraph agent
| Risk | Why it matters |
|---|---|
| Multi-document reasoning StateGraph (5 nodes) | A no-context route is not GraphQL resolver context; letting generated prose silently decide state transitions makes the graph untestable. |
| query_analyzer→retriever→reranker→synthesizer→citation_formatter | A no-context route is not GraphQL resolver context; letting generated prose silently decide state transitions makes the graph untestable. |
| conditional routing: single vs multi-doc vs no-context | A no-context route is not GraphQL resolver context; letting generated prose silently decide state transitions makes the graph untestable. |
| PostgreSQL checkpointer + Kafka ingest events | A no-context route is not GraphQL resolver context; letting generated prose silently decide state transitions makes the graph untestable. |
Sprint submission: Sprint 2: LangGraph agent
- Foundation: implement or demonstrate Multi-document reasoning StateGraph (5 nodes) with one valid input and one invalid input. Record the exact output or failure.
- Integration: combine Multi-document reasoning StateGraph (5 nodes) with query_analyzer→retriever→reranker→synthesizer→citation_formatter. Explain which component owns validation and cleanup.
- Production: design a test or experiment that exposes the failure described for PostgreSQL checkpointer + Kafka ingest events. State the metric, assertion, or query plan that proves the correction.
What a strong checkpoint answer contains
- A precise boundary and typed or validated input.
- One named guarantee, not only a library call.
- A negative case that fails for the intended reason.
- Cleanup, transaction, retry, or cancellation behavior where applicable.
- Evidence: assertion, command output, plan, trace, metric, or accessible UI state.
3. Sprint 3: Production
The Sprint 3: Production unit begins with RAGAS eval pipeline in CI: Reranking applies a slower query-document model to a small candidate set; evaluation measures retrieval and answer quality separately. Track recall before reranking, context precision after reranking, and citation faithfulness after generation. The rest of this section connects that guarantee to this unit's related roadmap concepts instead of treating each term as an isolated flashcard.
The vertical slice: Sprint 3: Production
| Concept | Meaning | Engineering decision |
|---|---|---|
| RAGAS eval pipeline in CI | Reranking applies a slower query-document model to a small candidate set; evaluation measures retrieval and answer quality separately. | Track recall before reranking, context precision after reranking, and citation faithfulness after generation. |
| Kubernetes: HPA on FastAPI pods | Ingress routes external HTTP traffic; certificate controllers automate TLS; HPA and KEDA alter replica count from metrics or event pressure; PDB limits voluntary disruption. | Set requests correctly, stabilize scale decisions, and test zero-to-one activation. |
| Prometheus: query latency/retrieval precision/token cost | Metrics aggregate numeric behavior; Prometheus scrapes labeled time series, Grafana visualizes them, and Alertmanager groups and routes actionable conditions. | Instrument request rate, error rate, duration, saturation, and domain outcomes; alert on sustained user impact. |
| React frontend: drag-drop/streaming chat/citation highlighting | The DocuMind frontend coordinates file ingestion, incremental assistant output, and inspectable source citations without pretending uncertain work is instantaneous. | Use progressive states, accessible drop alternatives, reconnect/resume behavior, and citation focus that works with keyboard and screen readers. |
Ownership across the system: Sprint 3: Production
RAGAS eval pipeline in CI. A cross-encoder jointly scores query and chunk. RAG evaluation compares answer claims, retrieved context, and reference expectations.
Kubernetes: HPA on FastAPI pods. Controllers watch custom resources and write ordinary Kubernetes objects. HPA calculates desired replicas from current/target metric ratios; KEDA activates workloads and feeds scaling metrics.
Prometheus: query latency/retrieval precision/token cost. Counters increase, gauges move in either direction, and histograms bucket observations for aggregatable quantiles. Labels multiply series cardinality.
React frontend: drag-drop/streaming chat/citation highlighting. The browser uploads through bounded requests, records server job identity, consumes a stream with cancellation, appends validated deltas, and maps citation IDs to immutable document spans. Route and query state survive navigation; ephemeral drag state stays local.
Read these as one system: RAGAS eval pipeline in CI establishes the starting contract, Kubernetes: HPA on FastAPI pods changes how that contract is executed or represented, and React frontend: drag-drop/streaming chat/citation highlighting exposes a later boundary or failure condition. A local optimization is useful only when the combined behavior stays correct and observable.
Implementation checkpoint: Sprint 3: Production
1apiVersion: autoscaling/v22kind: HorizontalPodAutoscaler3spec:4 minReplicas: 25 maxReplicas: 10This Sprint 3: Production slice makes RAGAS eval pipeline in CI observable. Read it from the boundary inward: identify the input, the validation point, the state or operation, and the value that proves the result. Before extending it toward React frontend: drag-drop/streaming chat/citation highlighting, predict its behavior for empty, invalid, repeated, and large input.
Integration risks: Sprint 3: Production
| Risk | Why it matters |
|---|---|
| RAGAS eval pipeline in CI | LLM judges are noisy and biased; calibrate them with human-reviewed examples. |
| Kubernetes: HPA on FastAPI pods | Autoscaling cannot repair a saturated database or missing per-pod concurrency limit. |
| Prometheus: query latency/retrieval precision/token cost | User IDs, URLs, and trace IDs as metric labels can exhaust memory. |
| React frontend: drag-drop/streaming chat/citation highlighting | Appending untrusted HTML, losing stream identity after reconnect, or highlighting by mutable character offsets can create XSS, duplicate text, or incorrect evidence. |
Sprint submission: Sprint 3: Production
- Foundation: implement or demonstrate RAGAS eval pipeline in CI with one valid input and one invalid input. Record the exact output or failure.
- Integration: combine RAGAS eval pipeline in CI with Kubernetes: HPA on FastAPI pods. Explain which component owns validation and cleanup.
- Production: design a test or experiment that exposes the failure described for React frontend: drag-drop/streaming chat/citation highlighting. State the metric, assertion, or query plan that proves the correction.
What a strong checkpoint answer contains
- A precise boundary and typed or validated input.
- One named guarantee, not only a library call.
- A negative case that fails for the intended reason.
- Cleanup, transaction, retry, or cancellation behavior where applicable.
- Evidence: assertion, command output, plan, trace, metric, or accessible UI state.
Complete worked example
This example integrates the chapter rather than demonstrating an isolated method.
1@router.post("/documents", status_code=202)2async def upload(file: UploadFile, key: str = Header(alias="Idempotency-Key"), user=Depends(current_user)):3 digest = await stream_to_object_storage(file, owner=user.id)4 document, created = await documents.create_once(owner=user.id, key=key, digest=digest)5 if created:6 await outbox.append("document.uploaded.v1", key=str(document.id), payload={"document_id": str(document.id)})7 return {"document_id": document.id, "status": document.status}8
9async def ingest(event):10 chunks = split_with_provenance(await extract(event.document_id))11 vectors = await embed_in_batches(chunks)12 await index.replace_document(event.document_id, chunks, vectors)Expected result
1Repeated upload keys return the same document; committed outbox delivery starts a replace-safe ingestion pipeline.Line-by-line reading
| Line | Code | Explanation |
|---|---|---|
| 1 | @router.post("/documents", status_code=202) | Applies a decorator or framework annotation before the following definition is bound. |
| 2 | async def upload(file: UploadFile, key: str = Header(alias="Idempotency-Key"), user=Depends(current_user)): | Defines a coroutine function; calling it creates a coroutine object and await drives its execution. |
| 3 | digest = await stream_to_object_storage(file, owner=user.id) | Starts or resumes asynchronous I/O and yields control until the awaited operation completes. |
| 4 | document, created = await documents.create_once(owner=user.id, key=key, digest=digest) | Starts or resumes asynchronous I/O and yields control until the awaited operation completes. |
| 5 | if created: | Evaluates the condition and enters this branch only when it is truthy. |
| 6 | await outbox.append("document.uploaded.v1", key=str(document.id), payload={"document_id": str(document.id)}) | Starts or resumes asynchronous I/O and yields control until the awaited operation completes. |
| 7 | return {"document_id": document.id, "status": document.status} | Returns the observable result to the caller and ends this invocation. |
| 9 | async def ingest(event): | Defines a coroutine function; calling it creates a coroutine object and await drives its execution. |
| 10 | chunks = split_with_provenance(await extract(event.document_id)) | Starts or resumes asynchronous I/O and yields control until the awaited operation completes. |
| 11 | vectors = await embed_in_batches(chunks) | Starts or resumes asynchronous I/O and yields control until the awaited operation completes. |
| 12 | await index.replace_document(event.document_id, chunks, vectors) | Starts or resumes asynchronous I/O and yields control until the awaited operation completes. |
Step-by-step execution
- Deterministic code validates the request, identity, tenant, budgets, schemas, and permitted tools before assembling model context.
- Retrieval or memory selection chooses bounded, provenance-bearing evidence; tokenization converts the assembled messages into the model's input sequence.
- The provider generates or streams tokens, or proposes typed tool arguments; application code validates every output and executes only authorized bounded actions.
- Parsers and business rules accept, repair once under policy, route, or reject the result; citations and state transitions are persisted with model, prompt, index, and dataset versions.
- Offline evaluation and production telemetry measure retrieval, faithfulness, latency, token cost, tool errors, safety outcomes, and regressions by cohort.
Common mistakes and professional corrections
| Area | Common failure | Better engineering choice |
|---|---|---|
| Sprint 1: Core RAG backend | Publishing work before the document transaction commits or mixing embedding versions creates phantom jobs and inconsistent retrieval. | Keep upload status explicit, version every parser/splitter/model, and make reprocessing replace-safe. |
| Sprint 2: LangGraph agent | A no-context route is not GraphQL resolver context; letting generated prose silently decide state transitions makes the graph untestable. | Keep routing predicates deterministic, cap cycles and tool calls, and record node-level inputs, outputs, latency, and error state. |
| Sprint 3: Production | LLM judges are noisy and biased; calibrate them with human-reviewed examples. | Track recall before reranking, context precision after reranking, and citation faithfulness after generation. |
Interview and review notes
- Define the central abstraction without naming a library function.
- Trace one request, call, query, message, render, or state transition from input to observable result.
- Compare two alternatives from this chapter by guarantee, cost, and failure behavior.
- Explain the most likely production bug and the test or metric that reveals it.
- State what remains authoritative after process loss, retry, reconnect, or deployment.
Practice set
Easy
- Define every bold term in the concept tables in one precise sentence.
- Reproduce the focused examples and annotate the value or state after each important line.
- Explain the chapter progression diagram aloud in two minutes.
Medium
- Replace one convenient default with an explicit policy for validation, timeout, ordering, pagination, cleanup, or error handling.
- Write a negative test for each topic group.
- Compare the measured behavior before and after one justified change.
Hard
- Combine all topic groups into one thin vertical slice.
- Inject a realistic failure at the most important external boundary and prove recovery.
- Write a one-page design note covering ownership, trade-offs, security, observability, and rollback.
Chapter submission
Submit:
- source code or reproducible commands;
- automated tests plus one deliberately failing-before-fix test;
- captured output, query plan, trace, screenshot, or metric;
- a 300–500 word explanation of the execution flow and one rejected alternative;
- a short README with setup, versions, limitations, and cleanup steps.
- Continue with the DocuMind AI Platform project workshop.
Self-review rubric
| Dimension | Beginning | Competent | Professional |
|---|---|---|---|
| Explanation | Names APIs | Explains behavior | Connects guarantees, internals, and trade-offs |
| Implementation | Happy path only | Validated and tested | Clear ownership, failure recovery, and cleanup |
| Evidence | Manual claim | Repeatable output | Tests plus meaningful measurement or inspection |
| Communication | Steps missing | Reproducible README | Decisions, limits, and alternatives are explicit |
Roadmap coverage checklist
- To do: Sprint 1: Core RAG backend: FastAPI async + lifespan (DB pool/Redis/ML models)
- To do: Sprint 1: Core RAG backend: PDF/DOCX/TXT upload → Celery → chunking → embeddings → pgvector
- To do: Sprint 1: Core RAG backend: hybrid search + BGE reranker + GPT-4o streaming
- To do: Sprint 1: Core RAG backend: Redis idempotency keys for uploads
- To do: Sprint 2: LangGraph agent: Multi-document reasoning StateGraph (5 nodes)
- To do: Sprint 2: LangGraph agent: query_analyzer→retriever→reranker→synthesizer→citation_formatter
- To do: Sprint 2: LangGraph agent: conditional routing: single vs multi-doc vs no-context
- To do: Sprint 2: LangGraph agent: PostgreSQL checkpointer + Kafka ingest events
- To do: Sprint 3: Production: RAGAS eval pipeline in CI
- To do: Sprint 3: Production: Kubernetes: HPA on FastAPI pods
- To do: Sprint 3: Production: Prometheus: query latency/retrieval precision/token cost
- To do: Sprint 3: Production: React frontend: drag-drop/streaming chat/citation highlighting
Quick revision
- Sprint 1: Core RAG backend: connect the surface API to its guarantee, lifecycle, failure boundary, and evidence.
- Sprint 2: LangGraph agent: connect the surface API to its guarantee, lifecycle, failure boundary, and evidence.
- Sprint 3: Production: connect the surface API to its guarantee, lifecycle, failure boundary, and evidence.
- Re-read the worked-example execution trace instead of memorizing isolated syntax.
- If you cannot name the owner of state and cleanup, the design is not yet complete.
Mastery check
How well can you recall this?
Finished this lesson?