Integrate OptMem wake into agent memory prompting

This commit is contained in:
Ollie Agent 2026-08-18 14:01:18 +02:00
parent db8414f815
commit 94b4c4be3f
12 changed files with 56 additions and 4 deletions

View File

@ -1,6 +1,7 @@
{
"prompt": [
"$XDG_CONFIG_HOME/ollie/prompts/agent-conductor.md"
"$XDG_CONFIG_HOME/ollie/prompts/agent-conductor.md",
"$XDG_CONFIG_HOME/ollie/prompts/user-preferences.md"
],
"autoLoad": [
"shell",
@ -20,7 +21,10 @@
"lsp_references",
"lsp_hover",
"lsp_symbols",
"lsp_diagnostics"
"lsp_diagnostics",
"memory_wake",
"memory_recall",
"memory_remember"
],
"temperature": 0.3,
"maxTokens": 16384

View File

@ -9,6 +9,7 @@
"shell",
"subagent_spawn",
"reasoning_think",
"memory_wake",
"memory_recall",
"memory_remember",
"file_read",

View File

@ -6,6 +6,7 @@
"autoLoad": [
"shell",
"reasoning_think",
"memory_wake",
"memory_recall",
"memory_remember",
"file_read",

View File

@ -14,6 +14,7 @@
"file_edit",
"file_glob",
"file_grep",
"memory_wake",
"memory_recall",
"memory_remember",
"lsp_definition",

View File

@ -9,6 +9,7 @@
"shell",
"subagent_spawn",
"reasoning_think",
"memory_wake",
"memory_recall",
"memory_remember",
"file_read",

View File

@ -12,6 +12,7 @@
"file_read",
"file_glob",
"file_grep",
"memory_wake",
"memory_recall",
"memory_remember"
],

View File

@ -9,6 +9,7 @@
"shell",
"subagent_spawn",
"reasoning_think",
"memory_wake",
"memory_recall",
"memory_remember",
"file_read",

View File

@ -4,6 +4,7 @@
],
"autoLoad": [
"reasoning_think",
"memory_wake",
"memory_recall",
"memory_remember",
"file_read",

View File

@ -14,6 +14,7 @@
"file_write",
"file_edit",
"subagent_spawn",
"memory_wake",
"memory_recall",
"memory_remember"
],

View File

@ -9,6 +9,7 @@
"shell",
"subagent_spawn",
"reasoning_think",
"memory_wake",
"memory_recall",
"memory_remember",
"file_read",

View File

@ -2,5 +2,33 @@
## Persistent memory
- Use `memory_recall` before acting on a topic that may have prior session context.
- Use `memory_remember` for durable decisions, outcomes, preferences, and non-obvious findings that should survive this session.
Ollie uses OptMem through `memory_wake`, `memory_recall`, and `memory_remember`.
### Startup
At the beginning of every top-level session, run `memory_wake` before any other tool call. Follow its output to completion. If it orders an OptMem compression, complete that compression before continuing. Do not run `memory_wake` from a sub-agent.
### Recall
Use `memory_recall` before consequential work when prior context may exist:
- repository or subsystem work;
- prior bugs, attempts, or design decisions;
- user preferences or workflow;
- long-running projects or named people;
- advice that may depend on earlier context.
Search with one or two distinctive terms. Do not search broadly or repeatedly. Treat retrieved memories as historical context, not current truth. Verify them against current files and the current request.
### Remember
Use `memory_remember` when you learn a durable fact that would otherwise be lost after this session:
- user preference;
- architectural decision and rationale;
- failed approach and why it failed;
- implementation outcome;
- non-obvious constraint;
- important final result.
Write one standalone fact per memory. Keep the title short, use stable tags, and avoid transcripts, temporary status, raw output, or redundant facts. Remember at task boundaries, not after every tool call. If the user corrects a memory, store the corrected fact rather than preserving both versions.

View File

@ -0,0 +1,11 @@
{
"description": "Load the bounded OptMem context at session startup.",
"prompt": "## memory_wake\n\nLoad the bounded persistent memory context. Run this once before other tools at the start of every top-level session. Follow any printed OptMem compression instruction before continuing. Do not run from a sub-agent.",
"cmd": "MEMORY_DIR=\"${XDG_DATA_HOME:-$HOME/.local/share}/ollie/optmem\" exec \"${XDG_CONFIG_HOME:-$HOME/.config}/ollie/optmem/memo\" wake",
"args": {
"type": "object",
"properties": {}
},
"tier": "cold",
"scope": "read"
}