System Architecture
This reference implementation is a Retrieval-Augmented Generation system: it embeds a question, retrieves the most similar chunks from a vector store, and asks an LLM to answer using only those chunks, with citations.
Model
The interactive C4 model below is rendered live from the
architecture/
directory via the LikeC4 Vite plugin.
Components
| Component | Technology | Role |
|---|---|---|
| Web UI | React + Vite on S3 + CloudFront | Ask a question; show the answer and source chunks |
| RAG API | FastAPI on Lambda (Mangum), API Gateway HTTP API | Embed query, retrieve, synthesize answer |
| Vector store | Aurora Serverless v2 + pgvector (RDS Data API) | Document chunks and their embeddings |
| Ingestion | Python (Bedrock Titan) | Load corpus, chunk, embed, upsert |
| Models | AWS Bedrock (Titan embeddings, Claude) | Embeddings and generation |
| Corpus | neural-bridge/rag-dataset-12000 (Apache-2.0) | Source knowledge |
Why these choices
The system optimizes for near-zero idle cost. Aurora Serverless v2 with 0-ACU auto-pause lets the vector store scale to zero, and Bedrock is pay-per-token with no idle charge. See the cost model, infrastructure, and the Decisions (ADRs) section in the sidebar for the full rationale.
Containers
A more detailed view of the system internals:
Query sequence
Step-by-step flow of a single query through the system:
Ingestion
Corpus ingestion runs as a local script during development and as a one-off Lambda invocation in AWS:
© 2026 Benjamin Arunski