# Autopsy: see why a RAG system answered what it did

By Lucas Espindola · https://lucasespindola.com/autopsy · in the site's terminal: `app autopsy`

Autopsy follows every passage of a document set, this site’s notes or your own files, through a RAG pipeline on one chart: chunking, BM25 keyword search, embedding search (MiniLM, BGE or GTE), their weighted hybrid, a cross-encoder reranker, a word-budgeted context window and the answer. Poison a passage with a swapped number, a planted instruction or a keyword decoy, and see whether retrieval or the model passes it on, with or without a guard prompt.

## How it works

1. Ask a question over this site’s notes or your own files (.txt, .md, .html, .pdf or pasted text).
2. The chart draws each passage’s rank by keywords, by meaning, in the hybrid of both and after reranking, then its slot in the context and its citation in the answer. A line that drops out shows the stage where that passage fell.
3. Poison a passage and ask again: the clean and poisoned answers appear side by side, with a verdict on where the poison was stopped or got through.

## Privacy and limits

- Chunking, keyword search, embeddings and reranking run in your browser; your documents stay on the page.
- Answers come from Llama 3.3 70B on Workers AI, which sees only the question and the passages that reach the model, or from Qwen2.5 0.5B in your browser with WebGPU.
- Numbers in the answer that no passage contains are flagged, and sentences far in meaning from every passage are marked. Both are hints, not proof.
