Retrieval (blue: this module) sits between the agent and Postgres: the agent asks, retrieval finds passages in the chunks table.
When the agent needs a bank rule, it calls search_bank_policies, which calls the retriever in this module. The retriever searches the 89 chunks in Postgres and returns the few passages the model may answer from. A wrong passage here means a wrong rule with a citation that looks correct.
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.