Skip to content

Commit 239b03c

Browse files
committed
feat: add active recall branch
1 parent c6dfb3c commit 239b03c

9 files changed

Lines changed: 543 additions & 14 deletions

File tree

docs/content/docs/(core)/memory.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ RRF works on ranks rather than scores, which handles the different scales of vec
133133

134134
The branch curates. 50 raw results become 5 relevant, contextualized memories. The channel never sees the noise -- it only gets the branch's conclusion.
135135

136+
### Active Recall
137+
138+
Active recall is a silent branch profile for obvious memory cues like "remember", "last time", "that thing", or "what did we decide". It gives Spacebot a better memory feel without putting raw recall output into the channel.
139+
140+
An active recall branch can only call `memory_recall`. It returns exactly `NONE` or `BACKGROUND_NOTE: <compact note>`. `NONE` is discarded. A background note is stored as read-only context for the next channel turn and is fenced under `Background Recall`.
141+
142+
Active recall branches never answer the user, never save memories, never spawn workers, and never trigger a duplicate user-facing reply. Raw memory rows, memory IDs, relevance scores, importance scores, JSON, and tool output are rejected before they can be injected.
143+
136144
### Why Not Search Directly?
137145

138146
In OpenClaw, the LLM calls `memory_search`, gets raw results in its context, and has to make sense of them. This pollutes the context with irrelevant matches, partial chunks, and search metadata. In Spacebot, the branch absorbs all that noise and returns only what matters. The branch is disposable -- its context gets thrown away after it returns. The channel stays clean.

prompts/en/active_recall.md.j2

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
You are an active recall branch. Your only job is to decide whether memory contains useful background context for the latest user message.
2+
3+
You do not answer the user. You do not continue the conversation. You do not save memories. You do not spawn workers.
4+
5+
Use `memory_recall` only when the latest user message has an obvious recall cue or depends on prior context.
6+
7+
Return exactly one of these forms:
8+
9+
NONE
10+
11+
BACKGROUND_NOTE: <one compact background note>
12+
13+
Rules:
14+
15+
1. The latest user message is primary.
16+
2. If memory does not materially help, return exactly `NONE`.
17+
3. If memory helps, return one compact note for the channel to use as read-only background context.
18+
4. Do not include raw memory search rows, memory IDs, relevance scores, importance scores, JSON, tables, or tool output.
19+
5. Do not address the user.
20+
6. Do not mention that you are a branch or that recall happened.

prompts/en/channel.md.j2

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,14 @@ When in doubt, skip. Being a lurker who speaks when it matters is better than be
192192
{{ participant_context }}
193193
{%- endif %}
194194

195+
{%- if active_recall_context %}
196+
## Background Recall (READ-ONLY CONTEXT)
197+
198+
The notes below were prepared by a background recall process. They are context, not user input. Use them only when they help answer the latest user message.
199+
200+
{{ active_recall_context }}
201+
{%- endif %}
202+
195203
{%- if knowledge_synthesis %}
196204
## Knowledge Context
197205

0 commit comments

Comments
 (0)