import type { KnowledgeRepository } from '../repository/index.js'; import type { Association, AssociationType } from '../association/index.js'; import type { KnowledgeEntry, KnowledgeType } from '../types/index.js'; export interface KnowledgeGraphNode { id: string; title: string; type: KnowledgeType; domain?: string; status: KnowledgeEntry['status']; summary: string; sourceRef: string; createdAt: Date; updatedAt: Date; metadata?: KnowledgeEntry['metadata']; } export interface KnowledgeGraphEdge { id: string; sourceId: string; targetId: string; type: AssociationType | 'co_occurs' | 'semantic_neighbor'; strength: number; signal: 'explicit' | 'source_cooccurrence' | 'semantic_proximity'; metadata?: Record; } export interface KnowledgeGraphSnapshot { nodes: KnowledgeGraphNode[]; edges: KnowledgeGraphEdge[]; updatedAt: Date; } export interface GraphFilter { domains?: string[]; types?: KnowledgeType[]; from?: Date; to?: Date; } export interface GraphBuildOptions { semanticThreshold?: number; /** Pre-loaded embeddings map: entryId → Float32Array vector */ embeddings?: Map; } export declare class KnowledgeGraphBuilder { private readonly repository; private readonly now; private cachedSnapshot; constructor(repository: KnowledgeRepository, now?: () => Date); build(associations: Association[], options?: GraphBuildOptions): Promise; /** * FR-G01-AC3: Incremental update — merge new/changed entries and associations * into an existing snapshot without full rebuild. */ incrementalUpdate(base: KnowledgeGraphSnapshot, changedEntries: KnowledgeEntry[], associations: Association[], options?: GraphBuildOptions): Promise; /** * FR-G01-AC4: API exposure — return the latest snapshot for external consumption. */ getSnapshot(): KnowledgeGraphSnapshot | null; filter(snapshot: KnowledgeGraphSnapshot, filter?: GraphFilter): Promise; } export declare function buildSnapshot(entries: KnowledgeEntry[], associations: Association[], timestamp: Date, options?: GraphBuildOptions): KnowledgeGraphSnapshot; export declare function filterSnapshot(snapshot: KnowledgeGraphSnapshot, filter: GraphFilter, timestamp: Date): KnowledgeGraphSnapshot; //# sourceMappingURL=knowledge-graph.d.ts.map