Skip to content

Improve agent protocol: peek-then-drill, concrete write triggers, mul…#2

Merged
bburda merged 1 commit intomainfrom
feat/agent-workflow-improvements
Feb 8, 2026
Merged

Improve agent protocol: peek-then-drill, concrete write triggers, mul…#2
bburda merged 1 commit intomainfrom
feat/agent-workflow-improvements

Conversation

@bburda
Copy link
Owner

@bburda bburda commented Feb 8, 2026

…ti-point recall

  • Rewrite README workflow: two-phase recall (peek brief → drill get), recall trigger table (6 moments), write trigger table (6 types), end-of-task writes
  • Update MCP tool descriptions to reinforce peek-then-drill pattern: memory_recall emphasizes format=brief first, memory_get is the drill step, memory_add lists concrete trigger points
  • Address real agent behavior problems: agents reading body on broad queries, only recalling at session start, not knowing when to write memories

…ti-point recall

- Rewrite README workflow: two-phase recall (peek brief → drill get), recall
  trigger table (6 moments), write trigger table (6 types), end-of-task writes
- Update MCP tool descriptions to reinforce peek-then-drill pattern:
  memory_recall emphasizes format=brief first, memory_get is the drill step,
  memory_add lists concrete trigger points
- Address real agent behavior problems: agents reading body on broad queries,
  only recalling at session start, not knowing when to write memories
@bburda bburda self-assigned this Feb 8, 2026
Copilot AI review requested due to automatic review settings February 8, 2026 18:35
@bburda bburda merged commit 3b5c883 into main Feb 8, 2026
9 checks passed
@bburda bburda deleted the feat/agent-workflow-improvements branch February 8, 2026 18:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the AI Memory Protocol guidance to encourage a consistent “peek-then-drill” recall workflow and to clarify concrete moments when agents should write new memories.

Changes:

  • Rewrites the README workflow into a two-phase recall process (peek brief → drill get) with explicit recall/write trigger tables.
  • Updates MCP tool descriptions (memory_recall, memory_get, memory_add) to reinforce the same usage pattern and writing triggers.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
src/ai_memory_protocol/mcp_server.py Updates MCP tool descriptions to guide agents toward brief recall first, then targeted gets, and more explicit add triggers.
README.md Expands the recommended workflow section with two-phase recall guidance plus recall/write trigger tables and updated context-window optimization bullets.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"Get full details of a specific memory by ID. "
"Always shows body text. Use after recall to drill into a specific memory."
"Get full details of a specific memory by ID — the DRILL step. "
"Always shows body text. Use AFTER memory_recall(format='brief') to read "
Copy link

Copilot AI Feb 8, 2026

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.

Suggested change
"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 "

Copilot uses AI. Check for mistakes.
Comment on lines +232 to +237
| 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` |
Copy link

Copilot AI Feb 8, 2026

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 the memory CLI prefix (and without the MCP tool name memory_recall). As written, these commands won’t work in the shell and are inconsistent with the rest of the README; please change them to memory recall ... (or explicitly label them as MCP tool invocations).

Suggested change
| 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` |
| Session start | `memory recall --format brief --limit 20 --sort newest` |
| New task or topic | `memory recall --tag topic:<X> --format brief` |
| Entering unfamiliar code | `memory recall --tag repo:<X> --type fact --format brief` |
| Before a design decision | `memory recall --tag topic:<X> --type dec` |
| When stuck or debugging | `memory recall <error keywords>` |
| Before implementing a pattern | `memory recall --tag intent:coding-style --type pref` |

Copilot uses AI. Check for mistakes.
| 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` |
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This row also uses recall ... without the memory prefix/tool name. For consistency (and copy/paste correctness), change to memory recall --tag intent:coding-style --type pref (or memory_recall if these are MCP calls).

Suggested change
| Before implementing a pattern | `recall --tag intent:coding-style --type pref` |
| Before implementing a pattern | `memory recall --tag intent:coding-style --type pref` |

Copilot uses AI. Check for mistakes.
- Use `--limit 10` when exploring broad topics
- Use `--expand 0` to skip graph expansion for exact matches only
- `recall` omits body by default — this is intentional, not a limitation
- **Peek** with `--format brief` → **drill** with `get <ID>` — this is the core pattern
Copy link

Copilot AI Feb 8, 2026

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.

Suggested change
- **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

Copilot uses AI. Check for mistakes.
"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. "
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description uses Python-style format='brief' wording, but MCP tool calls are JSON inputs. Consider rephrasing to match the schema (e.g., “call memory_recall with format set to brief”) to avoid clients interpreting it as code/CLI syntax.

Suggested change
"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 uses AI. Check for mistakes.
@bburda bburda restored the feat/agent-workflow-improvements branch February 8, 2026 19:13
@bburda bburda deleted the feat/agent-workflow-improvements branch February 8, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant