@xfabric/memory 0.2.14 → 0.2.15
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/flush/prompts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,eAAO,MAAM,2BAA2B,
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/flush/prompts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,eAAO,MAAM,2BAA2B,QA4BhC,CAAC;AAET;;;GAGG;AACH,eAAO,MAAM,kCAAkC,QAmCvC,CAAC;AAET;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKtD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAe/D;AASD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE;IACxC,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,GAAG;IACF,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB,CAaA;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAM/C"}
|
package/dist/flush/prompts.js
CHANGED
|
@@ -10,17 +10,29 @@ import { SILENT_REPLY_TOKEN } from "../types.js";
|
|
|
10
10
|
export const DEFAULT_MEMORY_FLUSH_PROMPT = `
|
|
11
11
|
Pre-compaction memory flush.
|
|
12
12
|
|
|
13
|
-
Analyze the conversation history
|
|
14
|
-
- User preferences, settings, and stated requirements
|
|
15
|
-
- Key decisions made during the session
|
|
16
|
-
- Important facts learned about the project, codebase, or domain
|
|
17
|
-
- TODOs, action items, and pending tasks
|
|
18
|
-
- Context that would be useful in future sessions
|
|
19
|
-
- Technical choices and their rationale
|
|
13
|
+
Analyze the conversation history and extract important information to these categories:
|
|
20
14
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
**User Profile** (memory/user-profile.md)
|
|
16
|
+
- Who is this user? Name, role, expertise, company
|
|
17
|
+
- Communication style, how they like to work
|
|
18
|
+
|
|
19
|
+
**User Preferences** (memory/preferences.md)
|
|
20
|
+
- Stated preferences, coding style, tool choices
|
|
21
|
+
- Likes/dislikes, requirements
|
|
22
|
+
|
|
23
|
+
**Current Projects** (memory/projects.md)
|
|
24
|
+
- What are we building? Project name, description, goals
|
|
25
|
+
- Tech stack, architecture decisions
|
|
26
|
+
|
|
27
|
+
**Key Decisions** (memory/decisions.md)
|
|
28
|
+
- Technical decisions made and their rationale
|
|
29
|
+
- Architecture choices, trade-offs discussed
|
|
30
|
+
|
|
31
|
+
**TODOs** (memory/todos.md)
|
|
32
|
+
- Pending tasks, action items, follow-ups
|
|
33
|
+
|
|
34
|
+
Write extracted memories using the memory_write tool with the appropriate filename.
|
|
35
|
+
Format as markdown with clear headings. Each entry should be self-contained.
|
|
24
36
|
|
|
25
37
|
If nothing important needs to be saved, reply with ${SILENT_REPLY_TOKEN}.
|
|
26
38
|
`.trim();
|
|
@@ -29,31 +41,38 @@ If nothing important needs to be saved, reply with ${SILENT_REPLY_TOKEN}.
|
|
|
29
41
|
* This sets up the LLM's role and behavior
|
|
30
42
|
*/
|
|
31
43
|
export const DEFAULT_MEMORY_FLUSH_SYSTEM_PROMPT = `
|
|
32
|
-
You are a memory extraction agent.
|
|
33
|
-
|
|
44
|
+
You are a memory extraction agent. Your job is to persist durable memories before session context is lost.
|
|
45
|
+
|
|
46
|
+
IMPORTANT: Extract information that answers these questions:
|
|
47
|
+
- "Who is the user?" → save to user-profile.md
|
|
48
|
+
- "What are we building?" → save to projects.md
|
|
49
|
+
- "What does the user prefer?" → save to preferences.md
|
|
50
|
+
- "What decisions were made?" → save to decisions.md
|
|
51
|
+
- "What needs to be done?" → save to todos.md
|
|
34
52
|
|
|
35
53
|
Guidelines:
|
|
36
|
-
-
|
|
37
|
-
-
|
|
54
|
+
- Use clear, searchable language (memories are vector-indexed for semantic search)
|
|
55
|
+
- Write in third person: "The user prefers..." not "You prefer..."
|
|
38
56
|
- Include enough context for each memory to be understood standalone
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
- Skip tool outputs and code that already exists in files
|
|
42
|
-
- Prioritize: user preferences > decisions > facts > context
|
|
57
|
+
- Skip ephemeral information (code outputs, temporary debugging)
|
|
58
|
+
- Prioritize: user identity > projects > preferences > decisions
|
|
43
59
|
|
|
44
|
-
Format
|
|
45
|
-
## [Topic
|
|
46
|
-
|
|
60
|
+
Format each file as:
|
|
61
|
+
## [Topic]
|
|
62
|
+
- Bullet points with clear, searchable content
|
|
47
63
|
|
|
48
|
-
Example:
|
|
49
|
-
## User
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
64
|
+
Example for user-profile.md:
|
|
65
|
+
## User Profile
|
|
66
|
+
- Name: John (mentioned in conversation)
|
|
67
|
+
- Role: Full-stack developer
|
|
68
|
+
- Expertise: React, TypeScript
|
|
69
|
+
- Works on: E-commerce projects
|
|
53
70
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
-
|
|
71
|
+
Example for projects.md:
|
|
72
|
+
## Current Project: F1 Dashboard
|
|
73
|
+
- Building a Formula 1 race tracking dashboard
|
|
74
|
+
- Tech stack: React, Vite, Tailwind CSS
|
|
75
|
+
- Features: Live timing, driver standings, race calendar
|
|
57
76
|
|
|
58
77
|
If no important memories need saving, reply with ${SILENT_REPLY_TOKEN}.
|
|
59
78
|
`.trim();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/flush/prompts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBA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