Skip to content

Commit 246ea44

Browse files
committed
feat(citation): add grounding field to QueryResult + verifyCitations config + exports
1 parent 3f745a0 commit 246ea44

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

src/query-router/types.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,12 @@ export interface QueryResult {
296296
*/
297297
fallbacksUsed: string[];
298298

299+
/**
300+
* Citation verification results. Populated when deep research runs
301+
* or when `verifyCitations` is explicitly requested in config or query options.
302+
*/
303+
grounding?: import('../rag/citation/types.js').VerifiedResponse;
304+
299305
/**
300306
* Recommended skills, tools, and extensions based on query analysis.
301307
*
@@ -517,6 +523,13 @@ export interface QueryRouterConfig {
517523
topN: number,
518524
) => Promise<RetrievedChunk[]>;
519525

526+
/**
527+
* Enable automatic citation verification on deep research responses.
528+
* When true, moderate-depth queries also verify citations.
529+
* Default: false (only deep research verifies automatically).
530+
*/
531+
verifyCitations?: boolean;
532+
520533
/**
521534
* Optional host-provided deep research callback.
522535
*

src/rag/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,3 +306,7 @@ export type {
306306
VectorStoreConfig,
307307
} from './setup/types.js';
308308

309+
// Citation verification
310+
export { CitationVerifier, cosineSimilarity } from './citation/index.js';
311+
export type { CitationVerifierConfig, ClaimVerdict, VerifiedResponse, VerificationSource } from './citation/index.js';
312+

0 commit comments

Comments
 (0)