nwhitehouse tried live citations, then backed out

An experiment to make source citations appear as the AI writes its answer didn't survive contact with the model.

chat-ui

Citations are the markers that tie an AI answer back to the specific documents it drew from - the thing that lets a lawyer trust what they're reading. nwhitehouse tried a slicker version: have the model register each citation the moment it writes the matching reference in the text, so the little source pills pop up progressively as the answer streams, instead of arriving in a batch at the end.

It didn't hold. The model wasn't disciplined enough about doing this mid-stream, and the citation records came out inconsistent. nwhitehouse reverted to the original batch approach - and tightened up the rewritten version on the way back, so the rollback left the feature cleaner than before. The takeaway: progressive citations are a real UX win, but only if your underlying model reliably follows that kind of step-by-step instruction.

So what Anyone building legal AI where cited sources matter should weigh this before betting on live citations - it depends entirely on how disciplined your model is.

View this fork on GitHub →

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

Commits in this thread

2 commits from nwhitehouse/mike, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
6321e28a [feat-006] add_citation tool + hover popover + same-doc rescroll fix Nick Whitehouse 2026-05-04 ↗ GitHub
commit body
Replaces the freeform <CITATIONS> JSON block with an explicit add_citation
tool the model invokes per [N] marker. Tool calls are far more reliable
on Olava than freeform output formats, mirroring the SLM-friendly pattern
established by feat-005's multi-pass orchestrator. Legacy block parsing
remains as a fallback so any model regression still surfaces citations.

Frontend: replaces the browser-native title= tooltip with a styled hover
popover (filename + page + serif quote). Fixes a same-doc rescroll bug
where clicking citation #2 on an already-open doc tab kept the viewer
on citation #1 - upsertTab now drops the prior initialScrollTop when
the new mode has its own scroll target.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
8731d95e [feat-006] Park add_citation tool path; restore <CITATIONS> JSON prompt Nick Whitehouse 2026-05-04 ↗ GitHub
commit body
Empirically the add_citation tool route was unreliable on Olava - model
wrote [N] markers but skipped the tool call, so no citations rendered.
Reverting the system prompt to the original <CITATIONS> JSON block format
restores the proven path. The add_citation tool stays defined and
dispatched (events still emit if called), and collectTurnCitations still
prefers tool-emitted citations when present - so re-engaging this path
later is just a prompt change.

Defensive parser improvements kept: page schema simplified to a string
(was oneOf, which not all tool-call parsers handle cleanly), and
normalizeCitation now coerces string-of-digits markers to integers.
Both make the legacy <CITATIONS> parser more robust to model output
variation as well.

Co-Authored-By: Claude Opus 4.7 (1M context) <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-107.md from inside the repo you want the changes in.

⬇ Download capture-thread-107.md