/** * Memory Knowledge Graph — rules (two-stage distillation support): * kgIngestRules with per-rule verdicts, origin reinforcement, and * kgListRules. Split out of memory-kg.ts, which re-exports the public * symbols. */ import type { KgScope } from './memory-kg-model.js'; export interface RuleVerdict { rule: string; /** `failed` — the candidate was fine, but a write the caller was told about * did not land. It is neither `invalid` (which blames the caller's input) * nor `accepted`/`already_known` (which claim the graph now holds it). Both * of those used to be reported unconditionally, so a caller reading verdicts * saw every rule land while the aggregate `accepted` count said zero. */ verdict: 'accepted' | 'already_known' | 'invalid' | 'failed'; similarTo?: string; } /** Stage-2 of cognee's curator/writer distillation: the CALLER (an LLM agent) * proposes candidate rules; this accepts each unless a semantically * near-identical rule exists (embedding dedup — deterministic keys can't * collapse paraphrases). Accepted rules are stored both as KG nodes * (node_set=rules) and as plain `rules`-namespace entries so the existing * injection/search surfaces pick them up with zero new plumbing. * * A candidate that dedups against an existing rule still ADDS its origin to * that rule's support set: two independent runs asserting the same rule mean * the rule survives either one being rolled back. Dropping the second origin * (as this used to) made rollback of the FIRST run delete knowledge the * second run independently vouched for. * * Like `kgIngest`, NOT atomic — see that function's note. */ export declare function kgIngestRules(options: { rules: { rule: string; context?: string; }[]; originRef: string; /** Owner of these rules. Omit for project-shared knowledge. */ scope?: KgScope; dbPath?: string; /** Similarity above which a candidate is already_known (default 0.78 — * MiniLM paraphrases of the same rule commonly land 0.78-0.9; cognee's * equivalent control is prompt-injected LLM judgment, which we approximate). */ dedupThreshold?: number; }): Promise<{ success: boolean; verdicts: RuleVerdict[]; accepted: number; failures?: string[]; error?: string; /** Candidates dropped by the per-call cap, reported rather than sliced away * in silence. */ rulesTruncated?: number; }>; /** List stored rules (for injection or review). */ export declare function kgListRules(options?: { dbPath?: string; limit?: number; scope?: KgScope; }): Promise<{ rule: string; key: string; }[]>; //# sourceMappingURL=memory-kg-rules.d.ts.map