ProjectBuild an AI-Powered Digital Bank with RAG: the explanation · Module 3: Infrastructure decisions and their trade-offs · part 5 of 20
Part 5 · Module 3: Infrastructure decisions and their trade-offs

Module 3: Infrastructure decisions and their trade-offs

22 min read·
About 35 minutes · Needs: Module 1 (the problem) · Code: docker-compose.yml, backend/app/core/config.py, backend/app/observability/costs.py, backend/app/rag/embeddings.py

Where this fits

WHERE THIS FITS The Kestrel Bank system this module CLIENT API LAYER FastAPI SAFETY AGENT LangGraph MODELS RETRIEVAL DATA AND INGESTION Postgres, Redis QUALITY Langfuse Customer app React Admin app React FastAPI REST + streaming Auth + RBAC tokens, roles Document upload admin only, checked Guardrails injection, PII Router small or large Agent LangGraph Banking tools ledger, transfers LLMs Groq, Gemini Retrieval hybrid + rerank Ingestion parse, chunk, embed PostgreSQL + pgvector ledger, chunks, state Redis limits, queue Observability Langfuse, metrics, logs Evaluation golden set, release gate
The parts whose technology this module chooses (blue): the API, the agent library, the models, the database, Redis and observability.

Before any feature is built, someone picks the building blocks: the database, the web framework, the agent library, the models and where it all runs. These choices are hard to undo later, so this module lays them out with the alternatives we turned down and the reasons. The highlighted parts are the ones whose technology is chosen here.

The rest of this project is yours to keep

This project is bought on its own, once, and stays readable afterwards, including the parts added to it later.

Or open everything with a plan