What's Changed
🐛 Bug Fixes
- fix(rag): keep sources when the LLM omits the citation tag by @Ahmath-Gadji in #847
- fix(docker): make venv writes group-writable to survive APP_UID drift by @Ahmath-Gadji in #844
📝 API Changes: Enhanced Source Filtering Response
This release improves source citation tracking with new fields in the OpenAI-compatible /v1/chat/completions response.
Response Structure: Sources are located in the extra field (JSON string) of the completion choice:
{
"choices": [
{
"message": { "content": "..." },
"extra": "{\"presented_sources\": [...], \"cited_sources\": [...], ...}"
}
]
}New Fields (v2.1.1+)
presented_sources— every source shown to the LLM (after context budget truncation), regardless of citation. Always present.cited_sources— strictly what the model cited via the[Sources: ...]tag. Empty ([]) when no tag was found.citations_reported(boolean) —trueonly when the model actually emitted a citations tag;falsewhen the tag was missing.all_retrieved_sources(optional) — all sources retrieved before filtering, only included whenmetadata.include_all_retrieved_sources: trueis set in the request.
Backward Compatibility
The legacy sources field is retained for existing clients:
- Falls back to cited sources when a citation tag is present
- Falls back to all presented sources when no tag was found
Migration: New client code should adopt presented_sources + cited_sources + citations_reported for fine-grained tracking. Use cited_sources for LLM citations; fall back to presented_sources in the UI when citations are empty.
Upgrade Notes
- Persisted venv volumes: if upgrading from v2.1.0 with an existing Docker volume for
openrag_venvor Kubernetes PVC, recreate it once. The v2.1.1 fix for multi-UID venv syncing only applies to files written from here on. Either delete the volume/PVC and let it resync, or runchmod -R g+w openrag_venv/on the existing volume.
Full Changelog: v2.1.0...v2.1.1