| name | coder-memory-recall |
| description | Retrieve universal coding patterns from vector database. Auto-invokes before complex tasks or when user says "--recall". Searches relevant role collections based on task context. |
Use Task tool with `subagent_type: "memory-only"` to keep main context clean.
The memory-only agent has ZERO access to Read/Write/Edit/Glob/Bash - it can ONLY use MCP memory tools. This prevents file reading pollution by design.
Search when: Non-obvious bugs, complex architectures, performance issues, unfamiliar domains, hard problems.
Skip when: Obvious tasks, basic file operations, standard workflows, problems solvable with basic knowledge.
**Step 1: Build semantic query**
Construct 2-3 sentences capturing: What is the problem? What is the technical context? What outcome is desired?
Example: "Need to implement rate limiting for REST API to prevent abuse. Backend service in Node.js with Express. Want proven pattern that prevents thundering herd."
Step 2: Detect relevant roles
Map task context to roles:
- backend: api, endpoint, database, server, auth
- frontend: react, vue, component, ui, css
- devops: deploy, docker, kubernetes, ci/cd
- ai: model, training, embedding, llm
- security: vulnerability, encryption, jwt
- mobile: ios, android, flutter, swift
- scrum-master: agile, sprint, standup, retrospective, planning
Default to ["universal"] if unclear. Can search multiple roles when task spans domains.
Step 3: Search previews
Use search_memory with query, roles=["detected_role", "universal"], limit=20.
Step 4: Analyze previews
Review returned previews (title + description + tags). Select 3-5 most relevant based on:
- Does title match problem domain?
- Does description indicate relevant solution?
- Do tags align with task?
- Is memory type appropriate? (episodic for debugging, procedural for workflows, semantic for patterns)
Step 5: Retrieve full content
Use batch_get_memories with selected doc_ids (no roles parameter needed).
Step 6: Present results
Format retrieved memories clearly. Let the main agent decide what to apply.
<role_mapping>
Available roles:
- universal: General patterns applicable across domains
- backend: API, endpoint, database, server, auth
- frontend: React, Vue, component, UI, CSS
- devops: Deploy, Docker, Kubernetes, CI/CD
- ai: Model, training, embedding, LLM
- security: Vulnerability, encryption, JWT
- mobile: iOS, Android, Flutter, Swift
- scrum-master: Agile, sprint, standup, retrospective, planning
- quant: Trading, backtesting, portfolio, risk
- ml: Machine learning, data science, modeling
Default to "universal" if unclear. Search multiple role collections when task spans domains.
</role_mapping>