semantic-memory-mcp
Skill15 starsChanged 2 months agoMITView on GitHub
Proactive use of semantic-memory MCP tools (semantic_search, semantic_recall). TRIGGER when: an agent should search vector memory for prior insights mid-task. SKIP: file-based 3-tier memory (use agent-memory); storing a new memory (use semantic-memory-store).
In this repository38 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- agent-commsSkill
- agent-memorySkill
- api-designSkill
- context-engineeringSkill
- database-optimizationSkill
- distillSkill
- docker-templatesSkill
- error-handlingSkill
- github-actions-templateSkill
- git-operationsSkill
- logging-standardsSkill
- mcp-toolsSkill
- memorySkill
- monitoring-observabilitySkill
- mui-stylingSkill
- pattern-recognitionSkill
- planning-methodologySkill
- python-patternsSkill
- quality-validationSkill
- react-patternsSkill
- research-methodologySkill
- security-review-checklistsSkill
- semantic-memory-storeSkill
- skill-authoringSkill
- sofa-searchSkill
- spec-designSkill
- spec-developSkill
- spec-researchSkill
- spec-reviewSkill
- spec-workflowSkill
- state-managementSkill
- systematic-debuggingSkill
- testing-strategySkill
- ui-ux-pro-maxSkill
- verification-before-completionSkill
- watch-patternsSkill
- worktree-managementSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
Write agents (search/recall/store): developer, architect, debugger, analyst, researcher, reviewer, optimizer.
- Very specific: line 22
Read-only agents: tech-writer, devops, gitops, mcp-builder, prompt-engineer.
- Distinctive: line 46
Use natural language queries describing the problem, not code snippets
- Distinctive: line 47
Keep queries under 100 words for best embedding match
- Very specific: line 48
Use semantic_search when you want structured results with metadata
- Very specific: line 49
Use semantic_recall when you want a quick formatted summary
- Distinctive: line 87
Write content as a self-contained insight another agent can understand without context
- Very specific: line 89
Use descriptive tags for filtering (3-5 tags)
- Distinctive: line 91
Keep content under 500 chars when possible (max 2000)
- Distinctive: line 118
If all four are YES, store it.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Semantic Memory MCP Usage
You have access to a subset of the 13 memory MCP tools, depending on your agent's tier. Use the search/recall tools PROACTIVELY -- do not wait to be asked. Only call a tool your agent's tools: frontmatter actually grants — see the tier table below and the mcp-tools skill for the full 13-tool inventory.
Tools Available
| Tool | Purpose | All agents | Write agents only | Notes agents only |
search_context | Search ingested context chunks | Yes | -- | -- |
semantic_search | Find memories by similarity query | Yes | -- | -- |
semantic_recall | Get formatted memories for current context | Yes | -- | -- |
semantic_store | Store a new memory with embedding | -- | Yes | -- |
store_note / read_note / list_notes | Persist/read/list note documents | -- | -- | Yes |
trigger_ingest | Queue one just-written document (corpus + relative_path) for immediate indexing (~3s to become searchable) instead of waiting up to 15 minutes | -- | -- | Yes |
Write agents (search/recall/store): developer, architect, debugger, analyst, researcher, reviewer, optimizer.
Read-only agents: tech-writer, devops, gitops, mcp-builder, prompt-engineer.
Notes + trigger_ingest agents: architect, researcher only — trigger_ingest is deliberately withheld from the rest of the write tier because it's only useful paired with store_note (otherwise you're re-indexing a document you didn't write), and each call costs an LLM context-gen call.
trigger_ingest is path-scoped to a single document — it cannot trigger a full
backfill — and it is fire-and-forget: it returns once the document is queued,
not once indexing completes. Don't expect a synchronous "done" result; the
document becomes searchable a few seconds later.
Uwaga: Jesli ten skill jest aktywny w repozytorium bez MCP server
memory, pomin te instrukcje. Agent bez dostepu domcp__memory__*toolow powinien po prostu pracowac bez pamieci semantycznej -- file-based fallback w.scaffolding/agent-memory/wciaz dziala.
WHEN to Search Memory
At task start (MANDATORY for these scenarios):
- You encounter an unfamiliar pattern or module you haven't worked with before
- The task involves a subsystem with known quirks (deployment, async, database)
- You are debugging and the error message or stack trace is unclear
- You are making an architecture or design decision
Mid-task (RECOMMENDED):
- You hit an unexpected error -- search for the error message or pattern
- You are about to implement a workaround -- check if someone already solved it
- You need to understand why a decision was made in the codebase
How to search effectively:
- Use natural language queries describing the problem, not code snippets
- Keep queries under 100 words for best embedding match
- Use
semantic_searchwhen you want structured results with metadata - Use
semantic_recallwhen you want a quick formatted summary - Always pass
project_idso results are scoped to the current repository. Thememory-project-idSessionStart hook injects the value to use (ascaffold:<hash>derived from the git remote); pass that exact value to everysemantic_search/semantic_recall/semantic_storecall. If noproject_idis provided in session context, the backend uses a shareddefaultnamespace. Note:project_id(this section's mem0 axis) is distinct fromcorpus(used bysearch_context/notes/trigger_ingest, one of three NFS share directories) — don't conflate the two.
Examples:
semantic_recall(context="SQLAlchemy async session event loop issues", project_id="scaffold:ab12cd34ef56")
semantic_search(query="deployment nginx proxy configuration gotchas", project_id="scaffold:ab12cd34ef56")
semantic_search(query="Redis task queue timeout handling", project_id="scaffold:ab12cd34ef56", agent_name="debugger")WHEN to Store Memory (Write Agents Only)
MUST store (after confirming the insight is correct):
- Root cause of a non-obvious bug -- especially if it took >5 minutes to find
- Architecture decision with rationale -- why X was chosen over Y
- Integration gotcha -- something that fails silently or behaves unexpectedly
- Pattern that deviates from convention -- and why the deviation exists
SHOULD store:
- Workaround for a known limitation -- with context on when it applies
- Performance finding -- specific numbers or thresholds discovered
- Configuration requirement -- non-obvious setup step that blocks progress
Do NOT store:
- Task-specific context (use conversation memory instead)
- Information already in CLAUDE.md, docs/, or KNOWLEDGE.md
- Speculative or unverified conclusions
- Raw code snippets >500 chars (summarize the insight instead)
- Routine operations (file created, test passed, etc.)
How to store effectively:
- Write content as a self-contained insight another agent can understand without context
- Include the why, not just the what
- Use descriptive
tagsfor filtering (3-5 tags) - Set
content_typecorrectly:learning,error,pattern, ordecision - Keep content under 500 chars when possible (max 2000)
Examples:
semantic_store(
content="TextBuffer in step event pipeline buffers assistant_text and thinking events but passes all others through immediately. If you add a new bufferable event type, you must add it to TextBuffer._BUFFERED_TYPES or events will be lost silently.",
agent_name="debugger",
content_type="pattern",
tags=["step-events", "text-buffer", "pipeline"]
)
semantic_store(
content="When creating async SQLAlchemy engine in a worker thread, you must create a NEW engine+session bound to that thread's event loop. Reusing the module-level async_session_maker causes 'attached to a different loop' errors.",
agent_name="developer",
content_type="error",
tags=["sqlalchemy", "async", "threading", "event-loop"]
)Quality Gate
Before storing, self-check:
- Is this insight reusable by future agents? (not task-specific)
- Is it verified through actual experience? (not speculative)
- Is it not already documented in CLAUDE.md, docs/, or agent-memory files?
- Would it save another agent >5 minutes of investigation?
If all four are YES, store it. Otherwise, skip or use file-based conversation memory.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

