From agent-knowledge
Optimizes knowledge base searches using intent parameters like find-implementation or find-pattern, detail levels from minimal to full, and store filters for precise results with less context.
npx claudepluginhub chris-xperimntl/agent-knowledgeThis skill uses the workspace's default tool permissions.
Master the `search()` MCP tool parameters to get better results with less context usage.
Searches indexed library sources using vector, FTS, or hybrid modes with options for stores, limits, thresholds, and detail levels to find code implementations.
Enhances codebase searches via semantic query parsing, regex patterns, AST analysis, symbol lookups, and optimized grep/ripgrep with relevance ranking and context.
Retrieves codebase context via hybrid semantic/lexical search with neural reranking. Guides tool choice for implementations, symbol relationships, patterns, Q&A, and multi-repo queries.
Share bugs, ideas, or general feedback.
Master the search() MCP tool parameters to get better results with less context usage.
search(
query: string, // Your search query
intent?: SearchIntent, // What you're looking for
detail?: 'minimal' | 'contextual' | 'full', // How much context to return
limit?: number, // Max results (default: 10)
stores?: string[] // Which stores to search
)
The intent parameter helps the search engine rank results appropriately for your query type.
Looking for implementation details? Use find-implementation
search("Vue computed properties implementation", intent='find-implementation')
→ Prioritizes: actual class/function implementations
→ Ranks higher: ComputedRefImpl class, createComputed() function
→ Ranks lower: tests, documentation, examples
Looking for usage patterns? Use find-pattern
search("React hooks patterns", intent='find-pattern')
→ Prioritizes: example code, usage patterns, HOCs
→ Ranks higher: common patterns like useEffect cleanup
→ Ranks lower: internal implementation details
Looking for references? Use find-usage
search("useCallback usage", intent='find-usage')
→ Prioritizes: call sites, import statements
→ Ranks higher: files importing and using useCallback
→ Ranks lower: useCallback's own implementation
Looking for definitions/APIs? Use find-definition
search("FastAPI route decorator", intent='find-definition')
→ Prioritizes: function signatures, type definitions
→ Ranks higher: @app.get() decorator definition
→ Ranks lower: examples using the decorator
Looking for documentation? Use find-documentation
search("Pydantic validators documentation", intent='find-documentation')
→ Prioritizes: README, docstrings, comments
→ Ranks higher: markdown docs, inline documentation
→ Ranks lower: implementation code
If unsure, omit intent - the search engine will use hybrid ranking:
search("authentication middleware")
→ Returns mixed: implementations, patterns, usage, docs
→ Balanced ranking across all categories
The detail parameter controls how much code context is returned per result.
| Level | What You Get | Tokens/Result | Use When |
|---|---|---|---|
minimal | Summary, file path, relevance | ~100 | Browsing many results |
contextual | + imports, types, signatures | ~300 | Need interface context |
full | + complete code, all context | ~800 | Deep dive on specific file |
Step 1: Start Minimal
search(query, detail='minimal', limit=20)
→ Get 20 summaries (~2k tokens total)
→ Scan quickly for relevance
→ Identify top 3-5 candidates
Step 2: Evaluate Scores
Review relevance scores:
- 0.9-1.0: Excellent match (almost certainly relevant)
- 0.7-0.9: Strong match (very likely relevant)
- 0.5-0.7: Moderate match (possibly relevant)
- < 0.5: Weak match (probably not relevant)
Step 3: Selective Deep Dive
For top results (score > 0.7):
get_full_context(result_ids)
→ Fetch complete code only for relevant items
For moderate results (score 0.5-0.7):
search(refined_query, detail='contextual')
→ Try different query with more context
The limit parameter caps the number of results returned.
| Limit | Mode | Use When |
|---|---|---|
| 20-50 | Discovery | Exploring, not sure what exists |
| 10-20 | Standard | Specific question, multiple files |
| 3-5 | Targeted | Know exactly what you need |
Tip: Large limits work best with detail='minimal' to control tokens.
The stores parameter restricts search to specific knowledge stores.
✅ Filter when: You know the library, comparing specific libs, want focused results
❌ Don't filter when: Discovering where code lives, want cross-library perspective
# Check available stores first
list_stores()
# Then filter
search(query, stores=['fastapi', 'express'])
search(query, detail='minimal', limit=20)
→ Good for most discovery tasks
→ Review, then selectively fetch full context
search(query, intent='find-implementation', detail='full', limit=5, stores=['known-lib'])
→ When you know exactly what you're looking for
→ Fastest path to deep answer
search(query, detail='contextual', limit=10)
→ Good middle ground
→ See interfaces without full implementation
For advanced strategies and token optimization examples: