ProjectBuild an AI-Powered Digital Bank with RAG: the explanation · Module 2: The solution: retrieval, tools and approval · part 4 of 20
Part 4 · Module 2: The solution: retrieval, tools and approval

Module 2: The solution: retrieval, tools and approval

21 min read·
About 35 minutes · Needs: Module 1 · Code: backend/app/agent/graph.py, backend/app/agent/tools.py, backend/app/services/assistant_service.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 that make up the answer (blue). This module walks one question through all of them; Postgres and the shared services stay grey.

Module 1 ended with five failures to prevent. This module shows the shape of the answer: the parts a question passes through, in order, and why each exists. Each later module opens one box and goes deep.

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