Lab / systems

Architecture X-Ray

Eight layers of a retrieval-augmented generation system. For each: what it is responsible for, what goes in and out, how it fails, and what NexusRAG's repository shows about it.

The responsibilities, failure modes and tradeoffs are general engineering guidance. Only the NexusRAG lines are claims, and each links to its source.

  1. Layer 01

    User and request

    Turn a person's question into a request that is authenticated and scoped to one workspace.

    In NexusRAG's deployed gateway

    Input
    A question, a signed-in session and a workspace.
    Output
    A scoped request the rest of the pipeline can trust.

    Failure modes

    • Request reaches another tenant's data.
    • Instructions hidden in the question try to change system behaviour.
    • The question is too vague to retrieve anything useful.

    Tradeoffs

    • Sending chat history helps follow-up questions but widens what reaches the model and what can leak.

    NexusRAG evidence

  2. Layer 02

    Ingestion

    Accept files, extract their text and hand heavy work to a queue.

    Partly in the gateway; more in the research path

    Input
    Uploaded files.
    Output
    Extracted text with document metadata.

    Failure modes

    • Unsupported or oversized files.
    • Scanned PDFs with no text layer produce empty documents.
    • A crash mid-extraction leaves a half-indexed document.

    Tradeoffs

    • OCR recovers scanned pages but adds latency, cost and recognition errors.
    • Retries recover from transient failures but must not duplicate work.

    NexusRAG evidence

  3. Layer 03

    Indexing

    Split text into chunks, embed them and store vectors next to the authoritative records.

    Partly in the gateway; more in the research path

    Input
    Extracted text.
    Output
    Chunks, vectors and source records.

    Failure modes

    • A chunk boundary splits the fact a question needs.
    • The vector index drifts out of sync with the source records.
    • Changing the embedding model silently invalidates old vectors.

    Tradeoffs

    • Semantic chunking keeps ideas together but costs more compute than fixed-size chunks.
    • A reconstructible index is simpler to trust than one that holds the only copy.

    NexusRAG evidence

  4. Layer 04

    Retrieval

    Find candidate passages for the question.

    In NexusRAG's deployed gateway

    Input
    The question and the index.
    Output
    Candidate lists from dense (vector) and lexical search.

    Failure modes

    • Lexical search misses synonyms.
    • Dense search returns passages that are similar but wrong.
    • Too few candidates drop the answer; too many add noise.

    Tradeoffs

    • Retrieving more chunks raises recall but costs tokens and can dilute the answer.

    NexusRAG evidence

    Search your own files with BM25 and fusion

  5. Layer 05

    Ranking

    Merge the candidate lists into one order.

    Partly in the gateway; more in the research path

    Input
    Two or more ranked candidate lists.
    Output
    One ordered list of passages.

    Failure modes

    • Raw scores from different systems are not comparable.
    • Ties are broken by accident of input order.
    • One list dominates the result.

    Tradeoffs

    • Rank-based fusion is robust to score scales but ignores how confident each system was.
    • A cross-encoder reranker is usually more precise but slower and costlier.

    NexusRAG evidence

    Compare RRF with the gateway blend

  6. Layer 06

    Generation

    Write an answer using only the retrieved passages, marking which passage supports each statement.

    In NexusRAG's deployed gateway

    Input
    The question and the ranked passages.
    Output
    A draft answer with source markers.

    Failure modes

    • Statements the passages do not support.
    • The model ignores the passages and answers from memory.
    • The model provider is slow or unavailable.

    Tradeoffs

    • Streaming shows text sooner, but text shown before validation may later be withdrawn.

    NexusRAG evidence

  7. Layer 07

    Validation and citations

    Check that every citation points to a passage that was actually retrieved; abstain otherwise.

    Also used on this site

    Input
    The draft answer and the list of retrieved source ids.
    Output
    A published answer, or an abstention.

    Failure modes

    • Citations to sources that were never retrieved.
    • A real citation attached to a statement it does not support — a reference check cannot catch this.

    Tradeoffs

    • A strict gate abstains more often; a loose one publishes unsupported answers.

    NexusRAG evidence

    Ask the Atlas

  8. Layer 08

    Safeguards

    Refuse what cannot be enforced, keep tenants apart and keep secrets out of the browser.

    In NexusRAG's deployed gateway

    Input
    Every request and data operation.
    Output
    A refusal, or an action with a truthful record.

    Failure modes

    • A filter that is not enforced reports success anyway.
    • Data leaks across workspaces.
    • Keys reach the client.

    Tradeoffs

    • Failing closed blocks some legitimate requests in exchange for never claiming what did not happen.

    NexusRAG evidence