feat: structured source document references in graph-rag responses (#1035)

This commit is contained in:
Sunny Yang 2026-07-08 16:59:56 -06:00 committed by GitHub
parent 0374098ee9
commit e9c6a850ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 568 additions and 39 deletions

View file

@ -23,6 +23,13 @@ properties:
description: Provenance triples for this explain event (inline, no follow-up query needed)
items:
$ref: '../common/Triple.yaml'
sources:
type: array
description: |
Source documents the answer was derived from, deduplicated and sorted
by URI. Present on the final message (end_of_session true).
items:
$ref: './Source.yaml'
end_of_stream:
type: boolean
description: Indicates LLM response stream is complete

View file

@ -0,0 +1,15 @@
type: object
description: |
Source document reference. Produced by tracing the graph edges used for
retrieval back to the documents they were extracted from.
properties:
uri:
type: string
description: Source document URI
example: urn:document:5a90a175-9906-4dcb-b482-a8c1b6cbf9e0
title:
type: string
description: Document title (empty when the document has none)
example: Quantum Mechanics Primer
required:
- uri

View file

@ -118,6 +118,9 @@ post:
- Quantum information theory
- Computational complexity theory
end-of-stream: false
sources:
- uri: urn:document:5a90a175-9906-4dcb-b482-a8c1b6cbf9e0
title: Quantum Mechanics Primer
streamingChunk:
summary: Streaming response chunk
value: