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.
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
- Supabase Auth is the only identity and session authority. Repository documented: view the source for this claim
- The gateway sends only the current question, not prior chat history. Repository documented: view the source for this claim
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
- The gateway accepts eleven formats up to 10,000,000 bytes; Excel, GIF and BMP are not supported there. Repository documented: view the source for this claim
- Heavy ingestion runs through a queue with up to 3 retries and a dead-letter queue. Repository documented: view the source for this claim
- OCR is reported off in the deployed gateway. Repository documented: view the source for this claim
- The research path has OCR with a circuit breaker. Repository documented: view the source for this claim
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
- Supabase is authoritative; Qdrant vectors are reconstructible. Repository documented: view the source for this claim
- Semantic chunking is reported off in the deployed gateway. Repository documented: view the source for this claim
- The research path has semantic and hierarchical chunking. Repository documented: view the source for this claim
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
- Hybrid search is reported on in the deployed gateway. Repository documented: view the source for this claim
- Retrieval is limited to between 1 and 12 chunks. Repository documented: view the source for this claim
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
- The gateway blends rank contributions: α·dense + (1−α)·(lexical + 0.02·coverage). Repository documented: view the source for this claim
- Reranking is reported off in the deployed gateway. Repository documented: view the source for this claim
- The research path has BM25 + vector retrieval with RRF and cross-encoder reranking. Repository documented: view the source for this claim
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
- Streaming is reported off in the deployed gateway. Repository documented: view the source for this claim
- A user's own Gemini key is stored encrypted and never returned to the browser. Repository documented: view the source for this claim
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
- Answers are published only if every [S#] citation refers to a retrieved source; otherwise the system abstains. Repository documented: view the source for this claim
- The evaluation harness measures citation precision and answer support. Repository documented: view the source for this claim
- This site's Ask the Atlas applies the same rule to its own evidence ledger. Repository documented: view the source for this claim
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
- Unsupported filters, retention and erasure fail closed; no success receipt is fabricated. Repository documented: view the source for this claim
- The evaluation harness measures cross-workspace leakage. Repository documented: view the source for this claim
- Cloudflare is the public security and routing boundary. Repository documented: view the source for this claim