-
Notifications
You must be signed in to change notification settings - Fork 0
Improve agent protocol: peek-then-drill, concrete write triggers, mul… #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -209,17 +209,66 @@ Tags use `prefix:value` format for consistent discovery: | |||||
|
|
||||||
| ### Recommended Workflow | ||||||
|
|
||||||
| 1. **RECALL before working** — always check existing knowledge before starting a task | ||||||
| 2. **ADD after learning** — record discoveries, decisions, and observations immediately | ||||||
| 3. **SUPERSEDE, don't edit** — when knowledge changes, add a new memory and deprecate the old one | ||||||
| 4. **CHECK STALENESS periodically** — use `memory stale` to maintain knowledge quality | ||||||
| #### 1. READ — Peek then Drill (two-phase recall) | ||||||
|
|
||||||
| Always use a **two-phase** approach. Never go straight to body text on broad queries. | ||||||
|
|
||||||
| **Phase A — Peek** (scan titles, zero body text): | ||||||
| ```bash | ||||||
| memory recall --tag topic:gateway --format brief --expand 0 | ||||||
| ``` | ||||||
| Returns `[ID] Title (confidence)` one-liners. Minimal tokens. Do this FIRST. | ||||||
|
|
||||||
| **Phase B — Drill** (read full body of specific memories): | ||||||
| ```bash | ||||||
| memory get DEC_handler_context_pattern | ||||||
| ``` | ||||||
| Only after peeking — pick the 2-3 most relevant IDs and `get` them individually. | ||||||
|
|
||||||
| **When to recall** — recall is NOT just a session-start ritual. Recall at each of these moments: | ||||||
|
|
||||||
| | Trigger | What to recall | | ||||||
| |---------|---------------| | ||||||
| | Session start | `recall --format brief --limit 20 --sort newest` | | ||||||
| | New task or topic | `recall --tag topic:<X> --format brief` | | ||||||
| | Entering unfamiliar code | `recall --tag repo:<X> --type fact --format brief` | | ||||||
| | Before a design decision | `recall --tag topic:<X> --type dec` | | ||||||
| | When stuck or debugging | `recall <error keywords>` | | ||||||
| | Before implementing a pattern | `recall --tag intent:coding-style --type pref` | | ||||||
|
||||||
| | Before implementing a pattern | `recall --tag intent:coding-style --type pref` | | |
| | Before implementing a pattern | `memory recall --tag intent:coding-style --type pref` | |
Copilot
AI
Feb 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In “drill with get <ID>” the command is missing the memory prefix (elsewhere you use memory get ...). Consider changing to memory get <ID> so readers can copy/paste the command and it stays consistent with the CLI reference.
| - **Peek** with `--format brief` → **drill** with `get <ID>` — this is the core pattern | |
| - **Peek** with `--format brief` → **drill** with `memory get <ID>` — this is the core pattern |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -67,7 +67,8 @@ def create_mcp_server(name: str = "ai-memory-protocol") -> Server: | |||||
| description=( | ||||||
| "Search memories by free text query and/or tags. " | ||||||
| "Returns matching memories formatted for context windows. " | ||||||
| "Use this FIRST to check existing knowledge before starting work." | ||||||
| "Use format='brief' FIRST to peek at titles, then memory_get to drill into specific IDs. " | ||||||
|
||||||
| "Use format='brief' FIRST to peek at titles, then memory_get to drill into specific IDs. " | |
| "First, call this tool with the \"format\" field set to \"brief\" to peek at titles, then call memory_get to drill into specific IDs. " |
Copilot
AI
Feb 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
memory_recall(format='brief') is Python-call syntax; MCP callers provide JSON arguments. Reword to align with actual tool invocation (e.g., “after calling memory_recall with format=brief”) so the guidance is unambiguous.
| "Always shows body text. Use AFTER memory_recall(format='brief') to read " | |
| "Always shows body text. Use AFTER calling memory_recall with format=brief to read " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this table the examples use
recall ...without thememoryCLI prefix (and without the MCP tool namememory_recall). As written, these commands won’t work in the shell and are inconsistent with the rest of the README; please change them tomemory recall ...(or explicitly label them as MCP tool invocations).