Davemaina1 makes citations actually trustworthy

A small plumbing change with an outsized effect on whether a lawyer can trust what the AI just told them.

searchchat-ui

When an AI assistant cites a source, the link is only as good as the connection between the answer on screen and the document it came from. In most legal-AI tools that link is reconstructed from the text itself - fragile, and easy to get subtly wrong. Davemaina1's fork takes a different route: every retrieved passage gets a stable identifier at the moment it's pulled from the knowledge base, and that identifier travels all the way through to the chat window untouched.

The practical effect is that citations can be deduplicated, linked back to a canonical source, and rendered consistently - without the UI having to guess. The team also hardened the pipeline against a quirk where the model occasionally returns a citation reference in a slightly different shape than expected, which is the kind of real-world wrinkle anyone shipping a RAG product eventually hits.

So what Anyone evaluating legal-AI tools where citation integrity matters - which is to say, all of them - should look at how the plumbing here is done.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

4 commits from Davemaina1/iroh_, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
6e12f686 Citations: open web-source URLs in new tab instead of DocPanel Davemaina1 2026-05-13 ↗ GitHub
68b457c1 Citations: stable chunk_ids end-to-end via citation_sources SSE event Davemaina1 2026-05-13 ↗ GitHub
b75b6611 fix(citations): tolerate string ref in LLM output, log SSE emission Davemaina1 2026-05-14 ↗ GitHub
2b142754 fix(backend): resolve TS error in chatTools citation log line Davemaina1 2026-05-14 ↗ GitHub
Cast citations[0] to Record<string, unknown> to satisfy tsc strict
property access check on the conditionally-typed array.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-381.md from inside the repo you want the changes in.

⬇ Download capture-thread-381.md