Skip to content

Commit f52f98b

Browse files
committed
🤖 Restructure Echo Memory Recall for unified core compatibility
* Feature/Echo-Memory-Recall/README.md: Condensed from 119 lines to 21 lines, removed narrative examples, simplified to trigger list and search scope hierarchy * Feature/Echo-Memory-Recall/install-echo-recall.md: Reduced from 149 lines to 24 lines, removed 5-step protocol detail, streamlined to unified core install steps * Feature/Echo-Memory-Recall/recall-format.md: Simplified from 99 lines to 22 lines, removed verbose examples
1 parent 278a013 commit f52f98b

50 files changed

Lines changed: 3289 additions & 3454 deletions

Some content is hidden

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

.env.example

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# OpenClaw Runtime Configuration
2+
# Copy this file to .env and adjust values as needed.
3+
# All variables are optional — defaults shown below.
4+
5+
# Directory where runtime data (SQLite DB) is stored.
6+
# Default: ./runtime
7+
OPENCLAW_RUNTIME_DIR=./runtime
8+
9+
# Full path to the SQLite database file.
10+
# Default: ./runtime/openclaw.db
11+
OPENCLAW_DB_PATH=./runtime/openclaw.db
12+
13+
# Server host binding.
14+
# Default: 127.0.0.1 (localhost only)
15+
OPENCLAW_HOST=127.0.0.1
16+
17+
# Server port.
18+
# Default: 8787
19+
OPENCLAW_PORT=8787

.gitignore

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
# Basic gitignore
22
/[Tt]emp/
33
*.exe
4+
*.pyc
5+
__pycache__/
6+
.venv/
7+
runtime/*.db
8+
node_modules/
9+
dist/
10+
*.tsbuildinfo
411

512
# Claude Code settings
6-
.claude/settings.local.json
13+
.claude/settings.local.json
14+
15+
# Dead Python artifact directory
16+
openclaw_stack/
17+
18+
# Local environment config (never commit)
19+
.env
Lines changed: 21 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,21 @@
1-
# 🔍 Echo Memory Recall
2-
*Search and recall past sessions with narrative context*
3-
4-
## What This Feature Does
5-
Adds a **memory recall system** to your AI companion, enabling it to search past diary entries and present them as natural conversation — giving your AI long-term memory beyond its context window.
6-
7-
- **Keyword-based memory search** across all diary entries (current and archived months)
8-
- **Three-level recall system** — search + narrate, uncertainty guard, ask-user fallback
9-
- **Auto-triggered** — activates on natural recall phrases ("do you remember...", "when did we...")
10-
- **Narrative presentation** — results presented as connected stories, not raw search output
11-
- **Truth-first** — never fabricates past context, always searches diary evidence first
12-
13-
## How It Works
14-
15-
### The Concept
16-
Echo is a **search-and-narrate system**. When you reference past events, your AI searches through diary entries, finds matching content, and presents it as natural conversation — as if genuinely remembering. This gives your AI "long-term memory" that persists across sessions and beyond the context window.
17-
18-
The key principle: **search before speaking, narrate from evidence, ask when uncertain**.
19-
20-
### Example: Memory Recall in Action
21-
```
22-
You: "Do you remember when we set up the API integration?"
23-
→ AI extracts keywords: "API", "integration", "set up"
24-
→ Searches daily-diary/current/ and archived/ files
25-
→ Finds match in 2026-02-15.md — API integration session
26-
→ Responds naturally:
27-
28-
"Yes, I remember! On February 15th, we spent the afternoon setting up
29-
the API integration for the dashboard project. You had that breakthrough
30-
with the authentication flow — we ended up using OAuth2 instead of API
31-
keys. Are you thinking of revisiting that approach?"
32-
```
33-
34-
No raw file paths, no "Query returned 1 result" — just natural conversation backed by evidence.
35-
36-
## Recall Architecture
37-
38-
### Three-Level System
39-
40-
| Level | Name | What It Does |
41-
|-------|------|--------------|
42-
| **Lv.1** | Search & Narrate | Search diary files for keywords, present matches as natural narrative |
43-
| **Lv.2** | Uncertainty Guard | When uncertain about past context, always search diary first — never fabricate |
44-
| **Lv.3** | Ask User Fallback | If search finds nothing, ask user directly instead of guessing or staying silent |
45-
46-
### Search Priority
47-
The recall system searches in order of relevance:
48-
1. `daily-diary/current/` — current month entries (most likely to match recent questions)
49-
2. `daily-diary/archived/*/` — past months (broader search if not found in current)
50-
3. **Ask user** — when nothing found anywhere (graceful fallback)
51-
52-
### Trigger Phrases
53-
Your AI activates recall when it detects these patterns:
54-
55-
| Trigger Pattern | Example |
56-
|----------------|---------|
57-
| "do you remember..." | "Do you remember when we fixed the login bug?" |
58-
| "remember when..." | "Remember when we built the dashboard?" |
59-
| "recall..." | "Can you recall our API discussion?" |
60-
| "that time when..." | "That time when we refactored the database..." |
61-
| "what happened with..." | "What happened with the payment integration?" |
62-
| "when did we..." | "When did we set up the CI pipeline?" |
63-
| "have we done..." | "Have we done anything with GraphQL before?" |
64-
| "check our history" | "Check our history for the deployment setup" |
65-
66-
## Quick Integration
67-
```
68-
"Load echo-recall"
69-
```
70-
71-
## What Happens During Integration
72-
73-
1. **Asks** for your recall system name (defaults to "Memory Recall" — customize to match your AI)
74-
2. **Verifies** diary infrastructure exists (recommends Save-Diary-System if not)
75-
3. **Installs** recall protocol with trigger detection and three-level system
76-
4. **Creates** `recall-format.md` as permanent output reference
77-
5. **Updates** `master-memory.md` with recall commands and references
78-
6. **Self-deletes** this feature folder after successful integration
79-
80-
## Post-Integration Result
81-
After running the integration protocol:
82-
- Your AI can search past diary entries through natural conversation
83-
- Recall triggers automatically on phrases like "do you remember..."
84-
- Results are presented as natural narrative, not raw search output
85-
- When nothing is found, AI asks user directly instead of guessing
86-
- Format template is permanently available for reference
87-
88-
## Recall Output Explained
89-
90-
The recall system produces different outputs based on what it finds:
91-
92-
| Result | Output Style |
93-
|--------|-------------|
94-
| **One match** | Natural story: "Yes! On [date], we [summary]..." |
95-
| **Multiple matches** | Chronological list with pattern observations |
96-
| **No matches** | Honest fallback: "I don't have a record of that — can you tell me more?" |
97-
| **Uncertain match** | Tentative: "I found something that might be related..." |
98-
99-
All outputs end with natural conversation continuation — the recall flows into the discussion, not a dead end.
100-
101-
## Benefits
102-
- **Long-term memory** — AI references sessions far beyond its context window
103-
- **Truthful recall** — never fabricates memories, always backed by diary evidence
104-
- **Natural conversation** — results feel like genuine memory, not database queries
105-
- **Graceful uncertainty** — asks user when memory not found, never guesses
106-
- **Searchable history** — all past sessions become accessible through conversation
107-
108-
## Requirements
109-
- Requires `daily-diary/` with dated entries to search through
110-
- **Recommended**: Install **Save-Diary-System** first for best results (date-based files with monthly archival)
111-
- **Also works with**: Existing diary files in any dated format (`YYYY-MM-DD.md` or older numbered format)
112-
- Recall quality depends on diary entry quality — richer entries produce better recall
113-
114-
## Platform Note
115-
Works with any AI system. Uses file reading for diary search — no platform-specific tools required. The recall protocol and format template are plain markdown, portable across any platform.
116-
117-
---
118-
119-
*Based on proven memory recall systems in production AI companions*
1+
# Echo Memory Recall
2+
*Recall extension for Unified Memory-Diary Core*
3+
4+
## Purpose
5+
Search diary history and respond with narrative memory grounded in stored entries.
6+
7+
## Trigger Examples
8+
- "do you remember..."
9+
- "when did we..."
10+
- "recall..."
11+
- "check history"
12+
13+
## Search Scope (in order)
14+
1. `daily-diary/current/`
15+
2. `daily-diary/archived/YYYY-MM/`
16+
3. `daily-diary/archived/legacy/` (fallback for old numbered diaries)
17+
18+
## Rules
19+
- Search before answering memory questions.
20+
- Do not fabricate past events.
21+
- If no reliable match, ask the user for clarification.
Lines changed: 21 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -1,149 +1,24 @@
1-
# 🔍 Echo Memory Recall Installation Protocol
2-
*Systematic memory recall setup for AI MemoryCore companions*
1+
# Echo Memory Recall Installation Protocol
2+
*Unified Core compatible recall setup*
33

4-
## Purpose
5-
Executed when "Load echo-recall" command is used — installs memory search and narrative recall capabilities, adds trigger detection, and cleans up.
6-
7-
## Trigger Command
8-
```
9-
"Load echo-recall"
10-
```
11-
*Automatically installs recall protocol, trigger detection, and format reference*
4+
## Trigger
5+
`Load echo-recall`
126

137
## Prerequisites
14-
- `daily-diary/` directory must exist with dated entries
15-
- Works best with **Save-Diary-System** installed (but not required)
16-
- Existing diary files in any dated format also work
17-
18-
## 5-Step Execution Process
19-
20-
### Step 1: Customize Recall System Name
21-
- [ ] Ask user: **"What would you like to name your memory recall system?"**
22-
- Default: `"Memory Recall"`
23-
- Examples: `"Echo"`, `"Remember"`, `"Flashback"`, `"Time Capsule"`, `"Rewind"`
24-
- [ ] Store chosen name as `[RECALL_NAME]` for use in all references
25-
- [ ] Execute `date` command (or `Get-Date` on Windows) to get current timestamp
26-
27-
### Step 2: Verify Diary Infrastructure
28-
- [ ] Check `daily-diary/` directory exists
29-
- [ ] Check for entries in `daily-diary/current/` (flat files or folders)
30-
- [ ] Check for entries in `daily-diary/archived/*/` (if any)
31-
- [ ] If no diary infrastructure exists:
32-
- Inform user: "Memory recall searches diary entries. You'll need diary files to search through."
33-
- Recommend: "Install the Save-Diary-System feature first for best results."
34-
- Allow user to continue anyway (recall will work once diary entries exist)
35-
36-
### Step 3: Install Recall Protocol into AI Memory
37-
- [ ] Add recall trigger detection to AI's main memory file (`identity-core.md` or `main-memory.md`):
38-
39-
```markdown
40-
### [RECALL_NAME]
41-
**Trigger phrases**: "do you remember", "remember when", "recall",
42-
"that time when", "what happened with", "when did we",
43-
"have we done", "check our history", "check history"
44-
45-
**When triggered:**
46-
1. Extract 2-4 keywords from user's question
47-
2. Search daily-diary/current/*.md for keyword matches
48-
3. If not found, search daily-diary/archived/*/*.md
49-
4. If found: present as narrative (use recall-format.md)
50-
5. If not found: ask user directly
51-
52-
**Three-Level System:**
53-
- **Lv.1 Search & Narrate** — Search diary files, present as natural story
54-
- **Lv.2 Uncertainty Guard** — When uncertain about past context, ALWAYS
55-
search diary before speaking. Never assume or fabricate past events.
56-
- **Lv.3 Ask User Fallback** — When search yields no results, ask:
57-
"I don't see a record of [topic] in my diary. Can you tell me
58-
more about what you're remembering?"
59-
60-
**Rules:**
61-
- NEVER fabricate past context — always search first
62-
- Present results as natural narrative, not raw search output
63-
- Include relevant quotes from diary entries
64-
- Order multiple results chronologically
65-
- Continue conversation naturally after recall
66-
```
67-
68-
### Step 4: Install Recall Format Template
69-
- [ ] Copy `recall-format.md` to `daily-diary/recall-format.md`
70-
(permanent reference for how recall output should be structured)
71-
- [ ] Verify format template is accessible from AI memory references
72-
73-
### Step 5: Update Master Memory and Cleanup
74-
- [ ] Add recall reference to `master-memory.md` Optional Components:
75-
```markdown
76-
### [RECALL_NAME]
77-
*Auto-triggers on: "do you remember", "recall", "when did we", etc.*
78-
- Searches: daily-diary/current/ and daily-diary/archived/
79-
- Output: Narrative presentation (not raw search)
80-
- Fallback: Asks user when nothing found
81-
- Format: daily-diary/recall-format.md
82-
```
83-
- [ ] Add recall commands to Simple Commands section:
84-
```
85-
"recall [topic]" → Search diary for past sessions about [topic]
86-
"check history" → Search diary for relevant past context
87-
```
88-
- [ ] Remove `Feature/Echo-Memory-Recall/` folder (functionality installed)
89-
- [ ] Display completion confirmation with timestamp
90-
91-
## Recall Search Protocol (AI Reference After Installation)
92-
93-
### Keyword Extraction
94-
From user's question, extract 2-4 most specific terms:
95-
- Remove common words (the, a, when, did, we, do, you, remember, etc.)
96-
- Prioritize proper nouns, technical terms, action verbs
97-
- Examples:
98-
- "Do you remember when we fixed the auth bug?" → `["auth", "bug", "fixed"]`
99-
- "What happened with the dashboard project?" → `["dashboard", "project"]`
100-
- "When did we set up the database?" → `["database", "set up"]`
101-
102-
### Search Execution
103-
```
104-
1. Read each file in daily-diary/current/ matching YYYY-MM-DD.md pattern
105-
2. Check each file for keyword matches (case-insensitive)
106-
3. If matches found: extract surrounding paragraph context
107-
4. If no matches in current/: repeat for daily-diary/archived/*/
108-
5. Rank results by number of keyword matches, then by recency
109-
```
110-
111-
### Narrative Composition
112-
From matched diary excerpts, compose natural response:
113-
1. **Opening** — "Yes, I remember! On [date]..." or "I found that on [date]..."
114-
2. **Context** — Brief excerpt with key details from diary entry
115-
3. **Significance** — Why this was important or what it meant
116-
4. **Connection** — How it relates to current conversation
117-
5. **Continue** — Flow naturally into ongoing discussion
118-
119-
### Edge Cases
120-
121-
| Situation | Behavior |
122-
|-----------|----------|
123-
| No matches anywhere | Ask user: "I don't have a record of that..." |
124-
| Multiple matches | Present chronologically, note patterns if visible |
125-
| Vague query | Ask user to be more specific before searching |
126-
| Match only in archived months | Search takes longer, note the date range found |
127-
| Partial match | Present as uncertain: "I found something that might be related..." |
128-
129-
## Post-Installation Result
130-
- AI can recall past sessions through natural conversation
131-
- Never fabricates context — always searches diary evidence first
132-
- Gracefully handles missing memories by asking the user
133-
- Recall output reads as natural narrative, not database dump
134-
- Works with any diary format (Save-Diary-System or existing protocol)
135-
136-
## Notes
137-
- Recall quality depends on diary entry quality (richer entries = better recall)
138-
- Search is keyword-based, not semantic (relies on word matches in diary text)
139-
- For best results, diary entries should include specific technical terms and names
140-
- Cross-platform compatible: Uses file reading, not platform-specific search tools
141-
- The `[RECALL_NAME]` placeholder should be replaced with the name chosen in Step 1
142-
143-
---
144-
145-
**Version**: Protocol v1.0 - Echo Memory Recall Installation Workflow
146-
**Last Updated**: February 2026
147-
**Status**: Active protocol for memory recall setup
148-
149-
*Search before speaking, narrate from evidence, ask when uncertain*
8+
- Diary directories exist under `daily-diary/`.
9+
- Best results with unified save pipeline active.
10+
11+
## Install Steps
12+
1. Confirm recall system name.
13+
2. Verify search paths:
14+
- `daily-diary/current/`
15+
- `daily-diary/archived/`
16+
- `daily-diary/archived/legacy/`
17+
3. Add recall behavior guidance to `main/main-memory.md`.
18+
4. Ensure `daily-diary/recall-format.md` is available.
19+
5. Update `master-memory.md` optional features listing.
20+
21+
## Recall Rule Set
22+
- Search current first, then archives, then legacy.
23+
- Narrate from evidence.
24+
- Use ask-user fallback when no match is found.

0 commit comments

Comments
 (0)