@bamdra/bamdra-openclaw-memory 0.3.0
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/README.md +32 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1960 -0
- package/dist/index.js.map +1 -0
- package/dist/openclaw.plugin.json +29 -0
- package/dist/package.json +65 -0
- package/dist/schema.sql +108 -0
- package/openclaw.plugin.json +25 -0
- package/package.json +65 -0
- package/skills/bamdra-memory-operator/SKILL.md +84 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AA4DA,4BAEC;AAED,4BAEC;AAlED,kGAGyD;AAUzD,MAAM,SAAS,GAAG,wBAAwB,CAAC;AAC3C,MAAM,iBAAiB,GAAG,2CAA2C,CAAC;AACtE,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;AAC1E,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;AAEpF,SAAS,qBAAqB,CAAC,KAAa,EAAE,UAAmC,EAAE;IACjF,IAAI,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IAClE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;AACH,CAAC;AAoCD,SAAgB,QAAQ,CAAC,GAAqB;IAC5C,uBAAuB,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AAC3C,CAAC;AAEM,KAAK,UAAU,QAAQ,CAAC,GAAqB;IAClD,uBAAuB,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,uBAAuB,CAAC,GAAqB,E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,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACrE,IAAI;QACJ,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,UAAU,EAAE,UAAU,CAAC,UAAU;QACjC,KAAK,CAAC,OAAO,CAAC,YAAoB,EAAE,MAAe;YACjD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAChD,qBAAqB,CAAC,cAAc,EAAE;gBACpC,IAAI;gBACJ,YAAY;gBACZ,SAAS,EACP,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,WAAW,IAAK,MAAkC;oBACxF,CAAC,CAAE,MAAkC,CAAC,SAAS;oBAC/C,CAAC,CAAC,IAAI;aACX,CAAC,CAAC;YACH,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC;KACF,CAAC,CAAC,CAAC;AACN,CAAC;AAED,SAAS,YAAY,CACnB,KAAc;IAEd,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;aACzE;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "bamdra-openclaw-memory",
|
|
3
|
+
"type": "context-engine",
|
|
4
|
+
"kind": "memory",
|
|
5
|
+
"slot": "memory",
|
|
6
|
+
"capabilities": [
|
|
7
|
+
"memory"
|
|
8
|
+
],
|
|
9
|
+
"skills": [
|
|
10
|
+
"./skills"
|
|
11
|
+
],
|
|
12
|
+
"name": "Bamdra OpenClaw Memory",
|
|
13
|
+
"description": "Unified topic-aware memory plugin for OpenClaw",
|
|
14
|
+
"version": "0.3.0",
|
|
15
|
+
"main": "./index.js",
|
|
16
|
+
"configSchema": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"additionalProperties": true
|
|
19
|
+
},
|
|
20
|
+
"uiHints": {
|
|
21
|
+
"enabled": {
|
|
22
|
+
"label": "Enable Bamdra Memory"
|
|
23
|
+
},
|
|
24
|
+
"store.path": {
|
|
25
|
+
"label": "SQLite Path",
|
|
26
|
+
"placeholder": "~/.openclaw/memory/main.sqlite"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bamdra/bamdra-openclaw-memory",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Unified topic-aware memory plugin for OpenClaw with durable SQLite recall and bounded context growth.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://www.bamdra.com",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/bamdra/openclaw-topic-memory.git",
|
|
10
|
+
"directory": "bamdra-memory/plugins/bamdra-memory"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/bamdra/openclaw-topic-memory/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "commonjs",
|
|
16
|
+
"main": "./index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"openclaw.plugin.json",
|
|
21
|
+
"README.md",
|
|
22
|
+
"skills"
|
|
23
|
+
],
|
|
24
|
+
"keywords": [
|
|
25
|
+
"openclaw",
|
|
26
|
+
"openclaw-plugin",
|
|
27
|
+
"memory",
|
|
28
|
+
"topic-memory",
|
|
29
|
+
"sqlite",
|
|
30
|
+
"ai-agent"
|
|
31
|
+
],
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=22"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"bundle": "node ../../scripts/run-local-bin.mjs tsup && cp ../../packages/memory-sqlite/src/schema.sql ./dist/ && node ../../scripts/prepare-plugin-dist.mjs bamdra-openclaw-memory",
|
|
37
|
+
"prepublishOnly": "pnpm run bundle"
|
|
38
|
+
},
|
|
39
|
+
"openclaw": {
|
|
40
|
+
"id": "bamdra-openclaw-memory",
|
|
41
|
+
"type": "context-engine",
|
|
42
|
+
"slot": "memory",
|
|
43
|
+
"capabilities": [
|
|
44
|
+
"memory"
|
|
45
|
+
],
|
|
46
|
+
"manifest": "./openclaw.plugin.json",
|
|
47
|
+
"extensions": [
|
|
48
|
+
"./index.js"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public"
|
|
53
|
+
},
|
|
54
|
+
"exports": {
|
|
55
|
+
".": {
|
|
56
|
+
"require": "./dist/index.js",
|
|
57
|
+
"types": "./dist/index.d.ts",
|
|
58
|
+
"default": "./dist/index.js"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@types/node": "^24.5.2"
|
|
64
|
+
}
|
|
65
|
+
}
|
package/dist/schema.sql
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
PRAGMA journal_mode = WAL;
|
|
2
|
+
PRAGMA foreign_keys = ON;
|
|
3
|
+
|
|
4
|
+
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
5
|
+
version INTEGER PRIMARY KEY,
|
|
6
|
+
applied_at TEXT NOT NULL
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
CREATE TABLE IF NOT EXISTS messages (
|
|
10
|
+
id TEXT PRIMARY KEY,
|
|
11
|
+
session_id TEXT NOT NULL,
|
|
12
|
+
turn_id TEXT NOT NULL,
|
|
13
|
+
parent_turn_id TEXT,
|
|
14
|
+
role TEXT NOT NULL,
|
|
15
|
+
event_type TEXT NOT NULL,
|
|
16
|
+
text TEXT NOT NULL,
|
|
17
|
+
ts TEXT NOT NULL,
|
|
18
|
+
raw_json TEXT NOT NULL
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
CREATE INDEX IF NOT EXISTS idx_messages_session_ts
|
|
22
|
+
ON messages (session_id, ts);
|
|
23
|
+
|
|
24
|
+
CREATE TABLE IF NOT EXISTS topics (
|
|
25
|
+
id TEXT PRIMARY KEY,
|
|
26
|
+
session_id TEXT NOT NULL,
|
|
27
|
+
title TEXT NOT NULL,
|
|
28
|
+
status TEXT NOT NULL,
|
|
29
|
+
parent_topic_id TEXT,
|
|
30
|
+
summary_short TEXT NOT NULL DEFAULT '',
|
|
31
|
+
summary_long TEXT NOT NULL DEFAULT '',
|
|
32
|
+
open_loops_json TEXT NOT NULL DEFAULT '[]',
|
|
33
|
+
labels_json TEXT NOT NULL DEFAULT '[]',
|
|
34
|
+
created_at TEXT NOT NULL,
|
|
35
|
+
last_active_at TEXT NOT NULL
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
CREATE INDEX IF NOT EXISTS idx_topics_session_last_active
|
|
39
|
+
ON topics (session_id, last_active_at DESC);
|
|
40
|
+
|
|
41
|
+
CREATE TABLE IF NOT EXISTS topic_membership (
|
|
42
|
+
message_id TEXT NOT NULL,
|
|
43
|
+
topic_id TEXT NOT NULL,
|
|
44
|
+
score REAL NOT NULL,
|
|
45
|
+
is_primary INTEGER NOT NULL,
|
|
46
|
+
reason TEXT NOT NULL,
|
|
47
|
+
created_at TEXT NOT NULL,
|
|
48
|
+
PRIMARY KEY (message_id, topic_id),
|
|
49
|
+
FOREIGN KEY (message_id) REFERENCES messages(id) ON DELETE CASCADE,
|
|
50
|
+
FOREIGN KEY (topic_id) REFERENCES topics(id) ON DELETE CASCADE
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
CREATE INDEX IF NOT EXISTS idx_topic_membership_topic
|
|
54
|
+
ON topic_membership (topic_id, created_at);
|
|
55
|
+
|
|
56
|
+
CREATE TABLE IF NOT EXISTS facts (
|
|
57
|
+
id TEXT PRIMARY KEY,
|
|
58
|
+
scope TEXT NOT NULL,
|
|
59
|
+
category TEXT NOT NULL,
|
|
60
|
+
key TEXT NOT NULL,
|
|
61
|
+
value TEXT NOT NULL,
|
|
62
|
+
sensitivity TEXT NOT NULL,
|
|
63
|
+
recall_policy TEXT NOT NULL,
|
|
64
|
+
confidence REAL NOT NULL,
|
|
65
|
+
source_message_id TEXT,
|
|
66
|
+
source_topic_id TEXT,
|
|
67
|
+
updated_at TEXT NOT NULL,
|
|
68
|
+
FOREIGN KEY (source_message_id) REFERENCES messages(id) ON DELETE SET NULL,
|
|
69
|
+
FOREIGN KEY (source_topic_id) REFERENCES topics(id) ON DELETE SET NULL
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_facts_scope_key
|
|
73
|
+
ON facts (scope, key);
|
|
74
|
+
|
|
75
|
+
CREATE TABLE IF NOT EXISTS fact_tags (
|
|
76
|
+
fact_id TEXT NOT NULL,
|
|
77
|
+
tag TEXT NOT NULL,
|
|
78
|
+
PRIMARY KEY (fact_id, tag),
|
|
79
|
+
FOREIGN KEY (fact_id) REFERENCES facts(id) ON DELETE CASCADE
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
CREATE INDEX IF NOT EXISTS idx_fact_tags_tag
|
|
83
|
+
ON fact_tags (tag);
|
|
84
|
+
|
|
85
|
+
CREATE TABLE IF NOT EXISTS context_snapshots (
|
|
86
|
+
id TEXT PRIMARY KEY,
|
|
87
|
+
session_id TEXT NOT NULL,
|
|
88
|
+
topic_id TEXT,
|
|
89
|
+
kind TEXT NOT NULL,
|
|
90
|
+
content TEXT NOT NULL,
|
|
91
|
+
created_at TEXT NOT NULL,
|
|
92
|
+
FOREIGN KEY (topic_id) REFERENCES topics(id) ON DELETE SET NULL
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
CREATE INDEX IF NOT EXISTS idx_context_snapshots_session_kind
|
|
96
|
+
ON context_snapshots (session_id, kind, created_at DESC);
|
|
97
|
+
|
|
98
|
+
CREATE TABLE IF NOT EXISTS session_state (
|
|
99
|
+
session_id TEXT PRIMARY KEY,
|
|
100
|
+
active_topic_id TEXT,
|
|
101
|
+
last_compacted_at TEXT,
|
|
102
|
+
last_turn_id TEXT,
|
|
103
|
+
updated_at TEXT NOT NULL,
|
|
104
|
+
FOREIGN KEY (active_topic_id) REFERENCES topics(id) ON DELETE SET NULL
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
INSERT OR IGNORE INTO schema_migrations (version, applied_at)
|
|
108
|
+
VALUES (1, CURRENT_TIMESTAMP);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "bamdra-openclaw-memory",
|
|
3
|
+
"type": "context-engine",
|
|
4
|
+
"kind": "memory",
|
|
5
|
+
"slot": "memory",
|
|
6
|
+
"capabilities": ["memory"],
|
|
7
|
+
"skills": ["./skills"],
|
|
8
|
+
"name": "Bamdra OpenClaw Memory",
|
|
9
|
+
"description": "Unified topic-aware memory plugin for OpenClaw",
|
|
10
|
+
"version": "0.3.0",
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"configSchema": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"additionalProperties": true
|
|
15
|
+
},
|
|
16
|
+
"uiHints": {
|
|
17
|
+
"enabled": {
|
|
18
|
+
"label": "Enable Bamdra Memory"
|
|
19
|
+
},
|
|
20
|
+
"store.path": {
|
|
21
|
+
"label": "SQLite Path",
|
|
22
|
+
"placeholder": "~/.openclaw/memory/main.sqlite"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bamdra/bamdra-openclaw-memory",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Unified topic-aware memory plugin for OpenClaw with durable SQLite recall and bounded context growth.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://www.bamdra.com",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/bamdra/openclaw-topic-memory.git",
|
|
10
|
+
"directory": "bamdra-memory/plugins/bamdra-memory"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/bamdra/openclaw-topic-memory/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "commonjs",
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"openclaw.plugin.json",
|
|
21
|
+
"README.md",
|
|
22
|
+
"skills"
|
|
23
|
+
],
|
|
24
|
+
"keywords": [
|
|
25
|
+
"openclaw",
|
|
26
|
+
"openclaw-plugin",
|
|
27
|
+
"memory",
|
|
28
|
+
"topic-memory",
|
|
29
|
+
"sqlite",
|
|
30
|
+
"ai-agent"
|
|
31
|
+
],
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=22"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"bundle": "node ../../scripts/run-local-bin.mjs tsup && cp ../../packages/memory-sqlite/src/schema.sql ./dist/ && node ../../scripts/prepare-plugin-dist.mjs bamdra-openclaw-memory",
|
|
37
|
+
"prepublishOnly": "pnpm run bundle"
|
|
38
|
+
},
|
|
39
|
+
"openclaw": {
|
|
40
|
+
"id": "bamdra-openclaw-memory",
|
|
41
|
+
"type": "context-engine",
|
|
42
|
+
"slot": "memory",
|
|
43
|
+
"capabilities": [
|
|
44
|
+
"memory"
|
|
45
|
+
],
|
|
46
|
+
"manifest": "./openclaw.plugin.json",
|
|
47
|
+
"extensions": [
|
|
48
|
+
"./dist/index.js"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public"
|
|
53
|
+
},
|
|
54
|
+
"exports": {
|
|
55
|
+
".": {
|
|
56
|
+
"require": "./dist/index.js",
|
|
57
|
+
"types": "./dist/index.d.ts",
|
|
58
|
+
"default": "./dist/index.js"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@types/node": "^24.5.2"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bamdra-memory-operator
|
|
3
|
+
description: Use bamdra-memory so OpenClaw can remember important facts, switch back to earlier topics, and avoid making users repeat themselves.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Bamdra Memory Operator
|
|
7
|
+
|
|
8
|
+
Use `bamdra-memory` tools to preserve continuity without making the conversation feel mechanical.
|
|
9
|
+
|
|
10
|
+
This skill is an optional behavior layer. It improves tool judgment, but the runtime memory chain must still be provided by the plugin itself.
|
|
11
|
+
|
|
12
|
+
## Operating Goal
|
|
13
|
+
|
|
14
|
+
Make memory feel natural:
|
|
15
|
+
|
|
16
|
+
- keep stable facts available across topic drift
|
|
17
|
+
- let different threads stay separated unless the user reconnects them
|
|
18
|
+
- recover prior context quietly when it helps
|
|
19
|
+
- avoid leaking unrelated memory into the current answer
|
|
20
|
+
- avoid narrating internal storage mechanics unless the user asks
|
|
21
|
+
|
|
22
|
+
## Decision Policy
|
|
23
|
+
|
|
24
|
+
Use semantic judgment first. Treat examples in this file as signals, not as a complete phrase list.
|
|
25
|
+
|
|
26
|
+
Prefer memory tools when one of these is true:
|
|
27
|
+
|
|
28
|
+
- the user explicitly asks to remember something
|
|
29
|
+
- the detail is a stable preference, identity fact, project constraint, path, account reference, environment invariant, or durable decision
|
|
30
|
+
- the conversation appears to return to an older thread
|
|
31
|
+
- the conversation appears to branch into a new thread
|
|
32
|
+
- the answer may already exist in memory
|
|
33
|
+
- the user explicitly asks to keep topics separate, resume an older branch, or start fresh
|
|
34
|
+
|
|
35
|
+
Do not reach for memory tools when one of these is true:
|
|
36
|
+
|
|
37
|
+
- the detail is transient and only matters for the current turn
|
|
38
|
+
- the user is casually brainstorming and has not signaled that a detail should persist
|
|
39
|
+
- using a tool would add noise without improving continuity or accuracy
|
|
40
|
+
- the request would cross agent or user boundaries that should remain isolated
|
|
41
|
+
|
|
42
|
+
## Topic Judgment
|
|
43
|
+
|
|
44
|
+
Treat topic handling as a judgment task, not a keyword trigger.
|
|
45
|
+
|
|
46
|
+
Strong signals for a new topic:
|
|
47
|
+
|
|
48
|
+
- the user explicitly says this is a new topic, wants to start over, or says earlier threads should not interfere
|
|
49
|
+
- the semantic center clearly shifts away from the active thread
|
|
50
|
+
- the user introduces a new task domain that should remain isolated from the current branch
|
|
51
|
+
|
|
52
|
+
Strong signals for returning to an old topic:
|
|
53
|
+
|
|
54
|
+
- the user references a prior subject, entity, plan, or unresolved thread
|
|
55
|
+
- the user asks to continue, resume, go back, or revisit something discussed earlier
|
|
56
|
+
- the best answer depends on facts likely stored under an older branch
|
|
57
|
+
|
|
58
|
+
When uncertain:
|
|
59
|
+
|
|
60
|
+
- prefer quiet recovery over long explanations
|
|
61
|
+
- prefer searching memory before asking the user to repeat themselves
|
|
62
|
+
- prefer keeping the current topic if there is no meaningful benefit from switching
|
|
63
|
+
|
|
64
|
+
## Tool Selection
|
|
65
|
+
|
|
66
|
+
- Use `memory_save_fact` or `bamdra_memory_save_fact` for stable facts the user is likely to expect later.
|
|
67
|
+
- Use `memory_search` or `bamdra_memory_search` before asking the user to restate a stable fact or prior decision.
|
|
68
|
+
- Use `memory_list_topics` or `bamdra_memory_list_topics` when you need to inspect available branches before switching.
|
|
69
|
+
- Use `memory_switch_topic` or `bamdra_memory_switch_topic` when the user clearly wants to move to, resume, or isolate a branch.
|
|
70
|
+
- Use `memory_compact_topic` or `bamdra_memory_compact_topic` after a branch has materially changed and its summary is stale.
|
|
71
|
+
|
|
72
|
+
## Privacy And Isolation
|
|
73
|
+
|
|
74
|
+
- Respect agent isolation. Do not assume another agent's branch is available unless the runtime explicitly exposes it.
|
|
75
|
+
- Respect user isolation. Do not retrieve or reveal information outside the current user/session boundary.
|
|
76
|
+
- Do not surface unrelated facts from memory just because they were found.
|
|
77
|
+
- If memory retrieval feels privacy-sensitive or contextually risky, narrow the search or answer conservatively.
|
|
78
|
+
|
|
79
|
+
## Working Style
|
|
80
|
+
|
|
81
|
+
- Keep memory behavior mostly invisible.
|
|
82
|
+
- Mention it briefly only when it helps the user trust continuity.
|
|
83
|
+
- Use normal conversational language rather than tool narration.
|
|
84
|
+
- Do not explain topic IDs, database actions, or storage internals unless asked.
|