/** * Memory Knowledge Graph — retrieval: kgSearch (seed nodes, neighbourhood * expansion, evidence-aware ranking) and kgGlossary for extraction prompts. * Split out of memory-kg.ts, which re-exports the public symbols. */ import type { KgExtractionMethod } from './memory-kg-claims.js'; import type { KgScope } from './memory-kg-model.js'; export interface KgSearchResult { success: boolean; /** Rendered triplet lines, best first. */ context: string; triplets: { source: string; relation: string; target: string; fact: string; score: number; /** How this edge came to exist. Absent means the edge predates method * recording — not recorded, which is not the same as `asserted`. */ method?: KgExtractionMethod; /** Live origins disagree about what this edge says. Present only when true. */ conflict?: boolean; /** The edge's bridge entry id — feed this straight to `memory_feedback` * (`bridgeApplyFeedback`/`bridgeRecordUsage`) to rate THIS relationship * directly, rather than only the seed entity that surfaced it (K5). */ id: string; /** The edge's stable graph key (`e:`, see `edgeKey`), for direct * `bridgeGetEntry` lookup or diagnostics — distinct from `id` above. */ key: string; }[]; seeds: { name: string; type: string; description: string; score: number; id: string; }[]; /** True when the edge scan did NOT cover the whole namespace — the scan hit * `SEARCH_EDGE_SCAN_MAX`, or the backend became unreadable partway. A * relationship that exists may be missing from `triplets`; absence here is * not evidence of absence in the graph. */ truncated?: boolean; /** Edge rows actually read, so a caller can see how close it ran to the cap. */ scannedEdges?: number; /** What the seed retrieval ACTUALLY ran, straight from the bridge — never what * was hoped for. `keyword-fallback` means the vector path was tried and did * not serve these results. Absent only when the bridge reported nothing. */ method?: 'semantic' | 'keyword' | 'keyword-fallback'; /** Why the vector path did not serve the seeds (absent when it did). */ fallbackReason?: string; error?: string; } /** Seeded retrieval → neighborhood → triplet ranking (cognee's brute-force * triplet search, scaled down). Seed scores already carry the Phase 1 feedback * blend, and the seed retrieval may be vector or keyword — `method` on the * result says which actually ran. * * Ranking weighs exactly two evidence signals, both read off the claim ledger: * extraction method and description conflict. It deliberately does NOT model * source credibility, claim freshness, or whether the relation itself answers * the query — those need an evaluation set to tune against, and guessing at * them would be the same overclaim this weighting exists to correct. */ export declare function kgSearch(options: { query: string; dbPath?: string; limit?: number; nodeSet?: string; /** Whose graph to search. Omit for project-shared knowledge; a scoped search * never reaches another org's facts, and never the shared graph either. */ scope?: KgScope; }): Promise; export declare function kgGlossary(options?: { dbPath?: string; limit?: number; /** Whose entity names to offer. The coordinator glossary MUST be scoped: * suggesting another org's entity names is how one org's claims get merged * into another's graph under a shared name. */ scope?: KgScope; }): Promise; //# sourceMappingURL=memory-kg-search.d.ts.map