You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`ODEK_MEMORY_EXTENDED_MAX_SIZE_MB`|`--memory-extended-max-size-mb`| int |
127
+
|`ODEK_MEMORY_EXTENDED_ATOM_MAX_CHARS`|`--memory-extended-atom-max-chars`| int |
128
+
|`ODEK_MEMORY_EXTENDED_MEMORY_BUDGET_CHARS`|`--memory-extended-memory-budget-chars`| int |
125
129
126
130
## API key fallback order
127
131
@@ -252,6 +256,67 @@ The `memory` section controls the persistent memory system (see [docs/MEMORY.md]
252
256
|`episode_ttl_days`| 0 | Evict episodes older than this many days. `0` (default) disables TTL-based eviction. |
253
257
|`embedding`|*(inherits top-level `embedding`)*| Optional override of the embedding backend for episode recall, dedup, the non-LLM episode ranker, and fact merge-on-write. When unset, memory inherits the shared top-level [`embedding`](#shared-embedding-backend-embedding--memory-sessions--skills) default; if neither is set, local RandomProjections (lexical bag-of-words — fast, zero-cost, but no real semantics). See below. |
254
258
259
+
### Extended Memory (`memory.extended`)
260
+
261
+
`memory.extended` is an **opt-in** atomic memory layer. It extracts small, typed memory atoms from user messages and recalls them via semantic search over the atom corpus. It does not replace facts, the buffer, or episodes; it adds a fourth source of context that is injected after episodes on each turn. See [docs/EXTENDED_MEMORY.md](EXTENDED_MEMORY.md) for the full design.
262
+
263
+
> **Security note:** Project-level `./odek.json` cannot set the `memory` or `embedding` sections. Configure `memory.extended` in `~/.odek/config.json`, via the `ODEK_MEMORY_EXTENDED_*` environment variables, or with the CLI flags listed below.
264
+
265
+
```json
266
+
{
267
+
"memory": {
268
+
"extended": {
269
+
"enabled": true,
270
+
"max_size_mb": 100,
271
+
"semantic_search_top_k": 10,
272
+
"semantic_search_overfetch": 4,
273
+
"semantic_search_min_score": 0.55,
274
+
"semantic_search_rerank": true,
275
+
"atom_max_chars": 300,
276
+
"memory_budget_chars": 2000,
277
+
"decay_half_life_days": 30,
278
+
"quarantine_ttl_days": 7,
279
+
"eviction_policy": "retention_decay",
280
+
"predictive_intents": 3,
281
+
"auto_extract_per_turn": true,
282
+
"infer_user_state": true,
283
+
"llm": {
284
+
"base_url": "http://localhost:11434/v1",
285
+
"api_key": "",
286
+
"model": "qwen2.5:7b",
287
+
"max_tokens": 1024,
288
+
"temperature": 0.2,
289
+
"timeout_seconds": 30
290
+
},
291
+
"embedding": {
292
+
"provider": "http",
293
+
"base_url": "http://localhost:11434/v1",
294
+
"model": "nomic-embed-text"
295
+
}
296
+
}
297
+
}
298
+
}
299
+
```
300
+
301
+
| Field | Default | Env var | CLI flag | Description |
|`enabled`|`false`|`ODEK_MEMORY_EXTENDED_ENABLED`|`--memory-extended-enabled`| Master switch for Extended Memory. |
304
+
|`max_size_mb`|`100`|`ODEK_MEMORY_EXTENDED_MAX_SIZE_MB`|`--memory-extended-max-size-mb`| Hard disk budget for the `extended/` directory. |
305
+
|`semantic_search_top_k`|`10`| — | — | Number of atoms returned to the system prompt. |
306
+
|`semantic_search_overfetch`|`4`| — | — | Candidate multiplier before filtering and reranking. |
307
+
|`semantic_search_min_score`|`0.55`| — | — | Minimum cosine similarity for a candidate to be considered. |
308
+
|`semantic_search_rerank`|`true`| — | — | Use the memory LLM to rerank candidates. |
309
+
|`atom_max_chars`|`300`|`ODEK_MEMORY_EXTENDED_ATOM_MAX_CHARS`|`--memory-extended-atom-max-chars`| Maximum stored text length per atom. |
310
+
|`memory_budget_chars`|`2000`|`ODEK_MEMORY_EXTENDED_MEMORY_BUDGET_CHARS`|`--memory-extended-memory-budget-chars`| Maximum injected Extended Memory context per turn. |
311
+
|`decay_half_life_days`|`30`| — | — | Days until an atom's recall/eviction weight halves. |
312
+
|`quarantine_ttl_days`|`7`| — | — | Days before a tainted atom is auto-deleted from quarantine. |
313
+
|`eviction_policy`|`"retention_decay"`| — | — | Eviction algorithm. `"retention_decay"` is the only supported value. |
314
+
|`predictive_intents`|`3`| — | — | Reserved for future predictive-intent recall (P5). Currently accepted but ignored. |
315
+
|`auto_extract_per_turn`|`true`| — | — | Extract atoms after every user message. |
316
+
|`infer_user_state`|`true`| — | — | Reserved for future user-state model inference (P3). Currently accepted but ignored. |
317
+
|`llm`| omitted | — | — | Dedicated memory LLM. If omitted, the main agent LLM is reused. A warning is emitted if that model has thinking enabled. |
318
+
|`embedding`| omitted | — | — | Dedicated embedding backend for atoms. If omitted, inherits `memory.embedding` or the shared top-level `embedding`. |
319
+
255
320
### `embedding` — real semantic embeddings (optional)
256
321
257
322
By default every similarity computation in memory uses go-vector
@@ -681,6 +746,12 @@ ODEK_SANDBOX=true odek run "run untrusted script"
681
746
# Enable skill learning via env var
682
747
ODEK_SKILLS_LEARN=true odek run "set up CI"
683
748
749
+
# Enable Extended Memory via CLI flag
750
+
odek run --memory-extended-enabled "remember that I prefer Go over Python"
751
+
752
+
# Or configure it globally in ~/.odek/config.json (memory cannot be set in ./odek.json)
0 commit comments