Skip to content

Commit e67c81c

Browse files
davemorinvincentkoc
authored andcommitted
feat(memory): remember across private conversations
Co-authored-by: Vincent Koc <[email protected]>
1 parent cad4e39 commit e67c81c

53 files changed

Lines changed: 3517 additions & 183 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/concepts/active-memory.md‎

Lines changed: 114 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,55 @@ moment for the recalled fact to feel natural has passed. Active memory gives
1515
the system one bounded chance to surface relevant memory before the main
1616
reply is generated.
1717

18-
## Quick start
18+
## Remember across conversations
1919

20-
Paste into `openclaw.json` for a safe default: plugin on, scoped to `main`,
21-
direct-message sessions only, model inherited from the session.
20+
For a personal or fully trusted agent, enable bounded recall across its other
21+
private conversations with one per-agent setting:
22+
23+
```json5
24+
{
25+
agents: {
26+
list: [
27+
{
28+
id: "personal",
29+
memorySearch: {
30+
rememberAcrossConversations: true,
31+
},
32+
},
33+
],
34+
},
35+
}
36+
```
37+
38+
The setting is off by default. When enabled, OpenClaw indexes that agent's
39+
session transcripts and runs an Active Memory retrieval pass before eligible
40+
private replies. The pass can read relevant transcript excerpts from the same
41+
agent's other private conversations. It excludes the conversation already
42+
being answered.
43+
44+
The privacy boundary is fixed:
45+
46+
- private direct and persistent explicit UI conversations can recall one another
47+
- groups and channels are neither recall sources nor recall destinations
48+
- another agent's transcripts are never eligible
49+
- unknown or archived transcripts without enough conversation metadata are rejected
50+
51+
This does not merge transcripts, change session keys or delivery routes, widen
52+
`tools.sessions.visibility`, or grant broader `sessions_*` tool access. Shared
53+
workspace memory (`MEMORY.md` and `memory/*.md`) keeps its existing behavior.
54+
55+
Active Memory must remain enabled. Retrieval adds a bounded blocking step to
56+
eligible replies; timeout, unavailable search, and empty results all continue
57+
the reply without recalled transcript context. OpenClaw's built-in memory
58+
provider supports this protected transcript-recall path with both the builtin
59+
and QMD backends. Other memory providers keep their own recall behavior but do
60+
not automatically receive private transcript authorization. `openclaw doctor`
61+
reports an unsupported provider or missing `memory_search` tool.
62+
63+
## Advanced Active Memory quick start
64+
65+
Paste into `openclaw.json` for an advanced safe default: plugin on, scoped to
66+
`main`, direct-message sessions only, model inherited from the session.
2267

2368
```json5
2469
{
@@ -90,14 +135,14 @@ without extra context.
90135
Active memory is a conversational enrichment feature, not a platform-wide
91136
inference feature:
92137

93-
| Surface | Runs active memory? |
94-
| ------------------------------------------------------------------- | ------------------------------------------------------- |
95-
| Control UI / web chat persistent sessions | Yes, if the plugin is enabled and the agent is targeted |
96-
| Other interactive channel sessions on the same persistent chat path | Yes, if the plugin is enabled and the agent is targeted |
97-
| Headless one-shot runs | No |
98-
| Heartbeat/background runs | No |
99-
| Generic internal `agent-command` paths | No |
100-
| Sub-agent/internal helper execution | No |
138+
| Surface | Runs active memory? |
139+
| ------------------------------------------------------------------- | -------------------------------------------------------- |
140+
| Control UI / web chat persistent sessions | Yes, when either activation path targets the agent |
141+
| Other interactive channel sessions on the same persistent chat path | Yes, when either activation path allows the conversation |
142+
| Headless one-shot runs | No |
143+
| Heartbeat/background runs | No |
144+
| Generic internal `agent-command` paths | No |
145+
| Sub-agent/internal helper execution | No |
101146

102147
Use it when the session is persistent and user-facing, the agent has
103148
meaningful long-term memory to search, and continuity/personalization matter
@@ -108,32 +153,26 @@ personalization would be surprising.
108153

109154
## When it runs
110155

111-
Two gates must both pass:
112-
113-
1. **Config opt-in** — the plugin is enabled and the current agent id is in `config.agents`.
114-
2. **Runtime eligibility** — the session is an eligible interactive persistent chat session, its chat type is allowed, and its conversation id is not filtered out.
156+
Active Memory has two activation paths:
115157

116-
```text
117-
plugin enabled
118-
+
119-
agent id targeted
120-
+
121-
allowed chat type
122-
+
123-
allowed/not-denied chat id
124-
+
125-
eligible interactive persistent chat session
126-
=
127-
active memory runs
128-
```
158+
1. **Remember across conversations** automatically targets agents whose
159+
`memorySearch.rememberAcrossConversations` setting is enabled, but only for
160+
private direct or persistent explicit UI conversations.
161+
2. **Advanced Active Memory** targets agent IDs listed in
162+
`plugins.entries.active-memory.config.agents` and applies the plugin's chat
163+
type and chat ID controls.
129164

130-
If any condition fails, active memory does not run for that turn (and the
131-
main reply is unaffected).
165+
Both paths require the plugin to be enabled and an eligible interactive
166+
persistent conversation. A session-scoped `/active-memory off` pauses both
167+
paths for that conversation. If any condition fails, active memory does not run
168+
for that turn, and the main reply is unaffected.
132169

133170
### Session types
134171

135-
`config.allowedChatTypes` controls which kinds of conversations may run
136-
active memory. Default:
172+
`config.allowedChatTypes` controls which kinds of conversations may run the
173+
advanced Active Memory path. It cannot widen Remember across conversations:
174+
that product setting remains private-only even when advanced Active Memory is
175+
allowed in groups or channels. Default:
137176

138177
```json5
139178
allowedChatTypes: ["direct"];
@@ -185,7 +224,9 @@ config:
185224
```
186225

187226
This only affects the current session; it does not change
188-
`plugins.entries.active-memory.config.enabled` or other global configuration.
227+
`plugins.entries.active-memory.config.enabled`, an agent's
228+
`memorySearch.rememberAcrossConversations` setting, or other global
229+
configuration.
189230

190231
To pause/resume for all sessions instead, use the global form (requires
191232
owner or `operator.admin`):
@@ -392,12 +433,12 @@ model — `/v1/models` visibility alone does not guarantee it.
392433
## Memory tools
393434

394435
`config.toolsAllow` sets the concrete tool names the blocking sub-agent may
395-
call. Defaults depend on the active memory provider:
436+
call for advanced Active Memory. Defaults depend on the current memory provider:
396437

397-
| `plugins.slots.memory` | Default `toolsAllow` |
398-
| -------------------------------- | --------------------------------- |
399-
| unset / `memory-core` (built-in) | `["memory_search", "memory_get"]` |
400-
| `memory-lancedb` | `["memory_recall"]` |
438+
| Memory provider | Default `toolsAllow` |
439+
| --------------- | --------------------------------- |
440+
| Built-in memory | `["memory_search", "memory_get"]` |
441+
| LanceDB | `["memory_recall"]` |
401442

402443
If none of the configured tools are available, or the sub-agent run fails,
403444
active memory skips recall for that turn and the main reply continues
@@ -409,7 +450,7 @@ explicitly report an empty result or failure.
409450
entries, and core agent tools (`read`, `exec`, `message`, `web_search`, and
410451
similar) are silently filtered out before the hidden sub-agent starts.
411452

412-
### Built-in memory-core
453+
### Built-in memory
413454

414455
No explicit `toolsAllow` needed:
415456

@@ -431,24 +472,13 @@ No explicit `toolsAllow` needed:
431472

432473
### LanceDB memory
433474

434-
Selecting the memory slot is enough for active memory to use `memory_recall`:
475+
After [installing and configuring LanceDB](/plugins/memory-lancedb), Active
476+
Memory automatically uses `memory_recall`; no explicit `toolsAllow` is needed:
435477

436478
```json5
437479
{
438480
plugins: {
439-
slots: {
440-
memory: "memory-lancedb",
441-
},
442481
entries: {
443-
"memory-lancedb": {
444-
enabled: true,
445-
config: {
446-
embedding: {
447-
provider: "openai",
448-
model: "text-embedding-3-small",
449-
},
450-
},
451-
},
452482
"active-memory": {
453483
enabled: true,
454484
config: {
@@ -461,6 +491,11 @@ Selecting the memory slot is enough for active memory to use `memory_recall`:
461491
}
462492
```
463493

494+
This is the advanced Active Memory path for LanceDB's own stored memories.
495+
`memorySearch.rememberAcrossConversations` does not expose private session
496+
transcripts through `memory_recall`. Use LanceDB's auto-recall or the advanced
497+
configuration above when LanceDB is the active memory provider.
498+
464499
### Lossless Claw
465500

466501
[Lossless Claw](https://github.com/martian-engineering/lossless-claw) is an
@@ -472,6 +507,9 @@ point active memory at its tools:
472507
```json5
473508
{
474509
plugins: {
510+
slots: {
511+
contextEngine: "lossless-claw",
512+
},
475513
entries: {
476514
"lossless-claw": {
477515
enabled: true,
@@ -480,7 +518,7 @@ point active memory at its tools:
480518
enabled: true,
481519
config: {
482520
agents: ["main"],
483-
toolsAllow: ["lcm_grep", "lcm_describe", "lcm_expand_query"],
521+
toolsAllow: ["memory_search", "lcm_grep", "lcm_describe", "lcm_expand_query"],
484522
promptAppend: "Use lcm_grep first for compacted conversation recall. Use lcm_describe to inspect a specific summary. Use lcm_expand_query only when the latest user message needs exact details that may have been compacted away. Return NONE if the retrieved context is not clearly useful.",
485523
},
486524
},
@@ -491,7 +529,11 @@ point active memory at its tools:
491529

492530
Do not add `lcm_expand` to `toolsAllow` here; Lossless Claw uses it as a
493531
lower-level tool for delegated expansion, not meant for the top-level
494-
active-memory sub-agent.
532+
active-memory sub-agent. Lossless Claw changes context assembly without
533+
replacing the current memory provider. Keep `memory_search` in `toolsAllow`
534+
when also using `rememberAcrossConversations`; an LCM-only tool list remains
535+
valid for advanced Active Memory but disables the product transcript-recall
536+
path.
495537

496538
## Advanced escape hatches
497539

@@ -685,23 +727,31 @@ while warm-up finishes.
685727
If active memory is not showing up where you expect:
686728

687729
1. Confirm the plugin is enabled under `plugins.entries.active-memory.enabled`.
688-
2. Confirm the current agent id is listed in `config.agents`.
689-
3. Confirm you are testing through an interactive persistent chat session.
690-
4. Turn on `config.logging: true` and watch the gateway logs.
691-
5. Verify memory search itself works with `openclaw status --deep`.
730+
2. For Remember across conversations, confirm the agent's
731+
`memorySearch.rememberAcrossConversations` setting is `true`, run
732+
`openclaw doctor` to verify the current memory provider supports protected
733+
transcript recall, and confirm `config.toolsAllow` includes `memory_search`
734+
when explicitly configured. For advanced Active Memory, confirm the agent ID
735+
is listed in `config.agents`.
736+
3. Confirm you are testing through an eligible interactive persistent conversation.
737+
4. Remember that groups and channels never use cross-conversation transcript recall.
738+
5. Turn on `config.logging: true` and watch the gateway logs.
739+
6. Verify memory search itself works with `openclaw status --deep`.
692740

693741
If memory hits are noisy, tighten `maxSummaryChars`. If active memory is too
694742
slow, lower `queryMode`, lower `timeoutMs`, or reduce recent turn counts and
695743
per-turn char caps.
696744

697745
## Common issues
698746

699-
Active memory rides on the configured memory plugin's recall pipeline, so
700-
most recall surprises are embedding-provider problems, not active-memory
701-
bugs. The default `memory-core` path uses `memory_search` and `memory_get`;
702-
the `memory-lancedb` slot uses `memory_recall`. If you use another memory
703-
plugin, confirm `config.toolsAllow` names the tools that plugin actually
704-
registers.
747+
Advanced Active Memory rides on the configured memory plugin's recall
748+
pipeline, so most recall surprises are embedding-provider problems, not
749+
active-memory bugs. The default `memory-core` path uses `memory_search` and
750+
`memory_get`; the `memory-lancedb` slot uses `memory_recall`. If you use another
751+
memory plugin, confirm `config.toolsAllow` names the tools that plugin actually
752+
registers. Remember across conversations is narrower: the current memory
753+
provider must support OpenClaw's protected same-agent/private-session recall
754+
path.
705755

706756
<AccordionGroup>
707757
<Accordion title="Embedding provider switched or stopped working">

‎docs/concepts/session.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,27 @@ troubleshooting.
6464

6565
Verify your setup with `openclaw security audit`.
6666

67+
## Remember across conversations
68+
69+
Separate transcripts control each conversation's local history. For a personal
70+
or fully trusted agent, `memorySearch.rememberAcrossConversations: true`
71+
adds an optional retrieval step across that agent's other private
72+
conversations; it does not combine their transcripts.
73+
74+
Private direct and persistent explicit UI conversations can supply relevant
75+
context to one another. Groups and channels stay separate in both directions:
76+
their transcripts are not private recall sources, and replies in those
77+
conversations do not receive private transcript context. The current
78+
conversation is also excluded because its history is already loaded.
79+
80+
This setting does not change session keys, DM scope, routing, delivery, or
81+
`tools.sessions.visibility`. Shared workspace memory in `MEMORY.md` and
82+
`memory/*.md` also keeps its existing behavior. The current memory provider
83+
must support protected private transcript recall; context engines such as
84+
Lossless Claw remain independent and can run alongside it. See
85+
[Active Memory](/concepts/active-memory#remember-across-conversations) for setup
86+
and runtime details.
87+
6788
## Session lifecycle
6889

6990
Sessions are reused until they expire under `session.reset`:

‎docs/docs_map.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,7 +2215,8 @@ Do not edit it by hand; run `pnpm docs:map:gen`.
22152215

22162216
- Route: /concepts/active-memory
22172217
- Headings:
2218-
- H2: Quick start
2218+
- H2: Remember across conversations
2219+
- H2: Advanced Active Memory quick start
22192220
- H2: How it works
22202221
- H2: When it runs
22212222
- H3: Session types
@@ -2227,7 +2228,7 @@ Do not edit it by hand; run `pnpm docs:map:gen`.
22272228
- H3: Speed recommendations
22282229
- H4: Cerebras setup
22292230
- H2: Memory tools
2230-
- H3: Built-in memory-core
2231+
- H3: Built-in memory
22312232
- H3: LanceDB memory
22322233
- H3: Lossless Claw
22332234
- H2: Advanced escape hatches
@@ -2941,6 +2942,7 @@ Do not edit it by hand; run `pnpm docs:map:gen`.
29412942
- H2: How messages are routed
29422943
- H2: DM isolation
29432944
- H3: Dock linked channels
2945+
- H2: Remember across conversations
29442946
- H2: Session lifecycle
29452947
- H2: Where state lives
29462948
- H2: Session maintenance
@@ -8681,6 +8683,7 @@ Do not edit it by hand; run `pnpm docs:map:gen`.
86818683

86828684
- Route: /reference/memory-config
86838685
- Headings:
8686+
- H2: Remember across conversations
86848687
- H2: Provider selection
86858688
- H3: Custom provider ids
86868689
- H3: API key resolution

‎docs/plugins/memory-lancedb.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ Companion plugins such as `memory-wiki` can run alongside `memory-lancedb`,
3131
but only one plugin owns the active memory slot at a time.
3232
</Note>
3333

34+
<Note>
35+
LanceDB's `memory_recall` does not receive the protected private transcript
36+
authorization used by `memorySearch.rememberAcrossConversations`. Use LanceDB's
37+
`autoRecall` or its `memory_recall` tool through
38+
[advanced Active Memory](/concepts/active-memory#lancedb-memory).
39+
`openclaw doctor` reports when Remember across conversations is unavailable
40+
with the current memory provider.
41+
</Note>
42+
3443
## Quick start
3544

3645
```json5

0 commit comments

Comments
 (0)