llm: grounded generation endpoint — /query with citations #571
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
RAG chain: retrieve → generate with the local instruct model, answers grounded in retrieved context only.
Scope
/query: question + filters → streamed answer with inline citations (bib item keys)Acceptance
Spec:
docs/superpowers/specs/2026-07-16-llm-module-design.mdStatus audit (2026-08-13, repo-verified): PARTIAL. POST /chat (api.py:74) functionally supersedes /query: streamed grounded generation with citations + abstention (rag.py:20-26,64-94). Missing vs body: metadata filters, context-window budgeting; citations are comment ids rather than bib item keys.
Grounded generation with citations is live at llm.fhirworx.io (2026-09-03). Retrieval now spans
comments+rules(rebuilt from fr_anchors paragraphs) + newcorpus(all non-comment bib items incl. Zotero-only storage PDFs), recency-blended (llm/rerank.py, optionalsince). Every source carries a deep link (llm/links.py): FR#p-N:~:text=…paragraph highlight, comment page / attachment PDF#page=N, corpus item URL. Spec: docs/superpowers/specs/2026-09-03-llm-corpus-recency-links-gpu-design.md.