@totalreclaw/mcp-server 3.3.0-rc.2 → 3.3.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SKILL.md +1 -1
- package/dist/extraction/config.d.ts +35 -0
- package/dist/extraction/config.d.ts.map +1 -0
- package/dist/extraction/config.js +60 -0
- package/dist/extraction/config.js.map +1 -0
- package/dist/extraction/extractor.d.ts +305 -0
- package/dist/extraction/extractor.d.ts.map +1 -0
- package/dist/extraction/extractor.js +1257 -0
- package/dist/extraction/extractor.js.map +1 -0
- package/dist/extraction/llm-client.d.ts +236 -0
- package/dist/extraction/llm-client.d.ts.map +1 -0
- package/dist/extraction/llm-client.js +704 -0
- package/dist/extraction/llm-client.js.map +1 -0
- package/dist/extraction/llm-profile-reader.d.ts +145 -0
- package/dist/extraction/llm-profile-reader.d.ts.map +1 -0
- package/dist/extraction/llm-profile-reader.js +362 -0
- package/dist/extraction/llm-profile-reader.js.map +1 -0
- package/dist/index.js +113 -22
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: totalreclaw
|
|
3
3
|
description: "End-to-end encrypted, decentralized memory for OpenClaw via the totalreclaw MCP server. Set up an account once, then call totalreclaw__totalreclaw_remember and totalreclaw__totalreclaw_recall instead of writing to MEMORY.md / USER.md / local files. Trigger on 'install TotalReclaw', 'set up TotalReclaw', 'restore my recovery phrase', or any user statement that contains a preference / fact / decision / commitment about themselves."
|
|
4
|
-
version: 3.3.0-rc.
|
|
4
|
+
version: 3.3.0-rc.3
|
|
5
5
|
author: TotalReclaw Team
|
|
6
6
|
license: MIT
|
|
7
7
|
homepage: https://totalreclaw.xyz
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* extraction/config.ts — env-var reads for the extraction LLM client.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the relevant subset of `skill/plugin/config.ts` (the plugin's
|
|
5
|
+
* CONFIG object) so the ported `llm-client.ts` doesn't need to be edited
|
|
6
|
+
* substantively. Scoped to ONLY the env reads the extraction pipeline
|
|
7
|
+
* actually needs: provider API keys, zai base URL, retry budget.
|
|
8
|
+
*
|
|
9
|
+
* This file is a centralized env-read surface so future contributors can
|
|
10
|
+
* find every TOTALRECLAW_/PROVIDER_API_KEY env touchpoint in one place
|
|
11
|
+
* (matches the rationale of the plugin's config.ts).
|
|
12
|
+
*
|
|
13
|
+
* MCP-server-specific note: the plugin's config.ts has a scanner-isolation
|
|
14
|
+
* rule that forbids mixing process.env reads with outbound-network triggers
|
|
15
|
+
* in the same file. The MCP server is NOT scanner-gated (it's a regular
|
|
16
|
+
* npm package run by node, not an OpenClaw plugin), so the rule doesn't
|
|
17
|
+
* apply — but we keep the same structural separation anyway because it
|
|
18
|
+
* makes the env surface auditable.
|
|
19
|
+
*/
|
|
20
|
+
export declare const EXTRACTION_CONFIG: {
|
|
21
|
+
llmApiKeys: Record<string, string>;
|
|
22
|
+
/**
|
|
23
|
+
* zai base-URL override. Read via a getter so tests can mutate the env
|
|
24
|
+
* between calls. Default is the coding endpoint (GLM Coding Plan); the
|
|
25
|
+
* `chatCompletion` auto-fallback flips to the standard PAYG endpoint on
|
|
26
|
+
* an "Insufficient balance" 429.
|
|
27
|
+
*/
|
|
28
|
+
readonly zaiBaseUrl: string;
|
|
29
|
+
/**
|
|
30
|
+
* Retry budget for chatCompletion. Default 60s covers multi-minute
|
|
31
|
+
* upstream outages. Read once at module load.
|
|
32
|
+
*/
|
|
33
|
+
llmRetryBudgetMs: number;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/extraction/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,iBAAiB;gBAcvB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAE3B;;;;;OAKG;yBACe,MAAM;IAMxB;;;OAGG;;CAMJ,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* extraction/config.ts — env-var reads for the extraction LLM client.
|
|
4
|
+
*
|
|
5
|
+
* Mirrors the relevant subset of `skill/plugin/config.ts` (the plugin's
|
|
6
|
+
* CONFIG object) so the ported `llm-client.ts` doesn't need to be edited
|
|
7
|
+
* substantively. Scoped to ONLY the env reads the extraction pipeline
|
|
8
|
+
* actually needs: provider API keys, zai base URL, retry budget.
|
|
9
|
+
*
|
|
10
|
+
* This file is a centralized env-read surface so future contributors can
|
|
11
|
+
* find every TOTALRECLAW_/PROVIDER_API_KEY env touchpoint in one place
|
|
12
|
+
* (matches the rationale of the plugin's config.ts).
|
|
13
|
+
*
|
|
14
|
+
* MCP-server-specific note: the plugin's config.ts has a scanner-isolation
|
|
15
|
+
* rule that forbids mixing process.env reads with outbound-network triggers
|
|
16
|
+
* in the same file. The MCP server is NOT scanner-gated (it's a regular
|
|
17
|
+
* npm package run by node, not an OpenClaw plugin), so the rule doesn't
|
|
18
|
+
* apply — but we keep the same structural separation anyway because it
|
|
19
|
+
* makes the env surface auditable.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.EXTRACTION_CONFIG = void 0;
|
|
23
|
+
exports.EXTRACTION_CONFIG = {
|
|
24
|
+
llmApiKeys: {
|
|
25
|
+
zai: process.env.ZAI_API_KEY || '',
|
|
26
|
+
anthropic: process.env.ANTHROPIC_API_KEY || '',
|
|
27
|
+
openai: process.env.OPENAI_API_KEY || '',
|
|
28
|
+
gemini: process.env.GEMINI_API_KEY || '',
|
|
29
|
+
google: process.env.GOOGLE_API_KEY || '',
|
|
30
|
+
mistral: process.env.MISTRAL_API_KEY || '',
|
|
31
|
+
groq: process.env.GROQ_API_KEY || '',
|
|
32
|
+
deepseek: process.env.DEEPSEEK_API_KEY || '',
|
|
33
|
+
openrouter: process.env.OPENROUTER_API_KEY || '',
|
|
34
|
+
xai: process.env.XAI_API_KEY || '',
|
|
35
|
+
together: process.env.TOGETHER_API_KEY || '',
|
|
36
|
+
cerebras: process.env.CEREBRAS_API_KEY || '',
|
|
37
|
+
},
|
|
38
|
+
/**
|
|
39
|
+
* zai base-URL override. Read via a getter so tests can mutate the env
|
|
40
|
+
* between calls. Default is the coding endpoint (GLM Coding Plan); the
|
|
41
|
+
* `chatCompletion` auto-fallback flips to the standard PAYG endpoint on
|
|
42
|
+
* an "Insufficient balance" 429.
|
|
43
|
+
*/
|
|
44
|
+
get zaiBaseUrl() {
|
|
45
|
+
const override = process.env.ZAI_BASE_URL;
|
|
46
|
+
if (override && override.trim())
|
|
47
|
+
return override.trim().replace(/\/+$/, '');
|
|
48
|
+
return 'https://api.z.ai/api/coding/paas/v4';
|
|
49
|
+
},
|
|
50
|
+
/**
|
|
51
|
+
* Retry budget for chatCompletion. Default 60s covers multi-minute
|
|
52
|
+
* upstream outages. Read once at module load.
|
|
53
|
+
*/
|
|
54
|
+
llmRetryBudgetMs: (() => {
|
|
55
|
+
const raw = process.env.TOTALRECLAW_LLM_RETRY_BUDGET_MS;
|
|
56
|
+
const parsed = raw ? parseInt(raw, 10) : NaN;
|
|
57
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : 60_000;
|
|
58
|
+
})(),
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/extraction/config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAEU,QAAA,iBAAiB,GAAG;IAC/B,UAAU,EAAE;QACV,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE;QAClC,SAAS,EAAE,OAAO,CAAC,GAAG,CA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,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;IACjE,CAAC,CAAC,EAAE;CACL,CAAC"}
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TotalReclaw MCP-server - Fact Extractor
|
|
3
|
+
*
|
|
4
|
+
* Ported verbatim from `skill/plugin/extractor.ts` (mcp-server 3.3.0-rc.3,
|
|
5
|
+
* MCP-first autonomous extraction pivot). The plugin file is the canonical
|
|
6
|
+
* source — keep them in sync.
|
|
7
|
+
*
|
|
8
|
+
* Uses LLM calls to extract atomic facts from conversation messages.
|
|
9
|
+
* Matches the extraction prompts described in SKILL.md.
|
|
10
|
+
*
|
|
11
|
+
* Phrase-safety hard rail: this module operates ONLY on the conversation
|
|
12
|
+
* messages handed in by the trajectory poller (user prompts + assistant
|
|
13
|
+
* replies parsed from OpenClaw trajectory JSONL). The recovery phrase
|
|
14
|
+
* NEVER reaches this module — it is used solely by the on-chain submit
|
|
15
|
+
* path (subgraph/store.ts) for HD wallet derivation, in a different
|
|
16
|
+
* call stack. The extraction LLM prompt template is a pure constant;
|
|
17
|
+
* user-supplied content goes through `messageToText` which only reads
|
|
18
|
+
* `role` and `content` fields.
|
|
19
|
+
*/
|
|
20
|
+
export type ExtractionAction = 'ADD' | 'UPDATE' | 'DELETE' | 'NOOP';
|
|
21
|
+
export type EntityType = 'person' | 'project' | 'tool' | 'company' | 'concept' | 'place';
|
|
22
|
+
export interface ExtractedEntity {
|
|
23
|
+
name: string;
|
|
24
|
+
type: EntityType;
|
|
25
|
+
role?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare const VALID_MEMORY_TYPES: readonly ["claim", "preference", "directive", "commitment", "episode", "summary"];
|
|
28
|
+
/** v1 MemoryType — the 6 canonical types. */
|
|
29
|
+
export type MemoryType = (typeof VALID_MEMORY_TYPES)[number];
|
|
30
|
+
/**
|
|
31
|
+
* Runtime type guard — returns whether an unknown value is a valid v1
|
|
32
|
+
* `MemoryType`. Legacy v0 tokens return `false`; use `normalizeToV1Type()`
|
|
33
|
+
* in `claims-helper.ts` to coerce them on the read path.
|
|
34
|
+
*/
|
|
35
|
+
export declare function isValidMemoryType(value: unknown): value is MemoryType;
|
|
36
|
+
/**
|
|
37
|
+
* Backward-compat alias so existing consumers that import `MemoryTypeV1`
|
|
38
|
+
* keep compiling. Identical to `MemoryType` as of plugin v3.0.0.
|
|
39
|
+
* @deprecated Use `MemoryType` instead.
|
|
40
|
+
*/
|
|
41
|
+
export type MemoryTypeV1 = MemoryType;
|
|
42
|
+
/**
|
|
43
|
+
* Backward-compat alias. Same list as `VALID_MEMORY_TYPES`.
|
|
44
|
+
* @deprecated Use `VALID_MEMORY_TYPES` instead.
|
|
45
|
+
*/
|
|
46
|
+
export declare const VALID_MEMORY_TYPES_V1: readonly MemoryType[];
|
|
47
|
+
/**
|
|
48
|
+
* Backward-compat alias. Same guard as `isValidMemoryType`.
|
|
49
|
+
* @deprecated Use `isValidMemoryType` instead.
|
|
50
|
+
*/
|
|
51
|
+
export declare function isValidMemoryTypeV1(value: unknown): value is MemoryType;
|
|
52
|
+
/**
|
|
53
|
+
* Legacy v0 memory types — retained as a typed constant so the read-side
|
|
54
|
+
* `V0_TO_V1_TYPE` mapping can reference them without redeclaration.
|
|
55
|
+
*
|
|
56
|
+
* Do NOT emit these on the write/extraction path. They exist solely so
|
|
57
|
+
* `claims-helper.ts::readClaimFromBlob` can decode pre-v1 vault entries
|
|
58
|
+
* whose encrypted blobs still carry v0 token strings.
|
|
59
|
+
*/
|
|
60
|
+
export declare const LEGACY_V0_MEMORY_TYPES: readonly ["fact", "preference", "decision", "episodic", "goal", "context", "summary", "rule"];
|
|
61
|
+
export type MemoryTypeV0 = (typeof LEGACY_V0_MEMORY_TYPES)[number];
|
|
62
|
+
export type MemorySource = 'user' | 'user-inferred' | 'assistant' | 'external' | 'derived';
|
|
63
|
+
export type MemoryScope = 'work' | 'personal' | 'health' | 'family' | 'creative' | 'finance' | 'misc' | 'unspecified';
|
|
64
|
+
export type MemoryVolatility = 'stable' | 'updatable' | 'ephemeral';
|
|
65
|
+
export declare const VALID_MEMORY_SOURCES: readonly MemorySource[];
|
|
66
|
+
export declare const VALID_MEMORY_SCOPES: readonly MemoryScope[];
|
|
67
|
+
export declare const VALID_MEMORY_VOLATILITIES: readonly MemoryVolatility[];
|
|
68
|
+
/**
|
|
69
|
+
* Legacy v0 → v1 type mapping used by the read-side adapter when decoding
|
|
70
|
+
* a pre-v1 vault entry that still carries a v0 token string.
|
|
71
|
+
*
|
|
72
|
+
* Decisions (v0) map to v1 `claim` — the reasoning lives in the separate
|
|
73
|
+
* `reasoning` field rather than being encoded in the type.
|
|
74
|
+
*/
|
|
75
|
+
export declare const V0_TO_V1_TYPE: Record<MemoryTypeV0, MemoryType>;
|
|
76
|
+
/**
|
|
77
|
+
* Extracted fact. Shape carries full v1 taxonomy fields (source / scope /
|
|
78
|
+
* reasoning / volatility). `source` is required on the write path —
|
|
79
|
+
* `storeExtractedFacts` supplies `'user-inferred'` as a defensive default
|
|
80
|
+
* when a heuristic upstream fails to populate it.
|
|
81
|
+
*/
|
|
82
|
+
export interface ExtractedFact {
|
|
83
|
+
text: string;
|
|
84
|
+
/** v1 taxonomy type. Always present on newly-extracted facts. */
|
|
85
|
+
type: MemoryType;
|
|
86
|
+
importance: number;
|
|
87
|
+
action: ExtractionAction;
|
|
88
|
+
existingFactId?: string;
|
|
89
|
+
entities?: ExtractedEntity[];
|
|
90
|
+
confidence?: number;
|
|
91
|
+
/**
|
|
92
|
+
* v1 provenance tag. Required on the write path — when missing,
|
|
93
|
+
* `storeExtractedFacts` supplies `'user-inferred'` as a defensive default.
|
|
94
|
+
*/
|
|
95
|
+
source?: MemorySource;
|
|
96
|
+
/** v1 life-domain scope. Default 'unspecified'. */
|
|
97
|
+
scope?: MemoryScope;
|
|
98
|
+
/**
|
|
99
|
+
* Decision-with-reasoning "because Y" clause, for type=claim. Max 256 chars.
|
|
100
|
+
*/
|
|
101
|
+
reasoning?: string;
|
|
102
|
+
/**
|
|
103
|
+
* v1 stability signal. Assigned by `comparativeRescoreV1` or, when rescore
|
|
104
|
+
* is skipped (facts.length < 5), by the `defaultVolatility` heuristic.
|
|
105
|
+
*/
|
|
106
|
+
volatility?: MemoryVolatility;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Default confidence when the LLM does not provide one.
|
|
110
|
+
* Mirrors the fallback used by other extraction clients.
|
|
111
|
+
*/
|
|
112
|
+
export declare const DEFAULT_EXTRACTION_CONFIDENCE = 0.85;
|
|
113
|
+
/**
|
|
114
|
+
* Parse a single entity object from LLM output. Returns null if invalid.
|
|
115
|
+
* Invalid entities are silently dropped so a bad entity never fails the whole fact.
|
|
116
|
+
*/
|
|
117
|
+
export declare function parseEntity(raw: unknown): ExtractedEntity | null;
|
|
118
|
+
/**
|
|
119
|
+
* Clamp a raw confidence value to [0, 1]. Returns the default when missing or NaN.
|
|
120
|
+
*/
|
|
121
|
+
export declare function normalizeConfidence(raw: unknown): number;
|
|
122
|
+
/**
|
|
123
|
+
* Minimal logger shape accepted by the extraction pipeline. Matches the
|
|
124
|
+
* OpenClaw plugin logger so callers can pass `api.logger` directly.
|
|
125
|
+
*
|
|
126
|
+
* All methods are optional so tests can pass a partial object and callers
|
|
127
|
+
* that don't care about observability can omit the argument entirely.
|
|
128
|
+
*/
|
|
129
|
+
export interface ExtractorLogger {
|
|
130
|
+
info?: (msg: string) => void;
|
|
131
|
+
warn?: (msg: string) => void;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Compute a lexical importance bump (0-2) for a single fact based on signals
|
|
135
|
+
* in the surrounding conversation text.
|
|
136
|
+
*
|
|
137
|
+
* This is a Phase 2.2.6 quality fix complementing the prompt rubric tightening
|
|
138
|
+
* (item A). Where the rubric tells the LLM to use the full 1-10 range, the
|
|
139
|
+
* bump tells us *as a post-process*: when the user's actual phrasing carries
|
|
140
|
+
* strong "remember this" signals that the LLM may have under-weighted, push
|
|
141
|
+
* the score up.
|
|
142
|
+
*
|
|
143
|
+
* Signals detected (each adds +1, capped at +2 total):
|
|
144
|
+
*
|
|
145
|
+
* 1. **Strong intent phrases** anywhere in the conversation:
|
|
146
|
+
* "remember this", "never forget", "rule of thumb", "critical",
|
|
147
|
+
* "don't ever forget", explicit "always X" / "never Y" patterns.
|
|
148
|
+
* 2. **Emphasis markers**: `!!` (double exclamation), or 3+ all-caps words
|
|
149
|
+
* in a row (e.g. "DO NOT FORGET", "VERY IMPORTANT").
|
|
150
|
+
* 3. **Repetition**: the fact's first ~20 chars appear at least twice in
|
|
151
|
+
* the conversation text (paraphrased restating).
|
|
152
|
+
*
|
|
153
|
+
* The bump is additive on top of whatever the LLM scored; final importance
|
|
154
|
+
* is capped at 10.
|
|
155
|
+
*
|
|
156
|
+
* Final-importance ceiling: this never makes a fact pass the importance >= 6
|
|
157
|
+
* filter on its own — a fact still needs to have an LLM score >= 5 (because
|
|
158
|
+
* +2 from 5 = 7, above floor; +1 from 5 = 6, above floor). This is intentional:
|
|
159
|
+
* the bump is for "the LLM correctly identified this as worth storing but
|
|
160
|
+
* under-weighted it", not "the LLM said skip but we're overriding."
|
|
161
|
+
*/
|
|
162
|
+
export declare function computeLexicalImportanceBump(factText: string, conversationText: string): number;
|
|
163
|
+
/**
|
|
164
|
+
* Compaction-specific system prompt (v1 taxonomy). Fires when the conversation
|
|
165
|
+
* context is about to be compacted. LAST CHANCE to capture knowledge before
|
|
166
|
+
* it is lost, so the importance floor is 5 instead of 6 and the prompt is
|
|
167
|
+
* more aggressive about extracting active-project context, claims, and
|
|
168
|
+
* episodes.
|
|
169
|
+
*
|
|
170
|
+
* Differences from `EXTRACTION_SYSTEM_PROMPT`:
|
|
171
|
+
* - Opening framing emphasizes urgency ("last chance")
|
|
172
|
+
* - Format-agnostic: handles bullet lists, prose, mixed formats
|
|
173
|
+
* - Importance threshold lowered to 5
|
|
174
|
+
* - More aggressive on claim / episode / directive types
|
|
175
|
+
* - Anti-pattern: don't skip content just because it's in a summary
|
|
176
|
+
*
|
|
177
|
+
* Output format matches `EXTRACTION_SYSTEM_PROMPT` exactly (same merged
|
|
178
|
+
* topics+facts JSON shape with v1 type / source / scope fields), so the
|
|
179
|
+
* same `parseMergedResponseV1` parser can validate it.
|
|
180
|
+
*/
|
|
181
|
+
export declare const COMPACTION_SYSTEM_PROMPT = "You are extracting memories from a conversation that is about to be compacted. The context will be LOST after this point \u2014 this is your LAST CHANCE to capture everything worth remembering. Be more aggressive than usual: err on the side of storing.\n\nWork in TWO explicit phases within one response:\n\nPHASE 1 \u2014 Topic identification.\nIdentify the 2-3 main topics the user was engaging with before extracting any fact. Topics should be short phrases (2-5 words each). If there's no clear user-focused topic, use an empty topics array.\n\nPHASE 2 \u2014 Fact extraction anchored to those topics (plus preserve active context).\nExtract valuable memories. Prefer facts that directly relate to the identified topics (importance 7-9 range). Active project context, decisions in progress, and current working state score 6-8 during compaction \u2014 capture them even when they'd normally be marginal.\n\nRules:\n1. Each memory = single self-contained piece of information\n2. Focus on user-specific info useful in future conversations\n3. Skip generic knowledge, greetings, small talk\n4. Score importance 1-10 (5+ = worth storing during compaction)\n5. Every memory MUST attribute a source (provenance critical)\n\nImportance rubric (full 1-10 range, NOT just 7-8):\n- 10: Core identity, never-forget (\"remember this forever\", name/birthday)\n- 9: Affects many future decisions / high-impact rules\n- 8: Preference / decision-with-reasoning / operational rule\n- 7: Specific durable fact\n- 6: Borderline \u2014 during compaction, capture anyway\n- 5: Would normally drop; keep as compaction safety net\n- 4 or below: DROP (greetings, filler)\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nTYPE (6 values)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n- claim: factual assertion (absorbs v0 fact/context/decision; decisions populate reasoning)\n- preference: likes/dislikes/tastes\n- directive: imperative rule (\"always X\", \"never Y\")\n- commitment: future intent (\"will do X\")\n- episode: notable event\n- summary: derived synthesis (source must be derived|assistant)\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nSOURCE (provenance, CRITICAL)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n- user: user explicitly stated it (in [user]: turns)\n- user-inferred: extractor inferred from user signals\n- assistant: assistant authored \u2014 DOWNGRADE unless user affirmed/quoted\n- external, derived: rare\n\nIF fact substance appears ONLY in [assistant]: turns without user affirmation \u2192 source:assistant.\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nSCOPE\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nwork | personal | health | family | creative | finance | misc | unspecified\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nENTITIES\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n- type \u2208 {person, project, tool, company, concept, place}\n- prefer specific names (\"PostgreSQL\" not \"database\")\n- omit umbrella categories when specific name is present\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nREASONING (only for claims that are decisions)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nFor type=claim where the user expressed a decision-with-reasoning, populate \"reasoning\" with the WHY clause.\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nFORMAT-AGNOSTIC PARSING (IMPORTANT)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nThe conversation may contain bullet lists, numbered lists, section headers, code snippets, or plain prose. Treat ALL formats as potential sources of extractable memory:\n- Bullets/list items: each item is a candidate.\n- Section headers (Context, Decisions, Key Learnings, Open Questions): use the header as a TYPE HINT (Context \u2192 claim, Decisions \u2192 claim+reasoning, Learnings \u2192 directive, Open Questions \u2192 commitment).\n- Plain prose: parse each distinct assertion as a candidate.\n- Code snippets: extract config choices, tool versions, architectural decisions embedded in comments or structure.\n- Mixed format: apply all of the above.\n\nDo NOT skip content just because it's in a summary. The agent has already filtered \u2014 your job is to convert into structured memories, not to re-evaluate worth.\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nOUTPUT FORMAT (no markdown, no code fences)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n{\n \"topics\": [\"topic 1\", \"topic 2\"],\n \"facts\": [\n {\n \"text\": \"...\",\n \"type\": \"claim|preference|directive|commitment|episode\",\n \"source\": \"user|user-inferred|assistant\",\n \"scope\": \"work|personal|health|...\",\n \"importance\": N,\n \"confidence\": 0.9,\n \"action\": \"ADD\",\n \"reasoning\": \"...\", // optional, only for claim+decision\n \"entities\": [{\"name\": \"...\", \"type\": \"tool\"}]\n }\n ]\n}\n\nIf nothing worth extracting: {\"topics\": [], \"facts\": []}";
|
|
182
|
+
/**
|
|
183
|
+
* Parse facts for compaction context (v1 taxonomy; importance floor 5).
|
|
184
|
+
*
|
|
185
|
+
* Identical to `parseFactsResponse` except the importance floor is 5 instead
|
|
186
|
+
* of 6 — compaction is the last chance to capture context, so we accept
|
|
187
|
+
* borderline facts that would normally be dropped.
|
|
188
|
+
*
|
|
189
|
+
* Accepts the same merged-topic v1 JSON shape as the main prompt. The
|
|
190
|
+
* inner `parseMergedResponseV1` enforces the >=6 floor, so we re-run a
|
|
191
|
+
* lenient >=5 pass on the raw parsed payload to admit the borderline items.
|
|
192
|
+
*/
|
|
193
|
+
export declare function parseFactsResponseForCompaction(response: string, logger?: ExtractorLogger): ExtractedFact[];
|
|
194
|
+
/**
|
|
195
|
+
* Extract facts using the compaction-aware prompt.
|
|
196
|
+
*
|
|
197
|
+
* This is called from the `before_compaction` hook — the LAST CHANCE to
|
|
198
|
+
* capture knowledge before conversation context is lost. Key differences
|
|
199
|
+
* from `extractFacts`:
|
|
200
|
+
* - Uses `COMPACTION_SYSTEM_PROMPT` (lower threshold, format-agnostic, more aggressive)
|
|
201
|
+
* - Always processes the full conversation (`mode: 'full'`)
|
|
202
|
+
* - Importance filter is >= 5 instead of >= 6
|
|
203
|
+
* - Lexical importance bumps still apply
|
|
204
|
+
*
|
|
205
|
+
* @param rawMessages - The messages array from the hook event (unknown[])
|
|
206
|
+
* @param existingMemories - Optional list of existing memories for dedup context
|
|
207
|
+
* @param logger - Optional logger for observability
|
|
208
|
+
* @returns Array of extracted facts, or empty array on failure.
|
|
209
|
+
*/
|
|
210
|
+
export declare function extractFactsForCompaction(rawMessages: unknown[], existingMemories?: Array<{
|
|
211
|
+
id: string;
|
|
212
|
+
text: string;
|
|
213
|
+
}>, logger?: ExtractorLogger): Promise<ExtractedFact[]>;
|
|
214
|
+
/**
|
|
215
|
+
* Canonical debrief system prompt — must be identical across all clients.
|
|
216
|
+
*/
|
|
217
|
+
export declare const DEBRIEF_SYSTEM_PROMPT = "You are reviewing a conversation that just ended. The following facts were\nalready extracted and stored during this conversation:\n\n{already_stored_facts}\n\nYour job is to capture what turn-by-turn extraction MISSED. Focus on:\n\n1. **Broader context** \u2014 What was the conversation about overall? What project,\n problem, or topic tied the discussion together?\n2. **Outcomes & conclusions** \u2014 What was decided, agreed upon, or resolved?\n3. **What was attempted** \u2014 What approaches were tried? What worked, what didn't, and why?\n4. **Relationships** \u2014 How do topics discussed relate to each other or to things\n from previous conversations?\n5. **Open threads** \u2014 What was left unfinished or needs follow-up?\n\nDo NOT repeat facts already stored. Only add genuinely new information that provides\nbroader context a future conversation would benefit from.\n\nReturn a JSON array (no markdown, no code fences):\n[{\"text\": \"...\", \"type\": \"summary|context\", \"importance\": N}]\n\n- Use type \"summary\" for conclusions, outcomes, and decisions-of-the-session\n- Use type \"context\" for broader project context, open threads, and what-was-tried\n- Importance 7-8 for most debrief items (they are high-value by definition)\n- Maximum 5 items (debriefs should be concise, not exhaustive)\n- Each item should be 1-3 sentences, self-contained\n\nIf the conversation was too short or trivial to warrant a debrief, return: []";
|
|
218
|
+
export interface DebriefItem {
|
|
219
|
+
text: string;
|
|
220
|
+
type: 'summary' | 'context';
|
|
221
|
+
importance: number;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Parse a debrief response into validated DebriefItems.
|
|
225
|
+
*/
|
|
226
|
+
export declare function parseDebriefResponse(response: string): DebriefItem[];
|
|
227
|
+
/**
|
|
228
|
+
* Extract a session debrief using LLM.
|
|
229
|
+
*
|
|
230
|
+
* @param rawMessages - All messages from the session
|
|
231
|
+
* @param storedFactTexts - Texts of facts already stored in this session (for dedup)
|
|
232
|
+
* @returns Array of debrief items, or empty array on failure
|
|
233
|
+
*/
|
|
234
|
+
export declare function extractDebrief(rawMessages: unknown[], storedFactTexts: string[]): Promise<DebriefItem[]>;
|
|
235
|
+
/**
|
|
236
|
+
* The main extraction system prompt (v1 merged-topic pipeline).
|
|
237
|
+
*
|
|
238
|
+
* Exported as both `EXTRACTION_SYSTEM_PROMPT` (canonical) and
|
|
239
|
+
* `EXTRACTION_SYSTEM_PROMPT_V1_MERGED` (deprecated alias) for back-compat.
|
|
240
|
+
*/
|
|
241
|
+
export declare const EXTRACTION_SYSTEM_PROMPT = "You are a memory extraction engine using Memory Taxonomy v1. Work in TWO explicit phases within one response:\n\nPHASE 1 \u2014 Topic identification.\nBefore extracting any fact, identify the 2-3 main topics the user was engaging with. Topics should be short phrases (2-5 words each). If the conversation has no clear user-focused topic, use an empty topics array.\n\nPHASE 2 \u2014 Fact extraction anchored to those topics.\nExtract valuable memories. Prefer facts that directly relate to the identified topics (importance 7-9 range). Tangential facts may still be extracted but score lower (6-7 range).\n\nRules:\n1. Each memory = single self-contained piece of information\n2. Focus on user-specific info useful in future conversations\n3. Skip generic knowledge, greetings, small talk, ephemeral task coordination\n4. Score importance 1-10 (6+ = worth storing)\n5. Every memory MUST attribute a source (provenance critical)\n\nImportance rubric (use FULL 1-10 range):\n- 10: Critical, core identity, never-forget content\n- 9: Affects many future decisions\n- 8: High-value preference/decision/rule\n- 7: Specific durable fact\n- 6: Borderline\n- 5 or below: NOT worth storing \u2014 drop\n\nDO NOT cluster everything at 7-8-9.\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nTYPE (6 values)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n- claim: factual assertion (absorbs fact/context/decision; decisions populate reasoning field)\n- preference: likes/dislikes/tastes\n- directive: imperative rule (\"always X\", \"never Y\")\n- commitment: future intent (\"will do X\")\n- episode: notable event\n- summary: derived synthesis (source must be derived|assistant) \u2014 do NOT emit for turn-extraction\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nSOURCE (provenance, CRITICAL)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n- user: user explicitly stated it (in [user]: turns)\n- user-inferred: extractor inferred from user signals\n- assistant: assistant authored content \u2014 DOWNGRADE unless user affirmed/quoted/used it\n- external, derived: rare\n\nIF fact substance appears ONLY in [assistant]: turns without user affirmation \u2192 source:assistant\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nSCOPE (life domain)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nwork | personal | health | family | creative | finance | misc | unspecified\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nENTITIES\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n- type \u2208 {person, project, tool, company, concept, place}\n- prefer specific names (\"PostgreSQL\" not \"database\")\n- omit umbrella categories when specific name is present\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nREASONING (only for claims that are decisions)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nFor type=claim where the user expressed a decision-with-reasoning, populate \"reasoning\" with the WHY clause.\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nOUTPUT FORMAT (no markdown, no code fences)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n{\n \"topics\": [\"topic 1\", \"topic 2\"],\n \"facts\": [\n {\n \"text\": \"...\",\n \"type\": \"claim|preference|directive|commitment|episode\",\n \"source\": \"user|user-inferred|assistant\",\n \"scope\": \"work|personal|health|...\",\n \"importance\": N,\n \"confidence\": 0.9,\n \"action\": \"ADD\",\n \"reasoning\": \"...\", // optional, only for claim+decision\n \"entities\": [{\"name\": \"...\", \"type\": \"tool\"}]\n }\n ]\n}\n\nIf nothing worth extracting: {\"topics\": [], \"facts\": []}";
|
|
242
|
+
/**
|
|
243
|
+
* @deprecated Use `EXTRACTION_SYSTEM_PROMPT` instead. Kept only as a
|
|
244
|
+
* back-compat alias for callers that imported the v1 rollout name.
|
|
245
|
+
*/
|
|
246
|
+
export declare const EXTRACTION_SYSTEM_PROMPT_V1_MERGED = "You are a memory extraction engine using Memory Taxonomy v1. Work in TWO explicit phases within one response:\n\nPHASE 1 \u2014 Topic identification.\nBefore extracting any fact, identify the 2-3 main topics the user was engaging with. Topics should be short phrases (2-5 words each). If the conversation has no clear user-focused topic, use an empty topics array.\n\nPHASE 2 \u2014 Fact extraction anchored to those topics.\nExtract valuable memories. Prefer facts that directly relate to the identified topics (importance 7-9 range). Tangential facts may still be extracted but score lower (6-7 range).\n\nRules:\n1. Each memory = single self-contained piece of information\n2. Focus on user-specific info useful in future conversations\n3. Skip generic knowledge, greetings, small talk, ephemeral task coordination\n4. Score importance 1-10 (6+ = worth storing)\n5. Every memory MUST attribute a source (provenance critical)\n\nImportance rubric (use FULL 1-10 range):\n- 10: Critical, core identity, never-forget content\n- 9: Affects many future decisions\n- 8: High-value preference/decision/rule\n- 7: Specific durable fact\n- 6: Borderline\n- 5 or below: NOT worth storing \u2014 drop\n\nDO NOT cluster everything at 7-8-9.\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nTYPE (6 values)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n- claim: factual assertion (absorbs fact/context/decision; decisions populate reasoning field)\n- preference: likes/dislikes/tastes\n- directive: imperative rule (\"always X\", \"never Y\")\n- commitment: future intent (\"will do X\")\n- episode: notable event\n- summary: derived synthesis (source must be derived|assistant) \u2014 do NOT emit for turn-extraction\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nSOURCE (provenance, CRITICAL)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n- user: user explicitly stated it (in [user]: turns)\n- user-inferred: extractor inferred from user signals\n- assistant: assistant authored content \u2014 DOWNGRADE unless user affirmed/quoted/used it\n- external, derived: rare\n\nIF fact substance appears ONLY in [assistant]: turns without user affirmation \u2192 source:assistant\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nSCOPE (life domain)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nwork | personal | health | family | creative | finance | misc | unspecified\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nENTITIES\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n- type \u2208 {person, project, tool, company, concept, place}\n- prefer specific names (\"PostgreSQL\" not \"database\")\n- omit umbrella categories when specific name is present\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nREASONING (only for claims that are decisions)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nFor type=claim where the user expressed a decision-with-reasoning, populate \"reasoning\" with the WHY clause.\n\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nOUTPUT FORMAT (no markdown, no code fences)\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n{\n \"topics\": [\"topic 1\", \"topic 2\"],\n \"facts\": [\n {\n \"text\": \"...\",\n \"type\": \"claim|preference|directive|commitment|episode\",\n \"source\": \"user|user-inferred|assistant\",\n \"scope\": \"work|personal|health|...\",\n \"importance\": N,\n \"confidence\": 0.9,\n \"action\": \"ADD\",\n \"reasoning\": \"...\", // optional, only for claim+decision\n \"entities\": [{\"name\": \"...\", \"type\": \"tool\"}]\n }\n ]\n}\n\nIf nothing worth extracting: {\"topics\": [], \"facts\": []}";
|
|
247
|
+
/**
|
|
248
|
+
* Parse a v1 merged-topic LLM response. Returns both the topic list and the
|
|
249
|
+
* validated/filtered fact list. Illegal combinations (summary+user) are
|
|
250
|
+
* dropped; importance < 6 with action != DELETE is dropped.
|
|
251
|
+
*
|
|
252
|
+
* Exported as both `parseFactsResponse` (canonical, returns facts array) and
|
|
253
|
+
* `parseMergedResponseV1` (returns `{ topics, facts }`). Prefer the former
|
|
254
|
+
* unless the topic list is needed.
|
|
255
|
+
*/
|
|
256
|
+
export declare function parseMergedResponseV1(response: string, logger?: ExtractorLogger): {
|
|
257
|
+
topics: string[];
|
|
258
|
+
facts: ExtractedFact[];
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* Parse an LLM extraction response into structured v1 facts. Canonical
|
|
262
|
+
* parser used by the default `extractFacts()` pipeline.
|
|
263
|
+
*
|
|
264
|
+
* This is a thin wrapper around `parseMergedResponseV1` that discards the
|
|
265
|
+
* topic list so existing callers that expect a flat `ExtractedFact[]`
|
|
266
|
+
* signature keep working.
|
|
267
|
+
*/
|
|
268
|
+
export declare function parseFactsResponse(response: string, logger?: ExtractorLogger): ExtractedFact[];
|
|
269
|
+
/**
|
|
270
|
+
* Tag-don't-drop provenance filter (pipeline G / F).
|
|
271
|
+
*
|
|
272
|
+
* For each fact:
|
|
273
|
+
* - If source is already "assistant", cap importance at 7.
|
|
274
|
+
* - Otherwise, keyword-match the fact against user turns. If <30% of
|
|
275
|
+
* content words (length >= 4) appear in user turns AND source != "user",
|
|
276
|
+
* tag source as "assistant" and cap importance at 7 (keep the fact).
|
|
277
|
+
* - Drop facts below importance 5 (unless DELETE action).
|
|
278
|
+
*/
|
|
279
|
+
export declare function applyProvenanceFilterLax(facts: ExtractedFact[], conversationText: string): ExtractedFact[];
|
|
280
|
+
/**
|
|
281
|
+
* Heuristic fallback volatility when the LLM doesn't assign one.
|
|
282
|
+
*/
|
|
283
|
+
export declare function defaultVolatility(f: ExtractedFact): MemoryVolatility;
|
|
284
|
+
/**
|
|
285
|
+
* Comparative re-scoring pass (v1). Forces re-scoring when facts.length >= 5
|
|
286
|
+
* so the importance distribution spreads across the 1-10 range. When
|
|
287
|
+
* facts.length < 5, assigns defaultVolatility and returns.
|
|
288
|
+
*/
|
|
289
|
+
export declare function comparativeRescoreV1(facts: ExtractedFact[], conversationText: string, logger?: ExtractorLogger): Promise<ExtractedFact[]>;
|
|
290
|
+
/**
|
|
291
|
+
* Main extraction entry point (default pipeline as of plugin v3.0.0).
|
|
292
|
+
*
|
|
293
|
+
* Pipeline: single merged-topic LLM call → `applyProvenanceFilterLax`
|
|
294
|
+
* (tag-don't-drop) → `comparativeRescoreV1` (forces re-rank when >= 5 facts)
|
|
295
|
+
* → `defaultVolatility` fallback → lexical importance bumps.
|
|
296
|
+
*
|
|
297
|
+
* Produces v1-shaped facts with `type`, `source`, `scope`, `volatility`,
|
|
298
|
+
* and optional `reasoning` fields populated. The caller should hand the
|
|
299
|
+
* result to `storeExtractedFacts` which emits a v1 canonical claim blob.
|
|
300
|
+
*/
|
|
301
|
+
export declare function extractFacts(rawMessages: unknown[], mode: 'turn' | 'full', existingMemories?: Array<{
|
|
302
|
+
id: string;
|
|
303
|
+
text: string;
|
|
304
|
+
}>, profileContext?: string, logger?: ExtractorLogger): Promise<ExtractedFact[]>;
|
|
305
|
+
//# sourceMappingURL=extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../src/extraction/extractor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAQH,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEpE,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEzF,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IAC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