Update agent instructions with PMLL integration and benchmarks - #29
Update agent instructions with PMLL integration and benchmarks#29drQedwards wants to merge 2 commits into
Conversation
… data Agent-Logs-Url: https://github.com/drQedwards/contextplus/sessions/84157936-1a55-4393-a487-fecf96972158 Co-authored-by: drQedwards <213266729+drQedwards@users.noreply.github.com>
…ns-file Update agent-instructions.md with PMLL integration and benchmark data
|
@drQedwards is attempting to deploy a commit to the ForLoopCodes' projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Here is agent_instructions.md that I use! The benchmark data has been omitted is all as the model doesn’t need to know benchmarks to do tasks . Context+ MCP - Agent WorkflowPurposeContext+ gives you structural awareness of the entire codebase without reading every file. These tools replace your default search and read operations — use them as your primary interface to the codebase. PMLL Short-Term KV Memory (5 Tools)Before every expensive MCP tool invocation, agents MUST use the PMLL short-term KV memory tools to check the cache. This eliminates redundant calls and accelerates task execution. These tools are provided by the
The
|
| Instead of… | MUST use… | Why |
|---|---|---|
grep, rg, ripgrep |
semantic_code_search |
Finds by meaning, not just string match |
find, ls, glob |
get_context_tree |
Returns structure with symbols + line ranges |
cat, head, read file |
get_file_skeleton first |
Signatures without wasting context on bodies |
| manual symbol tracing | get_blast_radius |
Traces all usages across the entire codebase |
| keyword search | semantic_identifier_search |
Ranked definitions + call chains |
| directory browsing | semantic_navigate |
Browse by meaning, not file paths |
Workflow
- Start every task with
get_context_treeorget_file_skeletonfor structural overview - Use
semantic_code_searchorsemantic_identifier_searchto find code by meaning - Run
get_blast_radiusBEFORE modifying or deleting any symbol - Prefer structural tools over full-file reads — only read full files when signatures are insufficient
- Run
run_static_analysisafter writing code - Use
search_memory_graphat task start for prior context,upsert_memory_nodeafter completing work
Execution Rules
- Think less, execute sooner: make the smallest safe change that can be validated quickly
- Batch independent reads/searches in parallel — do not serialize them
- If a command fails, diagnose once, pivot strategy, continue — cap retries to 1-2
- Keep outputs concise: short status updates, no verbose reasoning
Tool Reference
PMLL Short-Term KV Memory
| Tool | When to Use |
|---|---|
init |
Once at task start. Set up the PMLL silo and Q-promise chain for the session. |
peek |
Before every expensive MCP tool call. Non-destructive cache + Q-promise check. |
set |
After a cache miss. Store the result so future agents/subtasks skip the call. |
resolve |
When a Q-promise is pending. Check or fulfill the continuation. |
flush |
At task end. Clear all silo slots for the session. |
GraphQL
| Tool | When to Use |
|---|---|
graphql |
Execute GraphQL queries/mutations against the memory store with optional PMLL cache integration. |
Context+ Structural Tools
| Tool | When to Use |
|---|---|
get_context_tree |
Start of every task. Map files + symbols with line ranges. |
get_file_skeleton |
Before full reads. Get signatures + line ranges first. |
semantic_code_search |
Find relevant files by concept. |
semantic_identifier_search |
Find functions/classes/variables and their call chains. |
semantic_navigate |
Browse codebase by meaning, not directory structure. |
get_blast_radius |
Before deleting or modifying any symbol. |
get_feature_hub |
Browse feature graph hubs. Find orphaned files. |
run_static_analysis |
After writing code. Catch errors deterministically. |
propose_commit |
Validate and save file changes. |
list_restore_points |
See undo history. |
undo_change |
Revert a change without touching git. |
Long-Term Memory Graph
| Tool | When to Use |
|---|---|
upsert_memory_node |
Create/update memory nodes (concept, file, symbol, note). |
create_relation |
Create typed edges between memory nodes. |
search_memory_graph |
Semantic search + graph traversal across neighbors. |
prune_stale_links |
Remove decayed edges and orphan nodes. |
add_interlinked_context |
Bulk-add nodes with auto-similarity linking. |
retrieve_with_traversal |
Walk outward from a node, return scored neighbors. |
Solution Engine
| Tool | When to Use |
|---|---|
resolve_context |
Unified context lookup — checks short-term KV first, falls back to long-term semantic graph. |
promote_to_long_term |
Promote a frequently-accessed short-term KV entry to the long-term memory graph. |
memory_status |
Get a unified view of both short-term (KV cache) and long-term (semantic graph) memory layers. |
Anti-Patterns
- Reading entire files without checking the skeleton first
- Deleting functions without checking blast radius
- Running independent commands sequentially when they can be parallelized
- Repeating failed commands without changing approach
- Calling expensive MCP tools without calling
peekfirst to check the cache - Forgetting to call
initat task start orflushat task end, causing silent cache misses or stale data across sessions - Storing frequently-accessed payloads only in short-term KV instead of promoting them to long-term memory with
promote_to_long_term - Calling
search_memory_graphorretrieve_with_traversaldirectly instead of usingresolve_context, which checks both memory layers in one call - Ignoring Q-promise
pendingstatus frompeekand re-issuing the same expensive call instead of waiting withresolve
|
After reviewing PR #30 is what we want. I am going to close out this PR. |
This pull request significantly expands the
agent-instructions.mddocumentation to introduce and prioritize the use of PMLL short-term key-value (KV) memory tools, integrates a new solution engine, and provides benchmark data to justify the combined approach. It also updates anti-patterns to reflect these new best practices.PMLL Short-Term KV Memory Integration:
init,peek,set,resolve,flush), their purpose, and a recommended usage pattern to avoid redundant expensive MCP tool calls.peekbefore every expensive call and session management withinit/flush.Solution Engine and Long-Term Memory:
resolve_context,promote_to_long_term, andmemory_status, explaining their unified role in context lookup and memory management.Benchmarks and Best Practices: