A question comes in: "What is our notice period for contractors?"
Two searches run at once. One looks for meaning, so "contractors leaving" finds "notice period". One looks for exact words, so a product code or an invoice number is not blurred. The two ranked lists are merged, the best passages go to the model, and the answer comes back with a source next to every claim.
This post is the implementation. We built it inside Keel, our agentic AI platform, and it runs on a single Postgres database with the pgvector extension. No separate vector database, no third party embedding API.
The pipeline
Five steps from a document to a cited answer.
Parse: text from PDF, Word, HTML, markdown, plain text.…