ProjectBuild an AI-Powered Digital Bank with RAG: the explanation · Module 10: The agent, a graph with tools and approval · part 12 of 20
Part 12 · Module 10: The agent, a graph with tools and approval

Module 10: The agent, a graph with tools and approval

22 min read·
About 45 minutes · Needs: Module 7 (the ledger) and Module 9 (retrieval) · 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 agent (blue: this module) sits between the router and everything it calls: the models, the ledger and retrieval, with its state in Postgres.

The agent decides what to do with each message. It uses the router's choice of model, calls the language models, reads Priya's accounts through the banking service, searches the documents through retrieval, and keeps every conversation in PostgreSQL.

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