Skip to content

feat: add citation-aware RAG - #375

Draft
cpsievert wants to merge 3 commits into
mainfrom
feat/rag-citations
Draft

feat: add citation-aware RAG#375
cpsievert wants to merge 3 commits into
mainfrom
feat/rag-citations

Conversation

@cpsievert

Copy link
Copy Markdown
Collaborator

Why this matters

Chatlas can now ground answers in a user-provided retrieval store and return structured citations to the specific supporting document passages. This makes RAG answers inspectable in both standard and streamed chats, rather than relying on unverified model prose.

What’s included

  • Adds chat.rag.register_store() for attaching retrieval stores to a conversation.
  • Produces ContentCitation values with document identity and the cited source text.
  • Uses Anthropic’s native citable search-result blocks where available.
  • Provides a structured-output fallback for OpenAI and Google that streams normal prose and citations rather than raw JSON.
  • Displays citations in echoed output.
  • Adds a runnable scripts/rag_citations_demo.py verification example.

Verification

  • Focused RAG/content/provider suite: 116 passed, 2 xfailed.
  • Full local suite: 1030 passed, 3 skipped, 2 xfailed; 8 unrelated Bedrock VCR failures remain because the current default Sonnet 4.6 model does not match the committed Sonnet 4.5 cassettes.
  • Pyright and Ruff pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant