om-memory-system 4.15.0-next.116 → 4.17.0-next.124
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/core/retrieval.js
CHANGED
|
@@ -48,6 +48,7 @@ export async function buildRecentMemoriesSection(options) {
|
|
|
48
48
|
return null;
|
|
49
49
|
const projectMemories = {
|
|
50
50
|
results: memories.map((m) => ({
|
|
51
|
+
id: m.id,
|
|
51
52
|
similarity: 1.0,
|
|
52
53
|
memory: m.summary,
|
|
53
54
|
})),
|
|
@@ -105,7 +106,7 @@ export function formatMemoriesForCompaction(memories, budget) {
|
|
|
105
106
|
const body = tags.length > 0 ? stripMatchingEmbeddedTagsFooter(m.memory ?? "", tags) : (m.memory ?? "");
|
|
106
107
|
const tagsFooter = tags.length > 0 ? `Tags: ${tags.join(", ")}\n\n` : "";
|
|
107
108
|
return {
|
|
108
|
-
prefix: `### Memory ${i + 1}\n`,
|
|
109
|
+
prefix: m.id ? `### Memory ${i + 1} (${m.id})\n` : `### Memory ${i + 1}\n`,
|
|
109
110
|
body,
|
|
110
111
|
suffix: `\n\n${tagsFooter}`,
|
|
111
112
|
};
|
|
@@ -84,6 +84,8 @@ function isSqliteFile(path) {
|
|
|
84
84
|
export function defaultClaudeSourcePath(claudeConfigDir) {
|
|
85
85
|
return claudeProjectsRoot(claudeConfigDir);
|
|
86
86
|
}
|
|
87
|
+
// One of about 29 host-name branches outside src/adapters/. A host registry would replace
|
|
88
|
+
// them. Read "Host parity" in AGENTS.md before you add a fourth host.
|
|
87
89
|
export function defaultImportSourcePath(host, claudeConfigDir) {
|
|
88
90
|
if (host === "pi")
|
|
89
91
|
return DEFAULT_PI_SESSION_ROOT;
|
package/dist/services/context.js
CHANGED
|
@@ -36,8 +36,10 @@ export async function formatContextForPrompt(userId, projectMemories, budget) {
|
|
|
36
36
|
entries: projectResults.map((mem) => {
|
|
37
37
|
const similarity = Math.round(mem.similarity * 100);
|
|
38
38
|
const content = mem.memory || mem.chunk || "";
|
|
39
|
+
// The id lets the agent pass a recalled memory to `forget` with no search first.
|
|
40
|
+
const id = mem.id ? `id="${mem.id}" ` : "";
|
|
39
41
|
return {
|
|
40
|
-
prefix: `<memory relevance="${similarity}%">\n`,
|
|
42
|
+
prefix: `<memory ${id}relevance="${similarity}%">\n`,
|
|
41
43
|
body: content,
|
|
42
44
|
suffix: "\n</memory>",
|
|
43
45
|
};
|
package/package.json
CHANGED
|
@@ -9,8 +9,17 @@ OMMS keeps memories for each project: earlier fixes, decisions, and conventions.
|
|
|
9
9
|
|
|
10
10
|
## How to call OMMS
|
|
11
11
|
|
|
12
|
-
- If your tool list has a `memory` tool
|
|
13
|
-
- If
|
|
12
|
+
- If your tool list has a `memory` tool, use it. Pi and OpenCode call it `memory`. Claude Code with the OMMS plugin calls it `mcp__omms__memory`.
|
|
13
|
+
- If no `memory` tool is listed, run the `om-memory-system memory` command with the Bash tool from the project directory. Each command prints one JSON document. A result with `"success": false` has an `error` field.
|
|
14
|
+
|
|
15
|
+
## Using OMMS in Claude Code
|
|
16
|
+
|
|
17
|
+
- Recall arrives as added context. The user sees it as `▸ ● memory [mode=…]` rows at the top of your reply. The context holds the closest matches only.
|
|
18
|
+
- When `mcp__omms__memory` is listed, call it. Do not run the command through Bash.
|
|
19
|
+
- The tool refuses the `import`, `export`, `migrate` and `list-shards` modes. Tell the user to run them with `om-memory-system memory` in a terminal.
|
|
20
|
+
- With hand-written hooks or an older plugin, no `memory` tool is listed. Then run `om-memory-system memory` through Bash.
|
|
21
|
+
- Each injected memory shows its id. When the user asks you to remove that memory, pass the id to `forget`.
|
|
22
|
+
- Capture runs after each reply in the background. Do not save the same turn again, unless it holds a decision, a fix or a preference that the user asked you to keep.
|
|
14
23
|
|
|
15
24
|
## When to search
|
|
16
25
|
|