Production-grade RAG reference architecture

Secure, observable, workspace-aware retrieval augmented generation.

A cloud-portable monorepo that demonstrates the complete enterprise RAG lifecycle: ingestion, indexing, retrieval, generation, evaluation, guardrails, and operations.

Local demo • Cloud-ready seams

Composable layers

  • FastAPI control plane and streaming answer endpoints
  • Worker-driven ingestion and document normalization
  • Provider abstractions for LLMs, embeddings, and vector stores
  • Prometheus-ready observability and evaluation hooks

System topology

Reference implementation boundaries

The application is intentionally split into independently replaceable surfaces so teams can promote the local demo to managed cloud services without rewriting business logic.

Lifecycle

From enterprise content to cited answers

The demo follows a production RAG path with explicit data ownership, retrieval diagnostics, confidence scoring, and human review routing for low-confidence answers.

  1. IngestRegister sources, normalize text, chunk documents, and persist metadata.
  2. IndexCreate embeddings through provider seams and store workspace-scoped vectors.
  3. RetrieveRun similarity, hybrid, and MMR-style retrieval with explainable diagnostics.
  4. GenerateProduce structured answers with citations, confidence, and safe fallback behavior.
  5. OperateTrack health, metrics, evaluations, and roadmap items for production hardening.

Production concerns

Built around enterprise operating requirements

Security first

JWT authentication, role-based access, workspace authorization, prompt-injection detection, and PII redaction primitives.

Cloud portable

Docker Compose for the local stack with package boundaries that map cleanly to AWS, Azure, GCP, or managed SaaS services.

Observable

Health endpoints, structured logging seams, Prometheus metrics, and evaluation scripts provide operational visibility.

Provider neutral

LLM, embedding, vector store, object storage, and model provider interfaces isolate vendor-specific code.

Explore the repo

Architecture resources