Data-Integrity Layer for a LangChain QnA System
A LangChain question-answering system over an EU-focused fake-news dataset, with an integrity layer that guards the retrieval pipeline against tampering and data poisoning.
Paper in progress
The problem
Similarity search cannot tell you whether a document is still the document you ingested. A source can be semantically relevant to the question and silently altered after ingestion, and a RAG pipeline will happily retrieve it, ground an answer in it, and present that answer with full confidence. That is a source-integrity failure mode, not a retrieval one, so no amount of better embedding fixes it.
How it works
- Each source document's identifiers (content hash, filename, size) are recorded at upload time.
- Those fingerprints are anchored on Polygon, with the underlying content stored via IPFS/Pinata.
- At inference time, retrieved context is re-verified against its recorded fingerprint before it reaches the model.
- Context whose fingerprint no longer matches is rejected mid-pipeline, catching tampering or poisoning attempts instead of answering from them.
The research angle
The question the work explores is whether cheap, verifiable on-chain anchoring is enough to harden RAG pipelines against this class of attack without making inference unusably slow, and what the verification overhead actually costs at realistic corpus sizes. Joint work with two PhD collaborators; a paper is in progress.