Version: latest
agrag.evidence.citation.check_citations
check_citations(store:GraphStore, evidence_ids:Sequence[str], fetched_ids:Iterable[str], *, scope:frozenset[str], timeout:float | None = None) -> CitationResult
Return one verdict for each cited evidence id, in the order given.
A citation is valid when its document is in scope and it was fetched. A
span citation is also valid when its range lies inside a fetched span of the
same document and content hash. A wider range is not_fetched. A chunk
citation must equal a fetched id. A citation of a document outside the scope
is unavailable, even when the caller fetched it earlier. A string that
does not decode is malformed. When the document scope cannot be read,
every cited id is failed.
Pass only the ids whose fetch returned ok. An id from a truncated or
partial outcome names more text than the caller received.
Parameters:
- store (
GraphStore) – The graph store holding the documents in scope. - evidence_ids (
Sequence[str]) – Evidence ids the answer cites. - fetched_ids (
Iterable[str]) – Evidence ids the caller fetched. A malformed entry is ignored. - scope (
frozenset[str]) – Keys of the documents the caller may read. - timeout (
float | None) – Server-side transaction timeout in seconds. None uses the server's default.
Returns:
CitationResult– One check for each cited id, in the same order.