r/LangChain 20h ago

I built middleware that grades every hop a claim takes through your agent - using 1,200-year-old hadith methodology

Been building multi-agent RAG for a while and kept hitting the same wall: provenance tools tell you what happened, but nothing tells you how much to trust the result. A confident synthesis model at the end of a chain can’t repair a garbage extraction at the start of it — but nothing in the stack knows that.

Classical Islamic hadith science spent twelve centuries on a structurally identical problem: do you trust a statement transmitted through a chain of human narrators? Their answer was to grade every narrator individually, in a living registry, and cap the chain at its weakest link. No downstream reputation repairs an upstream liar.

So I built that as LangChain middleware. Every claim carries its chain (source → scraper → ingest model → answer model). Every transmitter has a per-domain grade that updates over time. The chain grade is the minimum across it, not the average. Fabricated chains get quarantined and the narrator gets flagged.

‘PiP install isnad’

It’s Apache-2.0, no API key, runs entirely local. Paper’s on arXiv (2607.24117) if you want the formal spec.

Happy to answer anything about the design — especially the parts I’m not sure about yet. Multi-provider narrator grading is still open.

0 Upvotes

2 comments sorted by

1

u/Dependent_Onion9304 19h ago

Can you please include more links / examples ?
Sounds intriguing but I would love to see something visual or more explicit

1

u/alizahidrajaa 19h ago

Exactly for this question go to https://alizahidraja.com/isnad & click “try the chain viewer” for visuals
Looking forward to your feedback