@triplef/agent 1.0.3 → 1.0.4
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/dist/prompts/index.d.ts +3 -3
- package/dist/prompts/index.mjs +50 -40
- package/dist/schemas/index.d.ts +10 -7
- package/dist/schemas/index.mjs +34 -27
- package/dist/tools/index.d.ts +9 -6
- package/dist/tools/index.mjs +13 -9
- package/package.json +12 -12
package/dist/prompts/index.d.ts
CHANGED
|
@@ -219,7 +219,7 @@ declare function buildMemoryProfilePrompt(params: {
|
|
|
219
219
|
maxPayloadChars?: number;
|
|
220
220
|
}): string;
|
|
221
221
|
|
|
222
|
-
declare const MEMORY_WRITE_INSTRUCTIONS = "MEMORY WRITE JOB \u2014 one purpose: decide whether THIS turn yielded anything worth persisting, and store it in the correct lane via the memory-partition-remember or memory-cognition-remember tool.\n\nTwo lanes, never confused:\n- memory-partition = the OBJECTIVE fact store: external-world facts, factual records, project details, and events the user stated, subjects gathered this turn, or facts the user asked you to remember.\n- memory-cognition = the SUBJECTIVE profile store: every preference, interest, trait, or internal state of the user (stated or inferred) \u2014 YOUR understanding of the user, persona learnings included.\n\nYou receive:\n- USER REQUEST: what the user asked.\n- PRIOR MEMORY: facts already stored for this user (may be empty).\n- PROBED THIS TURN: what memory-partition-recall already surfaced for this turn (may be empty) \u2014 already known, never re-store.\n- GATHERED DATA: summarized tool results from this turn (web searches, lookups).\n\nStore into the PARTITION lane (call memory-partition-remember) only when it is durable, objective, and user-specific:\n- A factual record the user states or asks you to track (contact info, a decision, a project detail, an event, their setup \u2014 however phrased, any language).\n- Knowledge about a subject the user cares about that was gathered this turn and extends what is already in PRIOR MEMORY.\n\nROUTING CONSTRAINT (absolute): extract ONLY objective, external facts to the partition. You MUST NOT store user preferences, behavioral traits, or internal states there (\"the user likes\u2026\", \"the user is interested in\u2026\", \"the user prefers\u2026\"). All user profile and persona data is deferred to the cognition tier.\n\nStore into the COGNITION lane (call memory-cognition-remember) whenever the turn yields SUBJECTIVE user data, stated or derived:\n- A preference or interest the user states outright (favorite X, a like or dislike, a style choice) \u2014 stated preferences live HERE, never in the partition.\n- An inferred trait, a standing interest, a working nuance, or a connection between facts the turn supports.\n- Never an objective fact \u2014 those belong in the partition lane.\n\nSTORAGE MECHANICS \u2014 how your memory works (write for the retriever):\n- Each stored record is embedded as a whole AND matched sentence-by-sentence at recall time (multi-variant retrieval). One self-contained fact per call; a single long, dense sentence is fine, but lead with the subject (\"Sam's phone number is 555-1234\", never \"His number is \u2026\").\n- Restating a record verbatim OVERWRITES it in place \u2014 updates are restatements of the full corrected statement, not diffs.\n- tags are the ONLY topic-filter vocabulary at recall \u2014 reuse stable, lowercase topic labels (partition lane only). Tags are NARROW and specific: entity names, product names, game titles (\"amd\", \"stellar blade\", \"stellar blade blood rain\").\n- The macro-taxonomy routes a fact into its family hierarchy (partition lane only), top-down: CLUSTER \u2192 COMMUNITY \u2192 HUB \u2192 NODE (the NODE is the stored record itself \u2014 never named):\n - category (CLUSTER): ONE lowercase PLURAL family noun \u2014 stocks, games, pets, work, health, finance, contacts \u2026\n - community (COMMUNITY): ONE lowercase PLURAL sub-family narrowing the category (\"survival games\" under \"games\", \"tv shows\" under \"shows\"); omit when no sub-family applies.\n - subject (HUB): the lowercase SINGULAR main subject entity the fact is about (\"project zomboid\", \"amd\", \"sam\") \u2014 a specific name, never pluralized; always include when the fact is about a specific entity.\n A category or community is NEVER a specific entity, product, company, or game title: \"amd\" is a subject under the category \"stocks\"; \"stellar blade\" is a subject under the category \"games\"; a show/work title like \"breaking-bad\" is a tag or hub, never a community. Always include category; reuse the existing labels whenever they fit.\n- PERSONA & FICTION CONTENT (absolute): content about an adopted persona, a roleplay, or a fictional/entertainment work routes by its real-world MEDIUM, never by in-universe domains \u2014 a TV persona's biography, family, or career belongs under the medium family (category \"shows\", community \"tv shows\", hub the show's title or the persona name); never \"family\", \"education\", \"business\", or \"science\" for invented content.\n\nTAXONOMY PROBING (pick first, create if necessary): before naming a
|
|
222
|
+
declare const MEMORY_WRITE_INSTRUCTIONS = "MEMORY WRITE JOB \u2014 one purpose: decide whether THIS turn yielded anything worth persisting, and store it in the correct lane via the memory-partition-remember or memory-cognition-remember tool.\n\nTwo lanes, never confused:\n- memory-partition = the OBJECTIVE fact store: external-world facts, factual records, project details, and events the user stated, subjects gathered this turn, or facts the user asked you to remember.\n- memory-cognition = the SUBJECTIVE profile store: every preference, interest, trait, or internal state of the user (stated or inferred) \u2014 YOUR understanding of the user, persona learnings included.\n\nYou receive:\n- USER REQUEST: what the user asked.\n- PRIOR MEMORY: facts already stored for this user (may be empty).\n- PROBED THIS TURN: what memory-partition-recall already surfaced for this turn (may be empty) \u2014 already known, never re-store.\n- GATHERED DATA: summarized tool results from this turn (web searches, lookups).\n\nStore into the PARTITION lane (call memory-partition-remember) only when it is durable, objective, and user-specific:\n- A factual record the user states or asks you to track (contact info, a decision, a project detail, an event, their setup \u2014 however phrased, any language).\n- Knowledge about a subject the user cares about that was gathered this turn and extends what is already in PRIOR MEMORY.\n\nROUTING CONSTRAINT (absolute): extract ONLY objective, external facts to the partition. You MUST NOT store user preferences, behavioral traits, or internal states there (\"the user likes\u2026\", \"the user is interested in\u2026\", \"the user prefers\u2026\"). All user profile and persona data is deferred to the cognition tier.\n\nStore into the COGNITION lane (call memory-cognition-remember) whenever the turn yields SUBJECTIVE user data, stated or derived:\n- A preference or interest the user states outright (favorite X, a like or dislike, a style choice) \u2014 stated preferences live HERE, never in the partition.\n- An inferred trait, a standing interest, a working nuance, or a connection between facts the turn supports.\n- Never an objective fact \u2014 those belong in the partition lane.\n\nSTORAGE MECHANICS \u2014 how your memory works (write for the retriever):\n- Each stored record is embedded as a whole AND matched sentence-by-sentence at recall time (multi-variant retrieval). One self-contained fact per call; a single long, dense sentence is fine, but lead with the subject (\"Sam's phone number is 555-1234\", never \"His number is \u2026\").\n- Restating a record verbatim OVERWRITES it in place \u2014 updates are restatements of the full corrected statement, not diffs.\n- tags are the ONLY topic-filter vocabulary at recall \u2014 reuse stable, lowercase topic labels (partition lane only). Tags are NARROW and specific: entity names, product names, game titles (\"amd\", \"stellar blade\", \"stellar blade blood rain\").\n- The macro-taxonomy routes a fact into its family hierarchy (partition lane only), top-down: CLUSTER \u2192 COMMUNITY \u2192 HUB \u2192 NODE (the NODE is the stored record itself \u2014 never named):\n - category (CLUSTER): ONE lowercase PLURAL family noun \u2014 stocks, games, pets, work, health, finance, contacts \u2026\n - community (COMMUNITY): ONE lowercase PLURAL sub-family narrowing the category (\"survival games\" under \"games\", \"tv shows\" under \"shows\"); omit when no sub-family applies.\n - subject (HUB): the lowercase SINGULAR main subject entity the fact is about (\"project zomboid\", \"amd\", \"sam\") \u2014 a specific name, never pluralized; always include when the fact is about a specific entity.\n A category or community is NEVER a specific entity, product, company, or game title: \"amd\" is a subject under the category \"stocks\"; \"stellar blade\" is a subject under the category \"games\"; a show/work title like \"breaking-bad\" is a tag or hub, never a community. Always include category; reuse the existing labels whenever they fit.\n- PERSONA & FICTION CONTENT (absolute): content about an adopted persona, a roleplay, or a fictional/entertainment work routes by its real-world MEDIUM, never by in-universe domains \u2014 a TV persona's biography, family, or career belongs under the medium family (category \"shows\", community \"tv shows\", hub the show's title or the persona name); never \"family\", \"education\", \"business\", or \"science\" for invented content.\n\nTAXONOMY PROBING (pick first, create if necessary): before naming a tier label you are not certain exists, call memory-taxonomy-probe top-down \u2014 cluster \u2192 community \u2192 hub \u2192 node \u2014 and ADOPT a returned candidate by naming it VERBATIM in the remember call (its id becomes the next probe's parentId). CREATE a new label only when every candidate misses the meaning \u2014 then follow the phrasing rules (plural family/sub-family, singular hub, singular node aspect) and optionally pass an \"icon\" from the curated set for the label you create. The known-vocabulary section below already lists likely fits; probing confirms them or finds better ones.\n\nDo NOT store:\n- Public facts merely fetched this turn that do not relate to the user (e.g. generic web results).\n- Anything already covered by PRIOR MEMORY or PROBED THIS TURN \u2014 extend or update it via the remember call; do not repeat.\n- Tool artifacts: URLs, search scores, image metadata, raw JSON keys.\n- Inferred, assumed, or extrapolated details about the user that neither their words nor GATHERED DATA support \u2014 if the user did not state it (or clearly imply it), it is not memory; when in doubt, answer \"none\".\n\nRules:\n- Each remember call stores ONE self-contained statement (stand-alone, understandable weeks later without this conversation's context).\n- Call each remember tool once per distinct durable item \u2014 no more.\n- If nothing durable surfaced, produce a one-word text answer (\"none\") and make NO tool call. An empty memory write is a correct outcome, never a failure.";
|
|
223
223
|
declare function buildMemoryWritePrompt(params: {
|
|
224
224
|
userRequest: string;
|
|
225
225
|
priorMemory?: string;
|
|
@@ -243,9 +243,9 @@ declare function buildResearchTriagePrompt(gaps: Array<{
|
|
|
243
243
|
snippet: string;
|
|
244
244
|
}>, maxPayloadChars?: number): string;
|
|
245
245
|
|
|
246
|
-
declare const TAXONOMY_RECONCILE_INSTRUCTIONS = "TAXONOMY RECONCILIATION \u2014 one purpose: decide whether two EXISTING taxonomy labels of the same tier name the same concept and should merge into one.\n\nThe macro-taxonomy, top-down: CLUSTER (plural family, e.g. \"games\") \u2192 COMMUNITY (plural sub-family, e.g. \"survival-games\") \u2192 HUB (singular subject entity, e.g. \"project zomboid\") \u2192 plus TAG labels (narrow recall vocabulary).\n\nMerge ONLY wording variants of one concept: casing/formatting drift (\"Video Games\" / \"video-games\"), singular/plural drift inside a family tier (\"survival game\" / \"survival-games\"), abbreviation with identical expansion (\"nlp\" / \"natural-language-processing\").\nNEVER merge: two entities that merely share a word (\"apple\" the company vs \"apple\" the fruit), a parent and its child (\"games\" vs \"survival-games\"), a broad tier and a specific entity (\"games\" vs \"project zomboid\"), or two genuinely different topics that happen to look similar. When in doubt, answer DISTINCT \u2014 a missed merge is cleaned up later; a wrong merge destroys both labels' meaning forever.";
|
|
246
|
+
declare const TAXONOMY_RECONCILE_INSTRUCTIONS = "TAXONOMY RECONCILIATION \u2014 one purpose: decide whether two EXISTING taxonomy labels of the same tier name the same concept and should merge into one.\n\nThe macro-taxonomy, top-down: CLUSTER (plural family, e.g. \"games\") \u2192 COMMUNITY (plural sub-family, e.g. \"survival-games\") \u2192 HUB (singular subject entity, e.g. \"project zomboid\") \u2192 NODE (singular aspect under the hub, e.g. \"base building\") \u2192 plus TAG labels (narrow recall vocabulary).\n\nMerge ONLY wording variants of one concept: casing/formatting drift (\"Video Games\" / \"video-games\"), singular/plural drift inside a family tier (\"survival game\" / \"survival-games\"), abbreviation with identical expansion (\"nlp\" / \"natural-language-processing\").\nNEVER merge: two entities that merely share a word (\"apple\" the company vs \"apple\" the fruit), a parent and its child (\"games\" vs \"survival-games\"), a broad tier and a specific entity (\"games\" vs \"project zomboid\"), or two genuinely different topics that happen to look similar. When in doubt, answer DISTINCT \u2014 a missed merge is cleaned up later; a wrong merge destroys both labels' meaning forever.";
|
|
247
247
|
declare function buildTaxonomyPairPrompt(params: {
|
|
248
|
-
kind: 'cluster' | 'community' | 'hub' | 'tag';
|
|
248
|
+
kind: 'cluster' | 'community' | 'hub' | 'node' | 'tag';
|
|
249
249
|
labelA: string;
|
|
250
250
|
labelB: string;
|
|
251
251
|
countA: number;
|
package/dist/prompts/index.mjs
CHANGED
|
@@ -3061,14 +3061,14 @@ var EncyclopediaClassifySchema = z.object({
|
|
|
3061
3061
|
*/
|
|
3062
3062
|
category: z.string(),
|
|
3063
3063
|
/**
|
|
3064
|
-
* One lowercase PLURAL sub-family
|
|
3064
|
+
* One lowercase PLURAL sub-family narrowing the category (e.g.
|
|
3065
3065
|
* `survival-games` under `games`, `tv-shows` under `shows`) — the
|
|
3066
|
-
* constellation's COMMUNITY tier, one level below the cluster.
|
|
3067
|
-
*
|
|
3068
|
-
* company, or title — a show/work title like `breaking-bad` is a
|
|
3069
|
-
*
|
|
3066
|
+
* constellation's COMMUNITY tier, one level below the cluster. The chain
|
|
3067
|
+
* is strict, so community is always present. Never a specific entity,
|
|
3068
|
+
* product, company, or title — a show/work title like `breaking-bad` is a
|
|
3069
|
+
* hub, never a community.
|
|
3070
3070
|
*/
|
|
3071
|
-
community: z.string()
|
|
3071
|
+
community: z.string(),
|
|
3072
3072
|
/**
|
|
3073
3073
|
* The narrow SINGULAR subject entity the document is about (e.g.
|
|
3074
3074
|
* `wuthering waves`, `q3 budget`) — the constellation's HUB tier. A short,
|
|
@@ -3076,11 +3076,13 @@ var EncyclopediaClassifySchema = z.object({
|
|
|
3076
3076
|
*/
|
|
3077
3077
|
topic: z.string(),
|
|
3078
3078
|
/**
|
|
3079
|
-
*
|
|
3080
|
-
*
|
|
3081
|
-
*
|
|
3082
|
-
*
|
|
3079
|
+
* The SINGULAR aspect of the document under its hub (e.g. `base building`
|
|
3080
|
+
* under `project zomboid`, `department spend` under `q3 budget`) — the
|
|
3081
|
+
* constellation's NODE tier, one level below the hub: a named sub-entity
|
|
3082
|
+
* or topic branch the chunks file under. Reuse the known vocabulary
|
|
3083
|
+
* instead of minting near-variants.
|
|
3083
3084
|
*/
|
|
3085
|
+
node: z.string(),
|
|
3084
3086
|
icon: z.string().optional()
|
|
3085
3087
|
});
|
|
3086
3088
|
|
|
@@ -3119,24 +3121,25 @@ function buildEncyclopediaClassifyPrompt(vocabulary = {}) {
|
|
|
3119
3121
|
after: `
|
|
3120
3122
|
YOUR TASK \u2014 label one stored source document with its place in the macro-taxonomy:
|
|
3121
3123
|
|
|
3122
|
-
TAXONOMY HIERARCHY (top-down): CLUSTER \u2192 COMMUNITY \u2192 HUB \u2192 NODE
|
|
3124
|
+
TAXONOMY HIERARCHY (top-down): CLUSTER \u2192 COMMUNITY \u2192 HUB \u2192 NODE \u2192 LEAF
|
|
3123
3125
|
- CLUSTER = a broad PLURAL family noun ("games", "work", "health") \u2014 the highest logical bucket.
|
|
3124
3126
|
- COMMUNITY = a PLURAL sub-family under one cluster ("survival-games" under "games") \u2014 a genre or domain branch.
|
|
3125
3127
|
- HUB = the SINGULAR main subject entity anchoring the document ("project zomboid", "wuthering waves") \u2014 a specific name, never pluralized.
|
|
3126
|
-
- NODE = the
|
|
3128
|
+
- NODE = the SINGULAR aspect of the document under its hub ("base building" under "project zomboid", "department spend" under "q3 budget") \u2014 a named sub-entity or topic branch; the document's chunks are the LEAVES filed under it. The chain is strict: ALL FOUR labels are always present.
|
|
3127
3129
|
|
|
3128
3130
|
- The document may be a fetched web page, an uploaded file, or a search-result snippet. Classify by its CONTENT, never by its source shape \u2014 a file has no domain, and that must not matter.
|
|
3129
3131
|
- FICTION & ENTERTAINMENT CONTENT (absolute): a document about an entertainment work or fictional universe classifies by its real-world MEDIUM, never by the work's in-universe domains. A TV episode page about a character's family or career is NOT "family", "education", "business", or "science" \u2014 the category is the medium family (e.g. "shows"), the community a true plural sub-family (e.g. "tv-shows"), and the work's title is the topic (e.g. "breaking bad"), never the community.
|
|
3130
3132
|
- category (CLUSTER): ONE broad lowercase PLURAL family noun (e.g. "games", "work", "health", "finance") that groups the topic into a family. It labels the TOPIC \u2014 never a side theme or an incidental mention on the page. Never a specific entity, product, company, or title.
|
|
3131
|
-
- community (COMMUNITY
|
|
3133
|
+
- community (COMMUNITY): ONE lowercase PLURAL sub-family narrowing the category (e.g. "survival-games" under "games"). Always present; never a specific entity, product, company, or title \u2014 a show/work title like "breaking-bad" is a hub, never a community.
|
|
3132
3134
|
- topic (HUB): the document's MAIN subject entity \u2014 what the whole source is about (e.g. "wuthering waves", "q3 budget", "rust borrow checker") \u2014 SINGULAR and specific. A short, reusable label \u2014 not a sentence, not a URL, not a filename, never a domain or a site name. Never a sub-part of the main subject (a chapter, a location, one feature) and never an adjacent proper noun (a publisher, an author, a related event) \u2014 when a title-level entity exists, it is the topic.
|
|
3135
|
+
- node (NODE): the SINGULAR aspect of the document under its hub \u2014 the named sub-entity or topic branch the source focuses on (e.g. "base building" under "project zomboid"). Short and reusable \u2014 never a sentence, never a URL.
|
|
3133
3136
|
- When the document is about a KNOWN TOPIC, output that label VERBATIM \u2014 prefer "neverness to everness" over minting a variant like "nte".
|
|
3134
|
-
- TAXONOMY PROBING (pick first, create if necessary): when the memory-taxonomy-probe tool is available, probe top-down \u2014 cluster \u2192 community \u2192 hub \u2014 before answering, and ADOPT returned candidates VERBATIM (a candidate's id becomes the next probe's parentId). CREATE a new label only when no candidate fits; on creation you may pass one "icon" from the curated taxonomy icon set for the deepest NEW label.
|
|
3137
|
+
- TAXONOMY PROBING (pick first, create if necessary): when the memory-taxonomy-probe tool is available, probe top-down \u2014 cluster \u2192 community \u2192 hub \u2192 node \u2014 before answering, and ADOPT returned candidates VERBATIM (a candidate's id becomes the next probe's parentId). CREATE a new label only when no candidate fits; on creation you may pass one "icon" from the curated taxonomy icon set for the deepest NEW label.
|
|
3135
3138
|
${buildVocabularySection(vocabulary)}
|
|
3136
3139
|
RULES:
|
|
3137
3140
|
- Return ONLY a single valid JSON object matching the exact schema above.
|
|
3138
3141
|
- No markdown code fences, no explanations, preamble, or postscript.
|
|
3139
|
-
- Never output undefined or null. "category"
|
|
3142
|
+
- Never output undefined or null. "category", "community", "topic", and "node" are always present; "icon" is omitted when it doesn't apply.
|
|
3140
3143
|
|
|
3141
3144
|
FINAL REMINDER:
|
|
3142
3145
|
- Output ONLY valid JSON matching the exact schema above. No markdown code fences, no explanations, preamble, or postscript.`
|
|
@@ -3541,7 +3544,7 @@ STORAGE MECHANICS \u2014 how your memory works (write for the retriever):
|
|
|
3541
3544
|
A category or community is NEVER a specific entity, product, company, or game title: "amd" is a subject under the category "stocks"; "stellar blade" is a subject under the category "games"; a show/work title like "breaking-bad" is a tag or hub, never a community. Always include category; reuse the existing labels whenever they fit.
|
|
3542
3545
|
- PERSONA & FICTION CONTENT (absolute): content about an adopted persona, a roleplay, or a fictional/entertainment work routes by its real-world MEDIUM, never by in-universe domains \u2014 a TV persona's biography, family, or career belongs under the medium family (category "shows", community "tv shows", hub the show's title or the persona name); never "family", "education", "business", or "science" for invented content.
|
|
3543
3546
|
|
|
3544
|
-
TAXONOMY PROBING (pick first, create if necessary): before naming a
|
|
3547
|
+
TAXONOMY PROBING (pick first, create if necessary): before naming a tier label you are not certain exists, call memory-taxonomy-probe top-down \u2014 cluster \u2192 community \u2192 hub \u2192 node \u2014 and ADOPT a returned candidate by naming it VERBATIM in the remember call (its id becomes the next probe's parentId). CREATE a new label only when every candidate misses the meaning \u2014 then follow the phrasing rules (plural family/sub-family, singular hub, singular node aspect) and optionally pass an "icon" from the curated set for the label you create. The known-vocabulary section below already lists likely fits; probing confirms them or finds better ones.
|
|
3545
3548
|
|
|
3546
3549
|
Do NOT store:
|
|
3547
3550
|
- Public facts merely fetched this turn that do not relate to the user (e.g. generic web results).
|
|
@@ -3674,7 +3677,7 @@ var TaxonomyPairVerdictSchema = z.object({
|
|
|
3674
3677
|
// src/prompts/memory/taxonomy-reconcile-prompt.constant.ts
|
|
3675
3678
|
var TAXONOMY_RECONCILE_INSTRUCTIONS = `TAXONOMY RECONCILIATION \u2014 one purpose: decide whether two EXISTING taxonomy labels of the same tier name the same concept and should merge into one.
|
|
3676
3679
|
|
|
3677
|
-
The macro-taxonomy, top-down: CLUSTER (plural family, e.g. "games") \u2192 COMMUNITY (plural sub-family, e.g. "survival-games") \u2192 HUB (singular subject entity, e.g. "project zomboid") \u2192 plus TAG labels (narrow recall vocabulary).
|
|
3680
|
+
The macro-taxonomy, top-down: CLUSTER (plural family, e.g. "games") \u2192 COMMUNITY (plural sub-family, e.g. "survival-games") \u2192 HUB (singular subject entity, e.g. "project zomboid") \u2192 NODE (singular aspect under the hub, e.g. "base building") \u2192 plus TAG labels (narrow recall vocabulary).
|
|
3678
3681
|
|
|
3679
3682
|
Merge ONLY wording variants of one concept: casing/formatting drift ("Video Games" / "video-games"), singular/plural drift inside a family tier ("survival game" / "survival-games"), abbreviation with identical expansion ("nlp" / "natural-language-processing").
|
|
3680
3683
|
NEVER merge: two entities that merely share a word ("apple" the company vs "apple" the fruit), a parent and its child ("games" vs "survival-games"), a broad tier and a specific entity ("games" vs "project zomboid"), or two genuinely different topics that happen to look similar. When in doubt, answer DISTINCT \u2014 a missed merge is cleaned up later; a wrong merge destroys both labels' meaning forever.`;
|
|
@@ -3714,31 +3717,35 @@ var ExtractedFactSchema = z.object({
|
|
|
3714
3717
|
*/
|
|
3715
3718
|
text: z.string(),
|
|
3716
3719
|
/**
|
|
3717
|
-
* The lowercase entity the fact is about
|
|
3718
|
-
*
|
|
3719
|
-
*
|
|
3720
|
-
* facts about the SAME subject.
|
|
3720
|
+
* The lowercase entity the fact is about — the chain's HUB tier:
|
|
3721
|
+
* singular, specific, stable. Maintenance adjudication only ever
|
|
3722
|
+
* compares facts about the SAME subject.
|
|
3721
3723
|
*/
|
|
3722
|
-
subject: z.string()
|
|
3724
|
+
subject: z.string(),
|
|
3725
|
+
/**
|
|
3726
|
+
* The lowercase singular ASPECT the fact addresses under its subject —
|
|
3727
|
+
* the chain's NODE tier (e.g. `base building` under `project zomboid`,
|
|
3728
|
+
* `ryzen 9950x3d` under `amd`). Names WHERE under the hub the fact is
|
|
3729
|
+
* filed; reuse the known vocabulary instead of minting near-variants.
|
|
3730
|
+
*/
|
|
3731
|
+
node: z.string(),
|
|
3723
3732
|
/**
|
|
3724
3733
|
* One broad lowercase PLURAL family label for THIS fact (e.g. `stocks`,
|
|
3725
|
-
* `pets`, `games`) — the
|
|
3726
|
-
* turn-side category when omitted. Never
|
|
3734
|
+
* `pets`, `games`) — the chain's CLUSTER tier. Never
|
|
3727
3735
|
* a specific entity, product, company, or game title. Persona/roleplay or
|
|
3728
3736
|
* fictional content classifies by its real-world medium (a TV persona's
|
|
3729
3737
|
* biography belongs under `shows`), never by in-universe domains (`family`,
|
|
3730
3738
|
* `education`, `business` describe reality, not an invented life).
|
|
3731
3739
|
*/
|
|
3732
|
-
category: z.string()
|
|
3740
|
+
category: z.string(),
|
|
3733
3741
|
/**
|
|
3734
3742
|
* One lowercase PLURAL sub-family label narrowing THIS fact's category
|
|
3735
3743
|
* (e.g. `survival-games` under `games`, `tv-shows` under `shows`) — the
|
|
3736
|
-
*
|
|
3737
|
-
*
|
|
3738
|
-
*
|
|
3739
|
-
* `breaking-bad` is a tag or hub, never a community.
|
|
3744
|
+
* chain's COMMUNITY tier, one level below the cluster. Never a specific
|
|
3745
|
+
* entity, product, or title — a show/work title like
|
|
3746
|
+
* `breaking-bad` is a hub or tag, never a community.
|
|
3740
3747
|
*/
|
|
3741
|
-
community: z.string()
|
|
3748
|
+
community: z.string(),
|
|
3742
3749
|
/** What kind of durable thing this is (see FACT_KINDS). */
|
|
3743
3750
|
kind: z.enum(FACT_KINDS),
|
|
3744
3751
|
/** Whether a newer statement is expected to replace this one (see FACT_STABILITIES). */
|
|
@@ -3776,10 +3783,11 @@ var ExtractionSchema = z.object({
|
|
|
3776
3783
|
* One lowercase PLURAL sub-family label narrowing the turn-side category
|
|
3777
3784
|
* (e.g. `survival-games` under `games`, `tv-shows` under `shows`) — the
|
|
3778
3785
|
* constellation's COMMUNITY tier: a genre, project family, or domain branch
|
|
3779
|
-
*
|
|
3780
|
-
*
|
|
3781
|
-
*
|
|
3782
|
-
*
|
|
3786
|
+
* One broad lowercase PLURAL sub-family label narrowing the turn-side
|
|
3787
|
+
* category (e.g. `survival-games` under `games`, `tv-shows` under
|
|
3788
|
+
* `shows`) — the COMMUNITY tier between the cluster and the hub.
|
|
3789
|
+
* Never a specific entity, product, or title — a show/work title like
|
|
3790
|
+
* `breaking-bad` is a hub or tag, never a community.
|
|
3783
3791
|
*/
|
|
3784
3792
|
community: z.string().optional()
|
|
3785
3793
|
});
|
|
@@ -3805,16 +3813,18 @@ ${sourceVoiceRules}
|
|
|
3805
3813
|
- Storage mechanics: each fact is embedded as a whole and matched sentence-by-sentence at recall time (multi-variant retrieval). One dense sentence is fine \u2014 put the subject up front ("The payments service runs PostgreSQL 16", not "It runs that version").
|
|
3806
3814
|
- Skip transient content: greetings, small talk, one-off instructions, filler \u2014 anything with no future recall value. When in doubt about whether a detail is durable, keep it: a durable detail is cheaper to store than to lose. When in doubt about whether a detail is SUBJECTIVE, drop it \u2014 the cognition tier captures preferences and profile data.
|
|
3807
3815
|
|
|
3808
|
-
FACT METADATA \u2014 every fact object carries the fields the maintenance passes (consolidate/reflect/conviction) interpret. Labels place the fact in the macro-taxonomy, top-down: CLUSTER \u2192 COMMUNITY \u2192 HUB \u2192 NODE, where the
|
|
3816
|
+
FACT METADATA \u2014 every fact object carries the fields the maintenance passes (consolidate/reflect/conviction) interpret. Labels place the fact in the macro-taxonomy, top-down: CLUSTER \u2192 COMMUNITY \u2192 HUB \u2192 NODE \u2192 LEAF, where the LEAF is the fact's text itself and every tier above it is a NAMED label that narrows where it is filed. The chain is strict: a fact is emitted with ALL FOUR labels or not at all.
|
|
3809
3817
|
- CLUSTER (category): a broad PLURAL family noun ("games", "stocks", "pets").
|
|
3810
3818
|
- COMMUNITY (community): a PLURAL sub-family under one cluster ("survival-games" under "games") \u2014 a genre or domain branch.
|
|
3811
3819
|
- HUB (subject): the SINGULAR main subject entity anchoring the fact ("project zomboid", "amd", "sam") \u2014 a specific name, never pluralized.
|
|
3820
|
+
- NODE (node): the SINGULAR aspect under the hub that the fact addresses ("base building" under "project zomboid", "ryzen 9950x3d" under "amd") \u2014 a specific sub-entity or topic branch, never pluralized, never a sentence.
|
|
3812
3821
|
PERSONA & FICTION CONTENT (absolute): facts about an adopted persona, a roleplay, or a fictional/entertainment work classify by the content's real-world MEDIUM, never by its in-universe domains. A TV persona's biography, family, career, or studies are NOT real-world walk-of-life categories \u2014 never "family", "education", "business", or "science" for invented content: the cluster is the medium family (e.g. "shows"), the community a true plural sub-family (e.g. "tv-shows"), and the show's title goes to the hub or the tags ("breaking bad"), never to the community.
|
|
3813
3822
|
Fields:
|
|
3814
3823
|
- text: the statement itself.
|
|
3815
|
-
- subject (
|
|
3816
|
-
-
|
|
3817
|
-
-
|
|
3824
|
+
- subject (required): the lowercase SINGULAR entity the fact is about \u2014 the HUB tier \u2014 a person, product, project, or the user's own name ("sam", "stellar blade", "payments service"). Maintenance only ever compares facts about the SAME subject, so name it whenever the fact is about a specific entity.
|
|
3825
|
+
- node (required): the lowercase SINGULAR aspect of the fact under its hub \u2014 the NODE tier \u2014 ("base building", "ryzen 9950x3d", "vocal range"). Reuse the known vocabulary rather than minting near-variants.
|
|
3826
|
+
- category (required): ONE broad lowercase PLURAL family label for this fact \u2014 the CLUSTER tier \u2014 reusing the known vocabulary.
|
|
3827
|
+
- community (required): ONE broad lowercase PLURAL sub-family narrowing the fact's category \u2014 the COMMUNITY tier, one level below the cluster (a genre, project family, or domain branch \u2014 "survival-games" under "games").
|
|
3818
3828
|
- kind (required): what kind of durable thing it is:
|
|
3819
3829
|
- preference \u2014 RESERVED, never emit: likes, dislikes, wants, and interests are subjective user data owned by the cognition tier (see ROUTING BOUNDARY)
|
|
3820
3830
|
- decision \u2014 a choice that was made (adoptions, migrations, purchases committed to)
|
|
@@ -3827,7 +3837,7 @@ Fields:
|
|
|
3827
3837
|
- stability (required): "durable" \u2014 a long-term truth that should survive until contradicted (decisions, traits, history) \u2014 or "volatile" \u2014 a current state a newer statement is EXPECTED to replace (location, tooling, versions). When in doubt, choose durable.
|
|
3828
3838
|
- Tags: 2 to 6 stable, reusable, lowercase topic labels describing what the text is about (e.g. "work", "rust", "contacts", "amd", "stellar blade"). Tags are NARROW and specific \u2014 entity names, product names, game titles. They are the vocabulary for topic-filtered recall later.
|
|
3829
3839
|
- Category: ONE broad lowercase PLURAL family noun for the whole text (e.g. "stocks", "pets", "games", "health") \u2014 the CLUSTER tier \u2014 that groups the narrow tags into one topic family. A category is NEVER a specific entity, product, company, or game title: "amd" belongs under "stocks"; "stellar blade" and "stellar blade blood rain" belong under "games". Persona/fictional content follows the PERSONA & FICTION rule above (medium family, not in-universe domains). Always include it when facts are emitted; omit it when nothing durable is found.
|
|
3830
|
-
- Community: ONE broad lowercase PLURAL sub-family that narrows the category (e.g. "survival-games", "action-rpgs" under "games"; "tv-shows" under "shows") \u2014 the COMMUNITY tier between the cluster and the hub.
|
|
3840
|
+
- Community: ONE broad lowercase PLURAL sub-family that narrows the category (e.g. "survival-games", "action-rpgs" under "games"; "tv-shows" under "shows") \u2014 the COMMUNITY tier between the cluster and the hub. Always include it when facts are emitted; never a specific entity, product, or title \u2014 a show/work title like "breaking-bad" is a tag or hub, never a community.
|
|
3831
3841
|
- If nothing durable is found, return an empty facts array; tags may still label the topic when useful.
|
|
3832
3842
|
${buildVocabularySection(vocabulary)}
|
|
3833
3843
|
PRIOR MEMORY (when the user message ends with an "ALREADY STORED IN MEMORY" section):
|
|
@@ -3851,7 +3861,7 @@ Error: ${error}
|
|
|
3851
3861
|
|
|
3852
3862
|
Return ONLY a single valid JSON object matching the extraction schema exactly:
|
|
3853
3863
|
${formatZodShape(ExtractionSchema)}
|
|
3854
|
-
All object keys must be quoted with double quotes. "subject"
|
|
3864
|
+
All object keys must be quoted with double quotes. Per fact, "subject", "node", "category", and "community" are required alongside "kind" and "stability".
|
|
3855
3865
|
Do not add markdown code fences, explanations, placeholders, or extra text.
|
|
3856
3866
|
|
|
3857
3867
|
FINAL REMINDER:
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -16,8 +16,9 @@ declare const NON_PAGE_EXTENSIONS: RegExp;
|
|
|
16
16
|
|
|
17
17
|
declare const EncyclopediaClassifySchema: z.ZodObject<{
|
|
18
18
|
category: z.ZodString;
|
|
19
|
-
community: z.
|
|
19
|
+
community: z.ZodString;
|
|
20
20
|
topic: z.ZodString;
|
|
21
|
+
node: z.ZodString;
|
|
21
22
|
icon: z.ZodOptional<z.ZodString>;
|
|
22
23
|
}, z.core.$strip>;
|
|
23
24
|
type EncyclopediaClassification = z.infer<typeof EncyclopediaClassifySchema>;
|
|
@@ -247,9 +248,10 @@ declare const FACT_KINDS: readonly ["preference", "decision", "state", "contact"
|
|
|
247
248
|
declare const FACT_STABILITIES: readonly ["durable", "volatile"];
|
|
248
249
|
declare const ExtractedFactSchema: z.ZodObject<{
|
|
249
250
|
text: z.ZodString;
|
|
250
|
-
subject: z.
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
subject: z.ZodString;
|
|
252
|
+
node: z.ZodString;
|
|
253
|
+
category: z.ZodString;
|
|
254
|
+
community: z.ZodString;
|
|
253
255
|
kind: z.ZodEnum<{
|
|
254
256
|
preference: "preference";
|
|
255
257
|
decision: "decision";
|
|
@@ -269,9 +271,10 @@ type ExtractedFact = z.infer<typeof ExtractedFactSchema>;
|
|
|
269
271
|
declare const ExtractionSchema: z.ZodObject<{
|
|
270
272
|
facts: z.ZodArray<z.ZodObject<{
|
|
271
273
|
text: z.ZodString;
|
|
272
|
-
subject: z.
|
|
273
|
-
|
|
274
|
-
|
|
274
|
+
subject: z.ZodString;
|
|
275
|
+
node: z.ZodString;
|
|
276
|
+
category: z.ZodString;
|
|
277
|
+
community: z.ZodString;
|
|
275
278
|
kind: z.ZodEnum<{
|
|
276
279
|
preference: "preference";
|
|
277
280
|
decision: "decision";
|
package/dist/schemas/index.mjs
CHANGED
|
@@ -78,14 +78,14 @@ var EncyclopediaClassifySchema = z.object({
|
|
|
78
78
|
*/
|
|
79
79
|
category: z.string(),
|
|
80
80
|
/**
|
|
81
|
-
* One lowercase PLURAL sub-family
|
|
81
|
+
* One lowercase PLURAL sub-family narrowing the category (e.g.
|
|
82
82
|
* `survival-games` under `games`, `tv-shows` under `shows`) — the
|
|
83
|
-
* constellation's COMMUNITY tier, one level below the cluster.
|
|
84
|
-
*
|
|
85
|
-
* company, or title — a show/work title like `breaking-bad` is a
|
|
86
|
-
*
|
|
83
|
+
* constellation's COMMUNITY tier, one level below the cluster. The chain
|
|
84
|
+
* is strict, so community is always present. Never a specific entity,
|
|
85
|
+
* product, company, or title — a show/work title like `breaking-bad` is a
|
|
86
|
+
* hub, never a community.
|
|
87
87
|
*/
|
|
88
|
-
community: z.string()
|
|
88
|
+
community: z.string(),
|
|
89
89
|
/**
|
|
90
90
|
* The narrow SINGULAR subject entity the document is about (e.g.
|
|
91
91
|
* `wuthering waves`, `q3 budget`) — the constellation's HUB tier. A short,
|
|
@@ -93,11 +93,13 @@ var EncyclopediaClassifySchema = z.object({
|
|
|
93
93
|
*/
|
|
94
94
|
topic: z.string(),
|
|
95
95
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
96
|
+
* The SINGULAR aspect of the document under its hub (e.g. `base building`
|
|
97
|
+
* under `project zomboid`, `department spend` under `q3 budget`) — the
|
|
98
|
+
* constellation's NODE tier, one level below the hub: a named sub-entity
|
|
99
|
+
* or topic branch the chunks file under. Reuse the known vocabulary
|
|
100
|
+
* instead of minting near-variants.
|
|
100
101
|
*/
|
|
102
|
+
node: z.string(),
|
|
101
103
|
icon: z.string().optional()
|
|
102
104
|
});
|
|
103
105
|
|
|
@@ -628,31 +630,35 @@ var ExtractedFactSchema = z.object({
|
|
|
628
630
|
*/
|
|
629
631
|
text: z.string(),
|
|
630
632
|
/**
|
|
631
|
-
* The lowercase entity the fact is about
|
|
632
|
-
*
|
|
633
|
-
*
|
|
634
|
-
* facts about the SAME subject.
|
|
633
|
+
* The lowercase entity the fact is about — the chain's HUB tier:
|
|
634
|
+
* singular, specific, stable. Maintenance adjudication only ever
|
|
635
|
+
* compares facts about the SAME subject.
|
|
635
636
|
*/
|
|
636
|
-
subject: z.string()
|
|
637
|
+
subject: z.string(),
|
|
638
|
+
/**
|
|
639
|
+
* The lowercase singular ASPECT the fact addresses under its subject —
|
|
640
|
+
* the chain's NODE tier (e.g. `base building` under `project zomboid`,
|
|
641
|
+
* `ryzen 9950x3d` under `amd`). Names WHERE under the hub the fact is
|
|
642
|
+
* filed; reuse the known vocabulary instead of minting near-variants.
|
|
643
|
+
*/
|
|
644
|
+
node: z.string(),
|
|
637
645
|
/**
|
|
638
646
|
* One broad lowercase PLURAL family label for THIS fact (e.g. `stocks`,
|
|
639
|
-
* `pets`, `games`) — the
|
|
640
|
-
* turn-side category when omitted. Never
|
|
647
|
+
* `pets`, `games`) — the chain's CLUSTER tier. Never
|
|
641
648
|
* a specific entity, product, company, or game title. Persona/roleplay or
|
|
642
649
|
* fictional content classifies by its real-world medium (a TV persona's
|
|
643
650
|
* biography belongs under `shows`), never by in-universe domains (`family`,
|
|
644
651
|
* `education`, `business` describe reality, not an invented life).
|
|
645
652
|
*/
|
|
646
|
-
category: z.string()
|
|
653
|
+
category: z.string(),
|
|
647
654
|
/**
|
|
648
655
|
* One lowercase PLURAL sub-family label narrowing THIS fact's category
|
|
649
656
|
* (e.g. `survival-games` under `games`, `tv-shows` under `shows`) — the
|
|
650
|
-
*
|
|
651
|
-
*
|
|
652
|
-
*
|
|
653
|
-
* `breaking-bad` is a tag or hub, never a community.
|
|
657
|
+
* chain's COMMUNITY tier, one level below the cluster. Never a specific
|
|
658
|
+
* entity, product, or title — a show/work title like
|
|
659
|
+
* `breaking-bad` is a hub or tag, never a community.
|
|
654
660
|
*/
|
|
655
|
-
community: z.string()
|
|
661
|
+
community: z.string(),
|
|
656
662
|
/** What kind of durable thing this is (see FACT_KINDS). */
|
|
657
663
|
kind: z.enum(FACT_KINDS),
|
|
658
664
|
/** Whether a newer statement is expected to replace this one (see FACT_STABILITIES). */
|
|
@@ -690,10 +696,11 @@ var ExtractionSchema = z.object({
|
|
|
690
696
|
* One lowercase PLURAL sub-family label narrowing the turn-side category
|
|
691
697
|
* (e.g. `survival-games` under `games`, `tv-shows` under `shows`) — the
|
|
692
698
|
* constellation's COMMUNITY tier: a genre, project family, or domain branch
|
|
693
|
-
*
|
|
694
|
-
*
|
|
695
|
-
*
|
|
696
|
-
*
|
|
699
|
+
* One broad lowercase PLURAL sub-family label narrowing the turn-side
|
|
700
|
+
* category (e.g. `survival-games` under `games`, `tv-shows` under
|
|
701
|
+
* `shows`) — the COMMUNITY tier between the cluster and the hub.
|
|
702
|
+
* Never a specific entity, product, or title — a show/work title like
|
|
703
|
+
* `breaking-bad` is a hub or tag, never a community.
|
|
697
704
|
*/
|
|
698
705
|
community: z.string().optional()
|
|
699
706
|
});
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -475,9 +475,10 @@ declare function createMemoryPartitionRecallTool(deps: MemoryPartitionRecallDeps
|
|
|
475
475
|
|
|
476
476
|
declare const memoryPartitionRememberSchema: z.ZodObject<{
|
|
477
477
|
text: z.ZodString;
|
|
478
|
-
category: z.
|
|
479
|
-
community: z.
|
|
480
|
-
subject: z.
|
|
478
|
+
category: z.ZodString;
|
|
479
|
+
community: z.ZodString;
|
|
480
|
+
subject: z.ZodString;
|
|
481
|
+
node: z.ZodString;
|
|
481
482
|
icon: z.ZodOptional<z.ZodString>;
|
|
482
483
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
483
484
|
}, z.core.$strip>;
|
|
@@ -492,9 +493,10 @@ interface MemoryPartitionRememberDeps {
|
|
|
492
493
|
requestId?: string;
|
|
493
494
|
text: string;
|
|
494
495
|
tags?: string[];
|
|
495
|
-
category
|
|
496
|
-
community
|
|
497
|
-
subject
|
|
496
|
+
category: string;
|
|
497
|
+
community: string;
|
|
498
|
+
subject: string;
|
|
499
|
+
node: string;
|
|
498
500
|
icon?: string;
|
|
499
501
|
}) => Promise<string>;
|
|
500
502
|
}
|
|
@@ -503,6 +505,7 @@ declare function createMemoryPartitionRememberTool(deps: MemoryPartitionRemember
|
|
|
503
505
|
declare const memoryTaxonomyProbeSchema: z.ZodObject<{
|
|
504
506
|
kind: z.ZodEnum<{
|
|
505
507
|
community: "community";
|
|
508
|
+
node: "node";
|
|
506
509
|
cluster: "cluster";
|
|
507
510
|
hub: "hub";
|
|
508
511
|
}>;
|
package/dist/tools/index.mjs
CHANGED
|
@@ -1154,15 +1154,18 @@ ${lines.join("\n")}`;
|
|
|
1154
1154
|
}
|
|
1155
1155
|
var memoryPartitionRememberSchema = z.object({
|
|
1156
1156
|
text: z.string().min(1).max(2e3).describe('The fact to remember, as a self-contained statement, e.g. "Sams phone number is 555-1234".'),
|
|
1157
|
-
category: z.string().min(1).max(40).
|
|
1157
|
+
category: z.string().min(1).max(40).describe(
|
|
1158
1158
|
'One broad lowercase PLURAL category the fact belongs to, e.g. "stocks", "games", "pets", "work" \u2014 the CLUSTER tier: a family noun, never a specific entity/product/company/game name ("amd" \u2192 "stocks"; "stellar blade" \u2192 "games"). Persona/roleplay or fictional content classifies by its real-world medium (a TV persona\u2019s biography \u2192 "shows"), never by in-universe domains ("family", "education", "business" describe reality, not an invented life). Always include it.'
|
|
1159
1159
|
),
|
|
1160
|
-
community: z.string().min(1).max(60).
|
|
1161
|
-
'One lowercase PLURAL sub-family narrowing the category, e.g. "survival games" under "games", "tv shows" under "shows" \u2014 the COMMUNITY tier, one level below the cluster (a genre, project family, or domain branch).
|
|
1160
|
+
community: z.string().min(1).max(60).describe(
|
|
1161
|
+
'One lowercase PLURAL sub-family narrowing the category, e.g. "survival games" under "games", "tv shows" under "shows" \u2014 the COMMUNITY tier, one level below the cluster (a genre, project family, or domain branch). Always present; never a specific entity, product, or title \u2014 a show/work title like "breaking-bad" is a hub, never a community.'
|
|
1162
1162
|
),
|
|
1163
|
-
subject: z.string().min(1).max(40).
|
|
1163
|
+
subject: z.string().min(1).max(40).describe(
|
|
1164
1164
|
'The lowercase SINGULAR entity the fact is about \u2014 the HUB tier, e.g. "project zomboid", "amd", "sam". Name it whenever the fact is about a specific entity; never a plural family label.'
|
|
1165
1165
|
),
|
|
1166
|
+
node: z.string().min(1).max(120).describe(
|
|
1167
|
+
'The lowercase SINGULAR aspect the fact addresses under its hub \u2014 the NODE tier, e.g. "base building" under "project zomboid", "ryzen 9950x3d" under "amd". Reuse existing labels whenever they fit; never pluralized, never a sentence.'
|
|
1168
|
+
),
|
|
1166
1169
|
icon: z.string().min(1).max(64).optional().describe(
|
|
1167
1170
|
'Lucide icon name for a label you are CREATING in this call (attached to the deepest NEW label: subject first, then community, then category). Only from the curated taxonomy icon set (e.g. "gamepad-2", "book-open", "paw-print"); omit entirely when you adopt existing labels or no icon fits.'
|
|
1168
1171
|
),
|
|
@@ -1172,9 +1175,9 @@ var memoryPartitionRememberSchema = z.object({
|
|
|
1172
1175
|
});
|
|
1173
1176
|
function createMemoryPartitionRememberTool(deps) {
|
|
1174
1177
|
return tool({
|
|
1175
|
-
description: 'Store into the user\'s fact partition (memory-partition) \u2014 OBJECTIVE facts only: notable external-world facts about subjects they care about (projects, followed stocks, games, people, past topics), objective details they state as fact (contact info, decisions, constraints, their setup), and objective facts they explicitly ask you to remember. You MUST NOT store subjective user data here \u2014 preferences, interests, likes/dislikes, behavioral traits, or internal states ("the user likes\u2026") belong to the cognition tier (memory-cognition-remember). Storing gathered knowledge is expected \u2014 do not wait for an explicit "remember" instruction. This memory outlives the conversation and is recalled later with memory-partition-recall. STORAGE MECHANICS: each record is embedded as a whole and matched sentence-by-sentence at recall time \u2014 write ONE self-contained statement per call (a single dense sentence is fine, subject up front), restating a record verbatim updates it in place, tags are the recall filter vocabulary (lowercase, reusable), and the macro-taxonomy routes each record
|
|
1178
|
+
description: 'Store into the user\'s fact partition (memory-partition) \u2014 OBJECTIVE facts only: notable external-world facts about subjects they care about (projects, followed stocks, games, people, past topics), objective details they state as fact (contact info, decisions, constraints, their setup), and objective facts they explicitly ask you to remember. You MUST NOT store subjective user data here \u2014 preferences, interests, likes/dislikes, behavioral traits, or internal states ("the user likes\u2026") belong to the cognition tier (memory-cognition-remember). Storing gathered knowledge is expected \u2014 do not wait for an explicit "remember" instruction. This memory outlives the conversation and is recalled later with memory-partition-recall. STORAGE MECHANICS: each record is embedded as a whole and matched sentence-by-sentence at recall time \u2014 write ONE self-contained statement per call (a single dense sentence is fine, subject up front), restating a record verbatim updates it in place, tags are the recall filter vocabulary (lowercase, reusable), and the macro-taxonomy routes each record down its strict chain: `category` one broad PLURAL family label (games, pets, work, health \u2026 \u2014 the cluster tier), `community` one PLURAL sub-family under it (survival games, action rpgs \u2026), `subject` the SINGULAR entity the fact is about (project zomboid, amd, sam \u2026 \u2014 the hub tier), `node` the SINGULAR aspect under the hub (base building, ryzen 9950x3d \u2026 \u2014 the node tier). ALL FOUR labels are always required; reuse existing labels whenever they fit.',
|
|
1176
1179
|
inputSchema: memoryPartitionRememberSchema,
|
|
1177
|
-
execute: async ({ text, tags, category, community, subject, icon }) => {
|
|
1180
|
+
execute: async ({ text, tags, category, community, subject, node, icon }) => {
|
|
1178
1181
|
try {
|
|
1179
1182
|
const id = await deps.storeRecord({
|
|
1180
1183
|
memoryPartition: deps.scope.memoryPartition,
|
|
@@ -1186,6 +1189,7 @@ function createMemoryPartitionRememberTool(deps) {
|
|
|
1186
1189
|
category,
|
|
1187
1190
|
community,
|
|
1188
1191
|
subject,
|
|
1192
|
+
node,
|
|
1189
1193
|
icon
|
|
1190
1194
|
});
|
|
1191
1195
|
return { stored: true, id };
|
|
@@ -1199,14 +1203,14 @@ function createMemoryPartitionRememberTool(deps) {
|
|
|
1199
1203
|
});
|
|
1200
1204
|
}
|
|
1201
1205
|
var memoryTaxonomyProbeSchema = z.object({
|
|
1202
|
-
kind: z.enum(["cluster", "community", "hub"]).describe(
|
|
1203
|
-
"Which tier to probe. Top-down order: cluster (PLURAL family noun) \u2192 community (PLURAL sub-family under one cluster) \u2192 hub (SINGULAR main subject entity)."
|
|
1206
|
+
kind: z.enum(["cluster", "community", "hub", "node"]).describe(
|
|
1207
|
+
"Which tier to probe. Top-down order: cluster (PLURAL family noun) \u2192 community (PLURAL sub-family under one cluster) \u2192 hub (SINGULAR main subject entity) \u2192 node (SINGULAR aspect under the hub)."
|
|
1204
1208
|
),
|
|
1205
1209
|
query: z.string().min(1).max(120).describe(
|
|
1206
1210
|
'The label you are considering (e.g. "games", "survival games", "project zomboid") \u2014 scored against the existing taxonomy by name similarity and meaning.'
|
|
1207
1211
|
),
|
|
1208
1212
|
parentId: z.string().optional().describe(
|
|
1209
|
-
"The adopted
|
|
1213
|
+
"The adopted label id from the tier ABOVE (community probes pass the adopted cluster id; hub probes the adopted community id; node probes the adopted hub id). Narrows the candidacy to that parent; omit only when you are about to CREATE the parent."
|
|
1210
1214
|
)
|
|
1211
1215
|
});
|
|
1212
1216
|
function createMemoryTaxonomyProbeTool(deps) {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@triplef/agent",
|
|
3
3
|
"description": "tripleF (3F) agent domain — structured-output schemas, prompt builders, and model tools shared across the apps.",
|
|
4
|
-
"version": "1.0.
|
|
5
|
-
"packageManager": "pnpm@12.
|
|
4
|
+
"version": "1.0.4",
|
|
5
|
+
"packageManager": "pnpm@12.14.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"exports": {
|
|
@@ -56,12 +56,12 @@
|
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@mozilla/readability": "^0.6.0",
|
|
58
58
|
"@triplef/helpers": "^1.6.1",
|
|
59
|
-
"linkedom": "^0.18.
|
|
59
|
+
"linkedom": "^0.18.14",
|
|
60
60
|
"turndown": "^7.2.4"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"ai": "^7.0.
|
|
64
|
-
"zod": "^4.6.
|
|
63
|
+
"ai": "^7.0.148",
|
|
64
|
+
"zod": "^4.6.7"
|
|
65
65
|
},
|
|
66
66
|
"peerDependenciesMeta": {
|
|
67
67
|
"ai": {
|
|
@@ -74,25 +74,25 @@
|
|
|
74
74
|
"@types/eslint": "^9.6.1",
|
|
75
75
|
"@types/node": "^26.6.5",
|
|
76
76
|
"@types/turndown": "^5.0.6",
|
|
77
|
-
"@vitest/coverage-v8": "5.0.
|
|
77
|
+
"@vitest/coverage-v8": "5.0.5",
|
|
78
78
|
"depcheck": "^1.4.7",
|
|
79
|
-
"dependency-cruiser": "^18.
|
|
80
|
-
"eslint": "^10.
|
|
79
|
+
"dependency-cruiser": "^18.7.0",
|
|
80
|
+
"eslint": "^10.13.0",
|
|
81
81
|
"eslint-config-prettier": "^10.1.8",
|
|
82
|
-
"eslint-plugin-prettier": "^5.5.
|
|
82
|
+
"eslint-plugin-prettier": "^5.5.7",
|
|
83
83
|
"eslint-plugin-simple-import-sort": "^14.0.0",
|
|
84
84
|
"eslint-plugin-sonarjs": "^4.2.2",
|
|
85
85
|
"globals": "^17.13.0",
|
|
86
86
|
"husky": "^9.1.7",
|
|
87
87
|
"jiti": "^2.7.0",
|
|
88
88
|
"lint-staged": "^17.6.0",
|
|
89
|
-
"npm-check-updates": "^23.1.
|
|
89
|
+
"npm-check-updates": "^23.1.1",
|
|
90
90
|
"prettier": "^3.9.10",
|
|
91
91
|
"rimraf": "^6.1.3",
|
|
92
92
|
"ts-unused-exports": "^11.0.1",
|
|
93
93
|
"tsup": "^8.5.1",
|
|
94
94
|
"typescript": "^5.9.3",
|
|
95
|
-
"typescript-eslint": "^8.
|
|
96
|
-
"vitest": "^5.0.
|
|
95
|
+
"typescript-eslint": "^8.72.0",
|
|
96
|
+
"vitest": "^5.0.5"
|
|
97
97
|
}
|
|
98
98
|
}
|