Engineering Blog

RAGO-X

Understanding RAGO-X: from documents to grounded answers

A design guide separating ingestion from question answering, with checks for versions, access scope, retrieval, and citations.

RAGO-XPublished Updated
#RAG#Architecture#LLM
Concept diagram of the RAGO-X document-to-answer architecture

A useful way to understand RAG is to separate two flows. Ingestion prepares documents for retrieval. Question answering finds permitted evidence for each question and uses it to generate a response. Original-file storage, search indexes, and answer generation have different responsibilities.

This design guide explains the document-based answers and source inspection described in the RAGO-X product overview. Its flow and code are a reference design, not a specification asserting that a particular database, model, or reranker is deployed. Check the documentation hub and supported document formats for product scope.

Separate ingestion from answering

text
Ingestion:
Document -> Extract text + source positions -> Chunks -> Search index

Question answering:
Question + permitted scope -> Retrieve evidence -> Select context
-> Generate answer -> Validate citations -> Show answer + sources

A successful upload is not the same as search readiness. Extraction or indexing can still fail. Distinguish these states for users and make retries avoid duplicate chunks for the same document.

Inspect each stage independently

Stage Required result Diagnostic question
Storage and extraction Revision, text, positions Are tables and paragraphs in source order?
Splitting and indexing Chunk IDs linked to originals Was the answer passage lost or split?
Access scope Server-authorized document set Do other groups' documents enter candidates?
Retrieval and context Selected evidence and versions Did the model actually receive the answer passage?
Generation and citations Answer linked to evidence Does the cited passage support the claim?

Embedding-based designs need compatible representations for documents and questions. When changing embedding models or preprocessing, plan reindexing and migration instead of mixing vectors indiscriminately. See chunking validation and the RRF walkthrough for those stages.

Run a citation-ID check

If a model cites S9 but was given only S1, do not fabricate a source link. This function resolves only IDs from the supplied evidence. Save it as citation_demo.py and run python3 citation_demo.py.

python
def resolve_sources(citation_ids, evidence):
    by_id = {source["id"]: source for source in evidence}
    unknown = set(citation_ids) - by_id.keys()
    if unknown:
        raise ValueError("citation not present in supplied evidence")
    return [by_id[key] for key in dict.fromkeys(citation_ids)]


evidence = [{
    "id": "S1", "document_id": "manual-17", "revision": "v2",
    "page": 3, "text": "Disconnect power before opening the cover."
}]
print([s["id"] for s in resolve_sources(["S1", "S1"], evidence)])
assert len(resolve_sources(["S1", "S1"], evidence)) == 1
try:
    resolve_sources(["S9"], evidence)
except ValueError:
    print("Unknown source rejected")
else:
    raise AssertionError("unknown source was accepted")

Output is ['S1'] followed by Unknown source rejected. Duplicate references resolve once and unknown IDs are rejected. This checks source existence, not whether a claim follows from its source. Claim support requires a separate review. Evidence must already have passed access checks; this function is not authentication or authorization.

Handle replacement and missing evidence

When a manual is replaced, chunks, indexes, and source links should refer to the same revision. Otherwise an answer can use old instructions while linking to the new file. After deletion or permission changes, check both retrieval and access to the original.

For questions without evidence, explain what is missing rather than inventing an answer. Instructions embedded in retrieved documents are source data, not system instructions. A high retrieval score alone does not establish answerability.

A practical release check

  1. Choose answerable and unanswerable questions from a small manual.
  2. Track the answer passage through extraction, chunks, candidates, and final context.
  3. Repeat with a user who lacks access and inspect for evidence leakage.
  4. Update the document and check that old revisions are not retrieved or linked.
  5. Compare each important claim with its citation. Measure retrieval success separately from grounded answer quality.

RAG connects retrieved evidence to generation; it does not automatically guarantee correctness. For research background, see Lewis et al.'s RAG paper. For product usage, continue with RAGO-X API workflows and user access management.