Skip to content
AI engineering

Retrieval that cites. Agents that leave a trail. A gate that fails the build.

Built over your own contracts, policies, claims files or case law, for legal, insurance, healthcare and financial services.

Book a 30-minute technical call

Scoped builds from $18,000. Retrieval already failing? The $5,500 diagnostic is the cheaper first move.

18,863,754
judgments in live retrieval
687,289
chunks under HNSW, in the subset selected for vector retrieval
≤2%
hallucination ceiling, enforced weekly in CI
~60%
model spend removed at a 70% cache hit rate

Both rails run zero to one hundred percent

Production figures from CourtNetra, which we built and run. Ask us for the CI report, or read the CourtNetra case study.

Where it goes wrong

Six ways retrieval fails, and none of them looks like failure.

A broken retrieval system throws no errors. It answers confidently from the wrong passages, and a customer finds out before a test does.

Which of these six you have is what a diagnostic names.
  1. 01 Ingest. Chunk to the unit a person would cite.

    Fails whena fixed window splits a clause from its definition.

  2. 02 Embed. Model, dimensions and quantization trade recall against cost; keep re-embedding cheap.

    No failure pinned here

  3. 03 Filter. Date, jurisdiction and access rights become predicates, so the query, not the prompt, enforces permissions.

    Fails whenit runs after retrieval, below.

  4. 04 Retrieve. Two indexes run over the same query in parallel, and their two result lists are reconciled at 05.

    • 04a Lexical BM25 finds the exact string.
    • 04b Dense Vectors find the paraphrase.

    Fails whendense runs alone: a policy number, a statutory section or a party name is exactly the token a professional searched for.

  5. 05 Fuse. The two legs rejoin here. Reciprocal rank fusion merges both lists by rank, so an exact-string hit and a semantic hit both reach the reranker.

    No failure pinned here

  6. 06 Rerank. A cross-encoder reads query and passage together, inside a latency budget.

    Fails whenthe model gets a recall list.

  7. The model is called here. Four of the six failures come before this line.

    07 Answer. Every claim cites its passage, or the system declines.

    Fails whendeclining was never built.

  8. 08 Gate. A golden set from your corpus, scored in CI at a threshold you set.

    Not a ninth step. The gate sits over 07 and decides whether that answer reaches a user at all.

    Fails whennobody measures.

SourceMethod, not measurement. The measured instance is CourtNetra, on its case study.

Stage 03, up close

Filter before retrieval, not after.

Where the filter runs decides how many candidates the reranker ever sees.

In scopeOut of scopeThe filterAn empty cell is a position a candidate has left.

Filter after retrieval5 of 50

The reranker chooses from whatever survived the filter.

Filter pushed down50 of 50

Every candidate is in scope, and the reranker picks the best.

SourceIllustrative: a filter that matches one document in ten. Arithmetic, not a measurement.

Agents and workflow automation

An agent is a workflow that can act. Everything hard about it is the acting.

Planning five steps is a weekend. Making them retryable, auditable, stoppable and affordable is the engagement.

Four records per step, not four per session.
Kept per step0102030405
Input
kept at every step
Retrieved context
kept at every step
Decision
kept at every step
Human override
kept only where a person intervened, here at step 03

A column is one step of one run. Three records are written every time; the fourth exists only where a person took the decision, and that is the row an auditor reads first.

SourceMethod, not measurement. The record set is what a MetaMinds agent build writes; no client run is published.

  • audit

    A step-level audit trail

    What it did on 14 March, and why, is a query.

  • retry

    Idempotent and replay-safe

    Every step is keyed, so a retry never sends the same email twice.

  • authority

    Human decision points

    An authority matrix: what the agent does alone, what it proposes, and who approves.

  • cost

    Cost-aware model routing

    A small model classifies, a larger one reasons, and a cache absorbs the repeats.

Already in production? The agent governance review works on the system you have.

Guardrail and evaluation platform

You cannot put accuracy in a contract until somebody has measured it.

An outcome-based SLA is unsignable without a baseline. This platform produces one, sold on its own for systems already in production.

What keeps the gate honest

A gate is a test with two sides, and you set where the line falls.

One CI run, scored against the evaluation set

Release shipsScored, recorded, and the build goes green.
Build failsThe pipeline goes red and the release stops.

The threshold you set. Lower it and more releases stop; raise it and fewer do. Either way the number is written down and a run either clears it or does not.

  • Groundedness scored per answer, so a regression is a number, not an impression.
  • A regression run pinned to the model version, so a provider's overnight update fails a test, not a customer.
  • The harness handed over, because a gate only we can run stops being run.

SourceMethod, not measurement. The measured instance is CourtNetra, which runs an automated hallucination evaluation weekly in CI and fails the build above 2%.

Scoped builds

Three builds, every floor published.

No cart here: a fixed price quoted before anyone has seen your corpus is a guess. The floors are published instead.

  • Retrieval and document intelligence

    • Corpus audit, chunking and embedding choice
    • Hybrid retrieval, filtered before it runs
    • Reranking, citations and a refusal path
    • An evaluation set and a baseline you keep
    $18,000floor, typically $28,000 to $70,000
  • AI agents and workflow automation

    • Step-level audit trail and replay
    • Idempotency keys and safe retries
    • An authority matrix and human decision points
    • Cost-aware model routing and caching
    $22,000floor, typically $35,000 to $90,000
  • Guardrail and evaluation platform

    • Golden dataset built from your own corpus
    • Groundedness rubric and scoring harness
    • A CI gate at a threshold you set
    • Prompt injection and indirect injection cases
    $24,000floor, typically $40,000 to $80,000

One scale, zero at the left. Tick is the floor, bar is the typical band

Prices exclude VAT. EU businesses with a valid VAT ID are invoiced under the reverse charge. EUR, GBP and SGD prices are on the services page.

T2-07 · RAG system diagnostic

Retrieval already exists, and it is wrong often enough to matter.

Then a rebuild is the wrong first purchase. We find the stage on the map above that causes the failure, with the evidence, and say which parts you can fix yourselves.

Price
$5,500
Duration
1 to 2 weeks
Deposit
$1,000
Delivered as
Report and walkthrough

Fixed price and scope. The deposit reserves a named start week; the balance is invoiced on delivery.

Stated plainly

Four things we will tell you before you spend anything.

  • retrieval

    Retrieval gets fixed before anyone reaches for a fine-tune

    A fine-tune on the wrong passages writes a more fluent wrong answer, so the passages come first.

  • corpus

    Week one is a corpus audit, before any index is built

    Scans with no text layer, conflicting policy versions, access rules living in one person's head: week one finds them, cheaply, while they are still cheap to fix.

  • arithmetic

    Sometimes the correct answer is a database query

    Claims closed last quarter is a report, exact every time. We would rather lose the build than sell a model that approximates arithmetic.

  • certification

    The audit body issues the certificate, separately from us

    An ISO/IEC 42001 certificate comes from an accredited certification body and a SOC 2 report from a licensed CPA firm, each after an audit you commission directly. MetaMinds does the gap assessment, readiness, control design and evidence preparation that goes in front of it.

Questions

Grounding gates, retrieval architecture, and what a build includes.

Seventeen answers, closed so they cost a line each. Five stand here and four more arrive each time you open one of the newest; all seventeen are in this page's source and structured data either way. Every one is the same string this page puts in that structured data, so a reader and an answer engine get identical text, and every measured figure in them has a row in the claims register.

What is a groundedness gate, and how does it fail a build?

A groundedness gate scores every answer in an evaluation set against the passages the system actually retrieved, then fails the continuous integration run when the score crosses a threshold. It is a test, not a dashboard: the pipeline goes red and the release stops. CourtNetra, the platform MetaMinds built and runs, executes an automated hallucination evaluation weekly in CI and fails the build above 2%. On a client system the threshold is yours, because the tolerable rate for an internal summary and for a cited legal authority are not the same number.

What does a scoped retrieval build include at the $18,000 floor?

Four deliverables, and they are the same four whether the engagement lands at the $18,000 floor or in the typical $28,000 to $70,000 band: a corpus audit of what is actually in the documents, a chunking and embedding choice with the reasoning recorded, hybrid retrieval with the filter pushed into the query, and reranking with citations and a refusal path. Every build also leaves an evaluation set and a baseline that stay with you, because without them nobody can tell later whether the system got worse.

Why hybrid retrieval rather than vector search on its own?

Because dense vectors match meaning and professionals search for exact strings. A policy number, a statutory section, a party name or a claim reference is the precise token somebody typed, and a paraphrase-matching index can miss it entirely. Hybrid retrieval runs a lexical index and a dense index together and reconciles the two result lists by reciprocal rank fusion, so an exact-string hit and a semantic hit both reach the reranker. CourtNetra runs exactly this: dense pgvector similarity and tsvector BM25, merged by reciprocal rank fusion.

What is filter pushdown, and why does it change the answer?

Pushing the filter down means date, jurisdiction and access rights become predicates inside the retrieval query rather than a step that runs after it. An approximate nearest neighbor index returns its candidate list before a later predicate is applied, so filtering afterwards discards most of that list and the reranker chooses from whatever survived. Filter first and every candidate returned is already in scope. It is also how permissions stop being a prompt instruction and become a query constraint, which is the only version an auditor accepts.

How large a document corpus can this run over?

MetaMinds runs production retrieval over 18,863,754 Indian judgments on CourtNetra: 39,158 Supreme Court and 18,824,596 High Court decisions across all 25 High Courts, 1950 to the present. The vector index holds 687,289 chunks under HNSW, in the subset selected for vector retrieval, on self-hosted PostgreSQL with pgvector. Corpus size is rarely the binding constraint. Access rules, conflicting versions of the same policy and scans with no text layer usually are, and week one of a build finds them.

What is a refusal path, and why does every build get one?

It is the branch where the system declines instead of answering. When retrieval returns nothing above the relevance floor, or the retrieved passages do not support the claim being made, the correct output is a refusal that names what was searched, not a fluent paragraph. Declining is the cheapest control in a retrieval system and the one most often left unbuilt, which is why a confidently wrong answer usually reaches a customer before it reaches a test.

Can MetaMinds work on a retrieval system somebody else built?

Yes, and the $5,500 RAG system diagnostic exists for that. It runs one to two weeks, a $1,000 deposit reserves a named start week, and it delivers a report and a walkthrough naming the pipeline stage that causes the failure, the evidence behind that finding, and the parts your own team can fix without us. A rebuild is frequently the wrong first purchase, and where the diagnostic finds the system is sound, that is the finding.

What makes an AI agent auditable?

Four records kept per step rather than per session: the input, the retrieved context, the decision, and any human override. With those, what the agent did on 14 March and why is a query rather than an investigation. Around them sit the parts that are harder than the planning: idempotency keys so a retry never sends the same email twice, an authority matrix stating what the agent does alone, what it proposes and who approves, and cost-aware routing so a small model classifies and a larger one only reasons.

How is an agent and workflow automation build priced?

It starts at $22,000 and typically lands between $35,000 and $90,000. The floor buys the step-level audit trail, replay-safe idempotent steps, the authority matrix and cost-aware model routing. What moves a project up the range is how many systems the agent has to write to and how much of the approval path already exists. Nothing here is a quote: a fixed number named before anyone has seen the corpus and the integrations is a guess, so the floors are published and the quote follows scoping.

Can the guardrail and evaluation platform be bought on its own?

Yes, from $24,000, typically $40,000 to $80,000, and that is its usual purchase: a system already in production that nobody can put a number on. It ships a golden dataset built from your own corpus rather than a public benchmark, a groundedness rubric and scoring harness, a CI gate at a threshold you set, and prompt injection and indirect prompt injection cases. The harness is handed over, because a gate only the vendor can run stops being run once the vendor leaves.

Why does an accuracy commitment need a baseline first?

Because a percentage in a contract is unenforceable until both sides agree how it is measured: on which questions, against which corpus, and on which pinned model version. The baseline is that agreement written down as a test that keeps running. Build it before the commitment and the number is defensible. Agree the number first and the measurement gets designed backwards to fit it, which turns an accuracy clause into a dispute rather than a control.

Will fine-tuning a model fix a retrieval problem?

Usually not. If the pipeline hands the model the wrong passages, a fine-tune teaches it to write a more fluent wrong answer over the same wrong evidence. Fine-tuning earns its place for output format, tone and narrow classification, and those are the cheaper problems. Retrieval quality is fixed in the retrieval layer, in this order: chunking, filtering, hybrid search, reranking. Only then is the model worth touching.

What is reciprocal rank fusion, and why not just add the two scores together?

Because a lexical score and a vector similarity are not on the same scale, and neither is stable from one query to the next, so adding them makes the answer depend on whichever index happened to produce larger numbers. Reciprocal rank fusion ignores the scores and uses position instead: a document both indexes rank highly rises, a document only one of them found can still surface, and nothing has to be normalized or retuned per query. CourtNetra merges dense pgvector similarity with tsvector BM25 this way, which is why an exact statutory citation and a paraphrase of the same point both reach the reranker.

How should a contract or a policy be chunked so a clause keeps its definition?

Chunk to the unit a person would cite, not to a fixed number of characters. A defined term and the clause that depends on it belong in the same retrieved passage, so the boundaries follow the document's own structure: the clause, the section, the schedule, the numbered paragraph. Where the definition lives elsewhere in the document, it travels with the chunk rather than being left for the model to guess at. This is the cheapest stage to get right and the most expensive to find late, because a fixed window that splits a clause from its definition produces answers that are fluent, cited and wrong.

How do you test a retrieval system for indirect prompt injection?

Indirect injection is instruction text hidden inside the documents the system retrieves rather than typed by a user: a line in an uploaded file or a fetched page telling the model to ignore its instructions, repeat its prompt, or approve something. Those cases go into the evaluation set beside the accuracy ones and are built from your own corpus, so a run reports both what the system got wrong and what it obeyed that it should have refused. The guardrail and evaluation platform ships those cases, and the harness that runs them is handed over with them.

What happens to a retrieval build when the corpus keeps changing?

The index is built to be rebuilt. New and amended documents are chunked and embedded on the same rules as the originals, and the embedding choice is recorded with its reasoning so re-embedding is a job rather than a project. The evaluation set then runs again, which is the point: a change in the corpus shows up as a change in the score rather than as a complaint from a user months later. Withdrawn documents have to leave the index and the response cache as well as the source system, because a system that cites a superseded policy version confidently is worse than one that finds nothing and says so.

How does a build here line up with ISO/IEC 42001 or SOC 2?

An ISO/IEC 42001 certificate is issued by an accredited certification body and a SOC 2 report by a licensed CPA firm, each after its own audit that you commission directly. What MetaMinds does is gap assessment, readiness, control design and evidence preparation, so the artefacts an auditor asks for exist before the audit starts: the control design, the evidence index, and the evaluation record showing the system behaves as described.

Not answered here? The CourtNetra case study is the long version of the retrieval answers, and a 30-minute technical call is with the engineer who would build it.

Start here

Tell us what breaks if the retrieval returns the wrong passage.

That one answer sets the accuracy target, the refusal policy and half the architecture. Thirty minutes with the engineer who would build it.

Scoped builds from $18,000 · RAG diagnostic $5,500 · Typical reply within one business day