@smyslenny/agent-memory 2.2.0 โ†’ 4.0.0-alpha.1

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 CHANGED
@@ -1,220 +1,298 @@
1
- # ๐Ÿง  AgentMemory v2
1
+ <p align="center">
2
+ <img src="docs/assets/banner.jpg" alt="AgentMemory" width="800" />
3
+ </p>
2
4
 
3
- > **Sleep-cycle memory architecture for AI agents** โ€” remember, recall, forget, evolve.
5
+ <p align="center">
6
+ <strong>Agent-native memory layer with lifecycle management for AI agents.</strong>
7
+ </p>
4
8
 
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6
- [![Node.js](https://img.shields.io/badge/Node.js-โ‰ฅ18-green.svg)](https://nodejs.org/)
7
- [![MCP](https://img.shields.io/badge/protocol-MCP-orange.svg)](https://modelcontextprotocol.io/)
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/@smyslenny/agent-memory"><img src="https://img.shields.io/npm/v/@smyslenny/agent-memory" alt="npm" /></a>
11
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT" /></a>
12
+ <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/Node.js-%E2%89%A518-green.svg" alt="Node.js" /></a>
13
+ <a href="https://modelcontextprotocol.io/"><img src="https://img.shields.io/badge/MCP-10_tools-orange.svg" alt="MCP" /></a>
14
+ </p>
8
15
 
9
- **English** | **[็ฎ€ไฝ“ไธญๆ–‡](README.zh-CN.md)**
16
+ **English** | [็ฎ€ไฝ“ไธญๆ–‡่ฏดๆ˜Ž](docs/README-zh.md)
10
17
 
11
- ---
18
+ AgentMemory is a SQLite-first memory layer for AI agents. It lets an agent:
12
19
 
13
- ## ๐Ÿ’ก The Problem
20
+ - **write** durable memories with typed records, URIs, and Write Guard dedup
21
+ - **read** them back through `boot`, `recall`, and context-aware `surface`
22
+ - **maintain** them over time with `reflect`, `reindex`, and feedback signals
23
+ - **integrate** through **CLI**, **MCP stdio**, or **HTTP/SSE**
14
24
 
15
- AI agents forget everything between sessions. Context windows are finite. Conversation history gets truncated. Important decisions, lessons, and preferences vanish.
25
+ Current release: **`4.0.0-alpha.1`**.
16
26
 
17
- ## ๐ŸŒ™ The Solution: Sleep-Cycle Memory
27
+ Without an embedding provider, AgentMemory still works in **BM25-only mode**.
28
+ With one configured, it adds **hybrid recall** and **semantic dedup**.
18
29
 
19
- Inspired by how human brains consolidate memories during sleep, AgentMemory manages information across four phases:
30
+ ## 1) What is this project?
20
31
 
21
- ```
22
- Awake Light Sleep Deep Sleep Recall
23
- (Journal) (Sync) (Tidy) (Search)
24
- โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ†’ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ†’ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ†’ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
25
- Real-time Deduplicate Compress Intent-aware
26
- capture + extract + distill BM25 search
27
- + decay + priority
28
- ```
32
+ AgentMemory is **not** a general document database and **not** a full RAG
33
+ framework. It is an **agent-native memory layer with lifecycle management**.
29
34
 
30
- ## โœจ Key Features
35
+ That means it is designed around the things agent runtimes actually need:
31
36
 
32
- | Feature | Description | Inspired By |
33
- |---------|-------------|-------------|
34
- | ๐Ÿ”— **URI Path System** | `core://user/name`, `emotion://2026-02-20/love` โ€” structured, multi-entry access | nocturne_memory |
35
- | ๐Ÿ›ก๏ธ **Write Guard** | Hash dedup โ†’ URI conflict โ†’ BM25 similarity โ†’ 4-criterion gate | Memory Palace + our v1 |
36
- | ๐Ÿง  **Ebbinghaus Decay** | `R = e^(-t/S)` โ€” scientific forgetting curve with recall strengthening | PowerMem |
37
- | ๐Ÿ•ธ๏ธ **Knowledge Graph** | Multi-hop traversal across memory associations | PowerMem |
38
- | ๐Ÿ“ธ **Snapshots** | Auto-snapshot before every change, one-click rollback | nocturne + Memory Palace |
39
- | ๐Ÿ” **Intent-Aware Search** | Factual / temporal / causal / exploratory query routing | Memory Palace |
40
- | ๐ŸŒ™ **Sleep Cycle** | Automated sync โ†’ decay โ†’ tidy โ†’ govern pipeline | - |
41
- | ๐Ÿ’š **Priority System** | P0 identity (never decays) โ†’ P3 event (14-day half-life) | - |
42
- | ๐Ÿค **Multi-Agent** | Agent isolation via `agent_id` scope | PowerMem |
43
- | ๐Ÿ”Œ **MCP Server** | 9 tools, works with Claude Code / Cursor / OpenClaw | Standard MCP |
37
+ - a place to store durable user facts, preferences, events, and identity
38
+ - a write path that can reject duplicates or merge near-duplicates safely
39
+ - a read path for explicit lookup (`recall`) and proactive context (`surface`)
40
+ - a lifecycle path for decay, governance, reindexing, and recovery-friendly jobs
41
+ - a local-first deployment model that stays useful even without extra infra
44
42
 
45
- ## ๐Ÿš€ Quick Start
43
+ Core building blocks in v4:
46
44
 
47
- ### Install
45
+ - **Typed memories**: `identity`, `emotion`, `knowledge`, `event`
46
+ - **URI paths** for stable addressing
47
+ - **Write Guard** with semantic dedup + typed merge policy
48
+ - **Hybrid retrieval**: BM25 first, optional vector search
49
+ - **Context-aware surfacing** for task/recent-turn driven context injection
50
+ - **Lifecycle jobs**: `reflect`, `reindex`, job checkpoints, feedback signals
51
+ - **Three transport modes**: CLI, MCP stdio, HTTP/SSE
48
52
 
49
- ```bash
50
- npm install @smyslenny/agent-memory
51
- ```
53
+ ## 2) How is it different from a vector DB, a RAG pipeline, or memory summaries?
52
54
 
53
- ### CLI
55
+ | Thing | Good at | What AgentMemory adds |
56
+ | --- | --- | --- |
57
+ | Vector DB | Similarity search over embeddings | Write quality control, typed memory model, decay, governance, BM25 fallback, agent-scoped lifecycle |
58
+ | RAG pipeline | Retrieving external knowledge for prompts | Durable per-agent memory, surfacing, feedback, memory-specific maintenance |
59
+ | Markdown / summary files | Human-readable notes and editing | Structured retrieval, scoring, dedup, recall APIs, lifecycle operations |
54
60
 
55
- ```bash
56
- # Initialize database
57
- agent-memory init
61
+ A useful mental model:
62
+
63
+ - **Not a vector DB**: vectors are optional, not the product definition
64
+ - **Not a RAG pipeline**: memory is the primary object, not document chunks
65
+ - **Not just summarization**: memories can age, merge, be surfaced, and be
66
+ governed over time
67
+
68
+ If you want a short positioning sentence:
69
+
70
+ > AgentMemory is a **memory layer for agents**, not a generic search backend.
71
+
72
+ ## 3) When should I use it?
58
73
 
59
- # Store memories
60
- agent-memory remember "User prefers dark mode" --type knowledge --uri knowledge://user/preferences
61
- agent-memory remember "I am Noah, a succubus" --type identity --uri core://agent/identity
74
+ Use AgentMemory when your runtime needs one or more of these:
62
75
 
63
- # Search
64
- agent-memory recall "user preferences"
76
+ - **cross-session continuity** for a single agent or multiple scoped agents
77
+ - **durable preferences and facts** that should survive conversation boundaries
78
+ - **local-first deployment** with SQLite, not a mandatory external service stack
79
+ - **memory maintenance** instead of unbounded memory accumulation
80
+ - **multiple integration choices**: shell jobs, MCP tools, or HTTP services
81
+ - **optional semantic retrieval** without making embeddings mandatory
65
82
 
66
- # Load identity at startup
67
- agent-memory boot
83
+ It is a strong fit for:
68
84
 
69
- # Run sleep cycle
70
- agent-memory reflect all
85
+ - personal assistants and copilots
86
+ - agentic workflows with scheduled maintenance
87
+ - multi-session chat agents
88
+ - local/offline-friendly agent runtimes
89
+ - systems that want a human-auditable memory store plus retrieval APIs
71
90
 
72
- # Import from Markdown
73
- agent-memory migrate ./memory/
91
+ It is probably **not** the right tool if you only need:
74
92
 
75
- # Statistics
76
- agent-memory status
93
+ - a high-scale standalone vector database
94
+ - classic document RAG over large corpora
95
+ - a one-shot conversation summarizer with no lifecycle management
96
+
97
+ ## 4) What does the architecture look like?
98
+
99
+ Write path, read path, and lifecycle path all share the same application core.
100
+ The transport is interchangeable.
101
+
102
+ ```mermaid
103
+ flowchart TD
104
+ subgraph Write[Write path]
105
+ W1[Agent runtime] --> W2[remember / ingest]
106
+ W2 --> W3[Write Guard\nsemantic dedup + typed merge]
107
+ W3 --> W4[(SQLite memories)]
108
+ W3 --> W5[(FTS / BM25)]
109
+ W3 --> W6[(Embeddings, optional)]
110
+ end
111
+
112
+ subgraph Read[Read path]
113
+ R1[Startup / task / query] --> R2[boot / recall / surface]
114
+ W4 --> R2
115
+ W5 --> R2
116
+ W6 --> R2
117
+ R2 --> R3[Ranked memories or surfaced context]
118
+ end
119
+
120
+ subgraph Life[Lifecycle path]
121
+ L1[Scheduler or operator] --> L2[reflect / reindex / feedback]
122
+ L2 --> W4
123
+ L2 --> W5
124
+ L2 --> W6
125
+ L2 --> L3[(maintenance_jobs + feedback_events)]
126
+ end
77
127
  ```
78
128
 
79
- ### Library
129
+ <p align="center">
130
+ <img src="docs/assets/architecture-diagram.jpg" alt="Architecture Overview" width="800" />
131
+ </p>
80
132
 
81
- ```typescript
82
- import { openDatabase, syncOne, searchBM25, boot, runDecay } from '@smyslenny/agent-memory';
133
+ See [docs/architecture.md](docs/architecture.md) for a deeper breakdown.
83
134
 
84
- const db = openDatabase({ path: './memory.db' });
135
+ ## 5) What is the shortest 5-minute setup?
85
136
 
86
- // Remember
87
- syncOne(db, {
88
- content: 'User said "I love you"',
89
- type: 'emotion',
90
- uri: 'emotion://2026-02-20/love',
91
- emotion_val: 1.0,
92
- });
137
+ <p align="center">
138
+ <img src="docs/assets/npm-badge.jpg" alt="npm install @smyslenny/agent-memory" width="500" />
139
+ </p>
93
140
 
94
- // Recall
95
- const results = searchBM25(db, 'love');
141
+ Choose the integration path that matches your runtime.
142
+
143
+ ### A. CLI
144
+
145
+ ```bash
146
+ npm install @smyslenny/agent-memory
96
147
 
97
- // Boot identity
98
- const identity = boot(db);
148
+ export AGENT_MEMORY_DB=./agent-memory.db
149
+ export AGENT_MEMORY_AGENT_ID=assistant-demo
99
150
 
100
- // Sleep cycle
101
- runDecay(db);
151
+ npx agent-memory init
152
+ npx agent-memory remember \
153
+ "Alice prefers short weekly summaries." \
154
+ --type knowledge \
155
+ --uri knowledge://users/alice/preferences/summaries
156
+
157
+ npx agent-memory recall "What does Alice prefer?" --limit 5
158
+ npx agent-memory boot
159
+ npx agent-memory reflect all
102
160
  ```
103
161
 
104
- ### MCP Server
162
+ ### B. MCP stdio
105
163
 
106
164
  ```json
107
165
  {
108
166
  "mcpServers": {
109
- "@smyslenny/agent-memory": {
167
+ "agent-memory": {
110
168
  "command": "node",
111
- "args": ["node_modules/@smyslenny/agent-memory/dist/mcp/server.js"],
169
+ "args": ["./node_modules/@smyslenny/agent-memory/dist/mcp/server.js"],
112
170
  "env": {
113
- "AGENT_MEMORY_DB": "./memory.db"
171
+ "AGENT_MEMORY_DB": "./agent-memory.db",
172
+ "AGENT_MEMORY_AGENT_ID": "assistant-demo",
173
+ "AGENT_MEMORY_AUTO_INGEST": "0"
114
174
  }
115
175
  }
116
176
  }
117
177
  }
118
178
  ```
119
179
 
120
- **9 MCP Tools:** `remember` ยท `recall` ยท `recall_path` ยท `boot` ยท `forget` ยท `link` ยท `snapshot` ยท `reflect` ยท `status`
180
+ Available MCP tools in v4:
121
181
 
122
- ## ๐Ÿ”— OpenClaw Integration
182
+ - `remember`
183
+ - `recall`
184
+ - `recall_path`
185
+ - `boot`
186
+ - `forget`
187
+ - `reflect`
188
+ - `status`
189
+ - `ingest`
190
+ - `reindex`
191
+ - `surface`
123
192
 
124
- AgentMemory works **out of the box** with [OpenClaw](https://github.com/smysle/openclaw)'s built-in memory cron jobs โ€” no code changes required. The integration implements a **Capture โ†’ Consolidate โ†’ Surface** closed loop that keeps Markdown journals and the structured memory DB in sync automatically.
193
+ ### C. HTTP API
125
194
 
126
- ### How It Works
195
+ ```bash
196
+ npm install @smyslenny/agent-memory
197
+ export AGENT_MEMORY_DB=./agent-memory.db
198
+ export AGENT_MEMORY_AGENT_ID=assistant-demo
127
199
 
200
+ npx agent-memory serve --host 127.0.0.1 --port 3000
128
201
  ```
129
- Capture (memory-sync) Consolidate (memory-tidy) Surface (memory-surface)
130
- โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
131
- 14:00 & 22:00 03:00 14:05 & 22:05
132
- Session โ†’ daily journal Compress old dailies Recall top memories
133
- + remember each bullet Distill โ†’ MEMORY.md โ†’ generate RECENT.md
134
- into agent-memory DB + reflect phase=all (โ‰ค80 lines, 3 sections)
135
- ```
136
-
137
- | Phase | Cron Job | What Happens | agent-memory Integration |
138
- |-------|----------|-------------|--------------------------|
139
- | **Capture** | `memory-sync` | Scans sessions, appends bullets to `memory/YYYY-MM-DD.md` | Each new bullet is also written via `mcporter call agent-memory.remember` with auto-classified type and URI-based dedup |
140
- | **Consolidate** | `memory-tidy` | Compresses old dailies โ†’ weekly summaries, distills `MEMORY.md` | Triggers `agent-memory.reflect phase=all` (decay + tidy + govern) + consistency spot-check |
141
- | **Surface** | `memory-surface` | Generates short-term context for new sessions | Reads high-vitality memories from agent-memory, outputs structured `RECENT.md` with emotion/knowledge/event sections |
142
202
 
143
- ### Key Design Principles
144
-
145
- - **Markdown is source of truth** โ€” agent-memory is a derived index layer; all data flows Markdown โ†’ DB, never the reverse.
146
- - **Best-effort sync** โ€” If `mcporter` or agent-memory is unavailable, Markdown operations proceed normally. Failures only log warnings.
147
- - **URI-based idempotency** โ€” Each journal bullet maps to a unique URI (`event://journal/2026-02-21#2200-1`), so re-runs are safe.
148
- - **Keyword-based classification** โ€” Bullets are auto-classified as `knowledge`, `emotion`, or `event` using simple keyword rules (no extra model calls).
149
-
150
- ### Setup
203
+ ```bash
204
+ curl -s http://127.0.0.1:3000/health
205
+
206
+ curl -s -X POST http://127.0.0.1:3000/v1/memories \
207
+ -H 'content-type: application/json' \
208
+ -d '{
209
+ "agent_id": "assistant-demo",
210
+ "type": "knowledge",
211
+ "uri": "knowledge://users/alice/preferences/summaries",
212
+ "content": "Alice prefers short weekly summaries."
213
+ }'
214
+
215
+ curl -s -X POST http://127.0.0.1:3000/v1/recall \
216
+ -H 'content-type: application/json' \
217
+ -d '{"agent_id":"assistant-demo","query":"Alice summary preference","limit":5}'
218
+ ```
151
219
 
152
- If you're running OpenClaw with the standard memory cron suite (`memory-sync`, `memory-tidy`, `memory-surface`), the integration is **already active** โ€” the cron prompts include agent-memory sync steps. Just make sure:
220
+ Key HTTP routes:
221
+
222
+ - `GET /health`
223
+ - `GET /v1/status`
224
+ - `GET /v1/jobs/:id`
225
+ - `POST /v1/memories`
226
+ - `POST /v1/recall`
227
+ - `POST /v1/surface`
228
+ - `POST /v1/feedback`
229
+ - `POST /v1/reflect`
230
+ - `POST /v1/reindex`
231
+
232
+ `/v1/reflect` and `/v1/reindex` also support **SSE progress streaming**.
233
+
234
+ ## 6) How do I integrate it into my agent runtime?
235
+
236
+ A good default pattern looks like this:
237
+
238
+ 1. **Startup** โ†’ call `boot` to load identity / startup context
239
+ 2. **Durable fact appears** โ†’ call `remember`
240
+ 3. **Need an explicit lookup** โ†’ call `recall`
241
+ 4. **Need relevant context before replying/planning** โ†’ call `surface`
242
+ 5. **A memory was helpful or noisy** โ†’ record `feedback`
243
+ 6. **Background maintenance** โ†’ run `reflect all` on a schedule
244
+ 7. **Embeddings enabled or changed** โ†’ run `reindex`
245
+
246
+ Pseudo-flow:
247
+
248
+ ```text
249
+ user turn -> detect durable memory -> remember
250
+ agent planning -> surface(task, recent_turns)
251
+ explicit memory question -> recall(query)
252
+ startup -> boot
253
+ nightly / periodic -> reflect(all)
254
+ provider change -> reindex
255
+ ```
153
256
 
154
- 1. **agent-memory is installed and initialized** โ€” `agent-memory init`
155
- 2. **mcporter bridge is configured** โ€” agent-memory MCP server registered in your mcporter config
156
- 3. **Cron jobs are enabled** โ€” check with `openclaw cron list`
257
+ If you want a human-editable file workflow, treat Markdown as an **optional**
258
+ layer on top of the memory system, not the default definition of the product.
259
+ You can use `migrate` or `ingest`, or enable watcher-based ingest when your
260
+ host actually provides a workspace to watch.
157
261
 
158
- For detailed setup and prompt templates, see:
159
- - [`examples/openclaw-setup.md`](examples/openclaw-setup.md) โ€” Full setup walkthrough
160
- - [`docs/design/0004-agent-memory-integration.md`](docs/design/0004-agent-memory-integration.md) โ€” Design document (DD-0004)
262
+ ## Optional semantic retrieval
161
263
 
162
- ## ๐Ÿ—๏ธ Architecture
264
+ Embeddings are optional. If you want hybrid retrieval or semantic dedup, set:
163
265
 
266
+ ```bash
267
+ export AGENT_MEMORY_EMBEDDING_PROVIDER=openai-compatible
268
+ export AGENT_MEMORY_EMBEDDING_BASE_URL=https://your-embedding-endpoint.example
269
+ export AGENT_MEMORY_EMBEDDING_MODEL=text-embedding-3-small
270
+ export AGENT_MEMORY_EMBEDDING_DIMENSION=1536
271
+ export AGENT_MEMORY_EMBEDDING_API_KEY=your-api-key
164
272
  ```
165
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
166
- โ”‚ MCP Server (stdio/SSE) โ”‚
167
- โ”‚ 9 tools + system://boot loader โ”‚
168
- โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
169
- โ”‚ Write Guard โ”‚
170
- โ”‚ hash dedup โ†’ URI conflict โ†’ BM25 sim โ”‚
171
- โ”‚ โ†’ conflict merge โ†’ 4-criterion gate โ”‚
172
- โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
173
- โ”‚ Sleep Cycle Engine โ”‚
174
- โ”‚ sync (capture) โ†’ decay (Ebbinghaus) โ”‚
175
- โ”‚ โ†’ tidy (archive) โ†’ govern (cleanup) โ”‚
176
- โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
177
- โ”‚ Intent-Aware Search (BM25) โ”‚
178
- โ”‚ factual ยท temporal ยท causal ยท explore โ”‚
179
- โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
180
- โ”‚ SQLite (WAL) + FTS5 + Graph Links โ”‚
181
- โ”‚ memories ยท paths ยท links ยท snapshots โ”‚
182
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
183
- ```
184
-
185
- ## ๐Ÿ“Š Priority & Decay
186
-
187
- | Priority | Domain | Half-life | Min Vitality | Example |
188
- |----------|--------|-----------|-------------|---------|
189
- | P0 Identity | `core://` | โˆž (never) | 1.0 | "I am Noah" |
190
- | P1 Emotion | `emotion://` | 365 days | 0.3 | "User said I love you" |
191
- | P2 Knowledge | `knowledge://` | 90 days | 0.1 | "Use TypeScript for agents" |
192
- | P3 Event | `event://` | 14 days | 0.0 | "Configured proxy today" |
193
273
 
194
- **Recall strengthens memory:** each search hit increases stability (S ร— 1.5), slowing future decay.
274
+ Or use `AGENT_MEMORY_EMBEDDING_PROVIDER=local-http` for a local HTTP embedding
275
+ service. If no provider is configured, AgentMemory falls back to BM25-only.
195
276
 
196
- ## ๐Ÿ”ฌ Design Decisions
277
+ ## Documentation map
197
278
 
198
- 1. **SQLite over Postgres/MongoDB** โ€” Zero config, single file, WAL mode for concurrent reads
199
- 2. **BM25 over vector search** โ€” No embedding dependency, instant startup, good enough for structured memory
200
- 3. **TypeScript over Python** โ€” Better concurrency, type safety, OpenClaw ecosystem alignment
201
- 4. **Ebbinghaus over linear decay** โ€” Scientifically grounded, recall strengthening is natural
202
- 5. **Write Guard over free writes** โ€” Prevent duplicate/conflicting memories at the gate
203
- 6. **URI paths over flat keys** โ€” Hierarchical organization, prefix queries, multi-entry access
279
+ - [Architecture](docs/architecture.md)
280
+ - [Generic runtime integration](docs/integrations/generic.md)
281
+ - [OpenClaw integration](docs/integrations/openclaw.md)
282
+ - [Migration guide: v3 โ†’ v4](docs/migration-v3-v4.md)
283
+ - [Examples: quick start](examples/quick-start)
284
+ - [Examples: HTTP API](examples/http-api)
285
+ - [Examples: MCP stdio](examples/mcp-stdio)
286
+ - [Examples: OpenClaw](examples/openclaw)
204
287
 
205
- ## ๐Ÿ“‹ Project Documents
288
+ ## Development
206
289
 
207
- | Document | Description |
208
- |----------|-------------|
209
- | [PLANNING.md](PLANNING.md) | Technical architecture + 5-project comparison |
210
- | [ROADMAP.md](ROADMAP.md) | Implementation phases + milestones |
211
- | [ACCEPTANCE.md](ACCEPTANCE.md) | 40+ acceptance criteria + performance targets |
212
- | [COMPLETION.md](COMPLETION.md) | Release checklist + retrospective template |
290
+ ```bash
291
+ npm install
292
+ npm run build
293
+ npm test
294
+ ```
213
295
 
214
- ## ๐Ÿ“„ License
296
+ ## License
215
297
 
216
298
  MIT
217
-
218
- ---
219
-
220
- *Built by agents who got tired of forgetting. ๐Ÿง *