Retrieval that answers with evidence, not confidence.
RAG rarely fails on embeddings. It fails because the model answers when it should refuse, or because someone sees a document they were never entitled to read.
Where RAG projects actually fail.
A pipeline that returns plausible passages is a weekend. A system people trust enough to make decisions from is the work. These are the five that sink it.
The model answers even with nothing to go on
Generation has to be constrained to retrieved passages and scored for groundedness before delivery. Below threshold the correct output is a refusal, and a system that cannot refuse cannot be trusted.
Permissions leak through the index
One shared index with no entitlement filter means the retrieval layer can surface anything to anyone. Entitlements have to be synced from the source systems and applied per request, so the index is shared and the visible slice is not.
Similarity retrieves the most similar chunk, not the right one
Dense search alone returns things that read alike. Fusing dense and lexical results, then reranking with a cross-encoder, is what moves the correct passage to the top — with recency and supersession pushing current documents over stale ones.
Chunking destroys the structure that made the document readable
Splitting on token counts cuts tables in half and strips headings. Parsing has to be layout-aware and chunks have to respect section boundaries, each carrying its heading path so the model knows what it is reading.
Nobody can tell whether a change made answers better or worse
Without a labelled evaluation set, tuning is superstition. Groundedness, retrieval hit rate, citation precision and permission leakage all have to be measured on every change.
How we build one.
The interesting engineering is on either side of the model: getting the right passages in front of it, and proving afterwards that the answer came from them.
- 01
Ingestion
Change detection, deduplication, OCR routing and rate-limited crawling across drives, wikis, ticketing and mail — carrying entitlement metadata from the source.
- Change detection
- Dedup
- OCR routing
- 02
Parsing
Layout-aware extraction that preserves tables, headings and reading order, so a chunk arrives with the structure that made it meaningful.
- Layout models
- Structure-aware chunking
- 03
Indexing
Chunk embedding with versioned models alongside a lexical index, plus an entity graph carrying relationships and supersession.
- Versioned embeddings
- Lexical index
- Knowledge graph
- 04
Retrieval
Entitlement filtering first, then hybrid fusion, cross-encoder reranking and graph expansion. Permissions are a filter, not an afterthought.
- Hybrid fusion
- Reranking
- Entitlement filter
- 05
Generation
Constrained generation over retrieved passages with citation binding, so every claim is attached to the span it came from.
- Constrained decoding
- Citation binding
- 06
Evaluation
A labelled set run on every change, scoring groundedness, retrieval hit rate, citation precision and permission leakage — with an explicit refusal path when confidence is too low.
- Groundedness eval
- Leak tests
- Refusal path
We have already built this.
CORTEX is our enterprise knowledge platform: hybrid retrieval, reranking, a knowledge graph, entitlement filtering and groundedness evaluation behind an answer engine that cites its sources and respects the permissions of whoever asked. A MaatX demonstration, not a client deployment — and every mechanism above is in it.

Questions we get asked.
Do we need a vector database?
Usually, but it is the least interesting decision on the list. Retrieval quality comes from hybrid search, reranking and chunking, not from which ANN index you picked. We will tell you if your existing database is already enough, which it often is.
How do you stop it hallucinating?
Constrain generation to retrieved passages, bind every claim to a cited span, score the answer for groundedness before it is delivered, and refuse below a threshold. Refusal is a feature — a system that always answers is a system nobody can rely on.
How are permissions handled?
Entitlements are synced from the source systems and applied as a retrieval filter on every request. The index is shared; the slice each person can see is not. Permission leakage is one of the things the evaluation set explicitly tests for.
Our documents are messy scans and spreadsheets. Does that work?
That is the normal case. OCR routing handles scans and layout-aware parsing keeps tables and headings intact rather than flattening them into prose. Extraction quality is usually where most of the early effort goes.
What it costs, and what you are agreeing to.
The commercial answers in one place, so none of them has to wait for a call.
Typical route in
AI Engineering
Typically $25,000–120,000
Scoped per system
Retrieval that stays grounded, agents that are replayable, and evaluation that runs before anything ships. The model is one component with a contract, not the product.
A starting point for the scope described, not an estimate for your project. Ongoing engineering runs at $75 per hour blended.
Who owns what you build?
You do. On full payment of the fees for an engagement, the intellectual property in everything built specifically for you is assigned to you.
Our pre-existing tools, libraries and internal infrastructure stay ours — but where a deliverable uses them, you get a perpetual, worldwide licence to run, modify and extend it. Nothing we hand over needs us to keep operating it. Open-source and third-party components keep their own licences, and we tell you which ones and what they require.
We also will not name you as a client, describe your project, or publish a case study about it without your written agreement.
What happens if it does not work out?
Either of us can end an engagement with 30 days written notice, or immediately if the other commits a material breach and does not remedy it within 15 days. You pay for work properly performed up to that point, and we hand over completed work along with every deliverable you have paid for.
Two limits worth stating before you ask. We are engineers, not advisers: nothing we deliver is legal, regulatory, tax or financial advice, and a system built to your specification is not an opinion that it is lawful in your jurisdiction. And where our work includes reviewing or auditing code, the findings cover the scope and time agreed — an absence of findings is not a guarantee that nothing is there.
What do you need from me to start?
Not a specification. Discovery exists precisely because most people do not have one — an idea, or a technical problem you cannot yet size, is enough to begin.
What the work does assume: timely access to the people, systems, credentials and environments it touches; decisions and approvals at roughly the pace the timeline assumes, since delays on your side move both dates and cost; and that you have the right to give us whatever you give us, including data, code and third-party material.
Why you rather than the alternative?
Against hiring a senior engineer in-house: sourcing one takes months and commits you permanently. Discovery runs 1–3 weeks, and you keep the architecture whichever way you then go — including if the answer is to make that hire.
Against the cheapest contractor available: you will pay less per hour. Our argument is that the architecture decision is the one that is expensive to reverse, which is why we sell it first, separately, and at a price you can say yes to before committing to a build.
Against a larger firm: there is no account layer. The people who scope the work are the people who build it.
And when not to hire us: if a no-code or off-the-shelf tool still fits what you are doing, stay on it. We are worth paying once you have hit a ceiling you cannot engineer around from where you are.
These are summaries. The binding version of the ownership, exit and liability terms is in our Terms of Service. A person reads every enquiry. We usually reply within a few hours.
Start a technical assessmentNeed answers from internal documents that cite their evidence and respect who is allowed to see what?
Send us the architecture or the problem. We will come back with the technical risks we can see and a sensible path forward, free, and tell you if we are not the right people for it.
