Skip to content

AI Solutions · Deep dive

RAG knowledge base: answers grounded in sources, never invented

We build knowledge bases that answer only from verified sources: hybrid retrieval, document grounding, traceable citations, hallucination control and continuous answer-quality evaluation. When the source isn't enough, the system says so instead of inventing.

AI e Vokira — parole dentro, lavoro fuori

KNOWLEDGE BASE · GROUNDED RETRIEVAL

In · User question

Out · Cited, verifiable answer

01

Source-of-truth ingestion & chunking

Normalizes the source documents and splits them into coherent fragments sized by content type, attaching source metadata to each — title, section, date, permissions — which becomes the basis for citations and access control: without clean ingestion, everything downstream cites thin air.

02

Hybrid retrieval (keyword + semantic)

Combines a keyword search (BM25) that catches product codes, proper nouns and exact rare terms with a semantic vector search that catches paraphrases and concepts, fusing the two result sets by rank (RRF) to recover what neither would find on its own.

03

Reranking on a shortlist

A cross-encoder reranker reorders only the narrow shortlist of best candidates by scoring question and passage together rather than separately, adding a precision stage that stays accurate precisely because it works on a few fragments and not the whole index.

04

Grounded generation with citations

The model answers solely from the top of the shortlist and cites the source of every claim, so each sentence stays traceable to a document, a version and a section instead of sinking back into training memory.

05

Grounding & relevance check / abstain

Before delivery a grounding-and-relevance check compares the answer against the retrieved passages: below threshold the system abstains, re-retrieves, or hands off to a person, because an honest "it's not in the sources" is worth more than a plausible invention.

06

Answer-quality evaluation & freshness

Faithfulness, context relevance, answer relevance, citation accuracy and index freshness are measured continuously, because a single score hides where the problem lives and a reliable base has to be kept honest as documents and permissions change.

When you need this

The signs of a knowledge base that invents

An assistant that answers with confidence is worthless if the confidence isn't anchored to a source. These are the symptoms we see before we step in.

  • Confident but wrong. The system asserts, in an authoritative tone, things that appear in no internal document: that's missing grounding, not a typo.
  • No verifiable citations. The user can't trace a sentence back to its source, so they can neither trust nor correct it; every answer is a black box.
  • Stale content passed off as current. A policy updated last week isn't in the index yet, and the system keeps quoting the old version with the same confidence.
  • Perimeter leaks. A user receives fragments of documents they would have no right to see in the source system.
  • Out-of-scope questions with no brake. When the sources fall short, the model fills the gap by inventing instead of stating that it doesn't know.

For teams that manage critical documentation, support, compliance or internal knowledge and can't afford an invented answer in front of a customer or an auditor.

The principle

Retrieve first, generate second

A generative model left to itself predicts plausible text. A RAG knowledge base inverts the order: it retrieves the evidence from your sources first, then forces the model to answer only within that evidence.

Retrieval-Augmented Generation

Before answering, the system searches the documents for relevant passages and hands them to the model as context, with the instruction to answer only from there. The model stops drawing on training memory and draws on your source of record instead.

Grounding ≠ correctness

Grounding checks that the answer is faithful to the retrieved text, not that it is true in the absolute. If retrieval pulls the wrong fragment, a high grounding score only means the model faithfully repeated the wrong thing — which is why retrieval and evaluation must be treated as two separate problems.

Source-of-truth, not a copy

The index doesn't replace your source systems; it reflects them. When a document changes at the origin, the index has to change with it, or the knowledge base confidently lies about what is true today.

Abstaining is a feature, not a defect

A reliable knowledge base knows how to say "this isn't in the sources." An honest abstention beats an invented answer: the enterprise value is in not being wrong, not in always replying.

How it's built

From source to cited answer

Each layer narrows what the model is allowed to say. The pipeline isn't a single model: it's a chain of controls, each with a measurable job.

1
Ingestion and chunking

Documents are normalized and split into coherent fragments, sized by content type: a policy is segmented differently from a spec sheet. Each fragment carries source metadata — title, section, date, permissions — which becomes the basis for citations and access control.

2
Hybrid retrieval

A keyword search (BM25) catches product codes, proper nouns and exact rare terms; a semantic vector search catches paraphrases and concepts. The two result sets are fused by rank (RRF), recovering what neither would find alone.

3
Reranking the shortlist

A cross-encoder reranker orders the few best candidates by scoring question and passage together, not separately. It's a second precision stage operating on a shortlist, not the full index — which is why it's accurate without being slow.

4
Grounded generation with citations

The model answers only from the top of the shortlist and cites the source of every claim. Before delivery, a grounding-and-relevance check compares the answer against the passages: below threshold, the system abstains or re-retrieves instead of publishing.

From source to cited answer in milliseconds, with every claim traceable to a passage.

What we measure

The metrics that separate a reliable base from a plausible one

A knowledge base is judged on separate dimensions, because a single score hides where the problem lives. These are the levers we monitor continuously.

DimensionWhat it checksWhy it matters
FaithfulnessEvery claim in the answer is supported by the retrieved passagesThe direct brake on hallucination: no source, no claim
Context relevanceThe retrieved passages are actually pertinent to the questionMeasures retrieval: if it's poor, even a faithful answer is faithful to the wrong thing
Answer relevanceThe answer actually addresses the question asked, without driftingSeparates the pertinent from the generically correct but useless
Citation accuracyEach citation points to the passage that truly supports the sentenceMakes the answer verifiable: the user traces back to the source and checks
FreshnessThe index reflects the current state of the source documentsA stale index produces answers that are confident but wrong today
Operational guarantees

The controls we keep running in production

Building the pipeline is half the work. The other half is keeping it honest over time, as documents, permissions and questions change.

01

Access control inside retrieval

Permissions are a metadata filter at search time: a document a user can't see at the origin never appears in the results. The security perimeter travels with the data.

02

Incremental indexing

When a source changes, only what changed is reprocessed and the index is updated with stable identifiers. No full rebuilds, no windows where the base answers from old versions.

03

Abstention thresholds

Below the grounding or relevance threshold, the answer doesn't ship: the system declares it doesn't know, re-runs retrieval, or hands off to a person. The scope rule is explicit, not left to chance.

04

Provenance and source-of-truth

Every answer carries the origin of its claims — which document, which version, which section — in the spirit of open content-provenance standards like C2PA: the history of a claim is verifiable.

A reliable knowledge base isn't the one that always answers — it's the one that doesn't answer when it shouldn't.

Straight answers

What teams ask before we start

Does RAG eliminate hallucinations entirely?

No, and be wary of anyone who promises it does. It reduces them substantially by anchoring every answer to real sources, and grounding checks plus abstention thresholds stop unsupported answers before they leave. The goal is a verifiable answer, not an act of faith.

What happens when the answer isn't in the documents?

The system says so. We define the scope rule with you: explicit abstention, re-retrieval, or escalation to a person. An honest "it's not in the sources" beats a plausible invention.

How do answers stay current?

Through incremental indexing: when a document changes at the origin, the index updates only for the changed part, with no full rebuild. Freshness is a metric we monitor, not an occasional event.

Cases

From problem to result — anonymised.

Insurance · anonymised

Policies cited, not imagined

Problem The support assistant answered confidently about clauses and coverage limits while drawing on superseded policy versions, with no way for the agent to trace a sentence back to its source.

Method Source-of-truth ingestion with version and section metadata, hybrid retrieval over the contract terms, grounded generation that cites every clause, and an abstention threshold when the passage doesn't support the answer.

Result Every answer carries its document, version and section; when the information isn't in the sources the system says so instead of inventing, and the agent can verify before speaking to the customer.

Manufacturing · anonymised

Spec sheets with no perimeter leaks

Problem The internal knowledge base returned, to engineers in different departments, fragments of restricted documentation they would have had no right to see in the source system.

Method Access control as a metadata filter at retrieval time — the security perimeter travels with the data — plus content-type chunking that segments a spec sheet differently from a procedure.

Result A document a user can't see at the origin never appears in the results; answers stay cited and verifiable without exposing out-of-perimeter material.

Healthcare · anonymised

Procedures current to the right week

Problem Clinical procedures changed often, but an index rebuilt on a schedule left windows where the system quoted the old version with the same confidence as the current one.

Method Incremental indexing with stable identifiers that reprocesses only what changes at the origin, plus freshness treated as a continuously monitored metric alongside faithfulness and citation accuracy.

Result No full rebuilds and no drift windows: the index reflects the current state of the documents and answers stop being confident but wrong today.

Go deeper

Bring this to your stack.