memory-grep
Traditional search integration for retrieving exact technical facts and error logs.
Install
mkdir -p .claude/skills/memory-grep && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/13928" && unzip -o skill.zip -d .claude/skills/memory-grep && rm skill.zipInstalls to .claude/skills/memory-grep
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
传统检索引擎集成:利用 SmartGrep (BM25 + Fuzzy) 召回向量匹配难以处理的精确事实。当用户询问特定错误 ID、唯一代号、或特定的代码 API 细节时触发。Key capabilities
- →Retrieve precise facts when vector search fails
- →Perform weighted keyword retrieval using BM25
- →Conduct fuzzy matching for misspelled queries
- →Handle unique identifiers like error IDs or API details
- →Provide zero-cost synonyms for technical categories
- →Prioritize precise matches from SmartGrep in output
How it works
The skill uses BM25 and Fuzzy Trigram algorithms to retrieve precise facts, even with misspellings, and includes built-in synonyms for technical categories. It prioritizes these exact matches over vector search results.
Inputs & outputs
When to use memory-grep
- →Retrieving specific error codes
- →Finding unique configuration paths
- →Looking up exact technical terms
- →Debugging with stack traces
About this skill
🧠 Memory-Grep Skill
核心理念
当向量搜索失效时,回归传统关键词的力量。
向量检索的弱点(需要使用此 Skill 的场景):
- 唯一代号:如
REQ-001、BUG-004等,向量容易召回语义相近但不相关的文档。 - 特定术语:如
ClawRouter、PWA-Offline等,向量由于 embedding 的稀释,召回权重低。 - 错误堆栈:如特定的
Traceback信息,向量无法通过局部匹配精确定位。 - 配置文件路径:如
/etc/nginx/conf.d/等。
🛠️ 工作原理:传统检索主线
此 Skill 主要依赖后端 SmartGrepService 和 MemoryService 的 auto 模式:
- BM25 (Best Match 25):权重化关键词检索,对出现频率低但重要的词(如专有名词)赋予高分。
- Fuzzy Trigram:容错检索。即使你查询时有拼写错误(如把
PostgreSQL写成Postgre),也能召回。 - 零成本同义词:内置 14 个技术分类,搜“数据库”自动关联“db/mysql/postgres”,无需消耗 Token 调用 LLM。
🧭 执行指南
1. 识别场景
如果你(Agent)在上下文中看到 --- DEEP MEMORY (Tier-3 Vector) --- 召回的内容与用户的核心实体完全不符,你应意识到语义漂移。
2. 利用检索证据
在 get_context 召回的上下文中,请重点观察:
--- LOG EVIDENCE (SmartGrep) --- 区块。
[bm25]标记:表示词根绝对匹配(硬核事实)。[fuzzy]标记:表示高度相似匹配(可能含拼写纠正)。
3. 输出策略
在最终回答中,如果信息来自 SmartGrep,请优先信任其精确性。例如:
- ❌ “系统提到了一些关于数据库优化的内容。”
- ✅ “根据 SmartGrep 的日志证据,在
2026-03-18.md中记录了针对PostgreSQL的Index creation决策。”
🔗 协同关系
- 输入:
MemoryService.get_context(query)自动触发。 - 决策层:
memory_governance_service评估密度。 - 互补:作为
Deep Vector(Tier-3) 的高性能并行分支。
When not to use it
- →When semantic vector search is sufficient for the query
- →When the query does not involve specific identifiers, terms, or stack traces
- →When the user is not experiencing semantic drift in vector search results
Limitations
- →Primarily for retrieving exact facts, not conceptual information
- →Relies on keyword matching, not semantic understanding
- →Output is marked with `[bm25]` or `[fuzzy]` indicators
How it compares
This skill acts as a fallback to vector search, providing precise keyword-based retrieval for specific identifiers and terms, which vector search often struggles with due to semantic dilution.
Compared to similar skills
memory-grep side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| memory-grep (this skill) | 0 | 4mo | No flags | Intermediate |
| exploring-codebases | 0 | 5mo | Review | Intermediate |
| cellar | 0 | 4mo | Review | Intermediate |
| leetcode | 0 | 1mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
exploring-codebases
tmcfarlane
Semantic search for codebases. Locates matches with ripgrep and expands them into full AST nodes (functions/classes) using tree-sitter or pre-generated _MAP.md files. Returns complete, syntactically valid code blocks rather than fragmented lines. Use when looking for specific implementations, exampl
cellar
Quafadas
Look up the public API of any JVM dependency (Scala 3, Scala 2, Java) from the terminal. Returns type signatures, members, docstrings, and source code as Markdown.
leetcode
LokeshNanda
Log a solved (or attempted) coding problem into the DSA area with pattern analysis and honest review. Use whenever the user runs /leetcode, pastes a solution, shares a LeetCode/HackerRank/Codeforces problem they worked on, says "I just solved...", "review my solution", or "log this problem" — even i
deep-research
davidorex
Multi-agent parallel investigation for complex VCV Rack problems
recall-reasoning
parcadei
Search past reasoning for relevant decisions and approaches
math-progress-monitor
parcadei
Metacognitive check-ins during problem solving - detects when to pivot or persist