search-memory
Search the hierarchical memory system for relevant memories. Searches across all tiers (working, episodic, semantic) and returns ranked results. Use for context retrieval and pattern matching. Keywords: memory, search, retrieve, recall, context, similarity.
When & Why to Use This Skill
The search-memory skill enables Claude agents to perform sophisticated retrieval across a hierarchical memory system, including working, episodic, and semantic tiers. By leveraging semantic search and ranked results, it provides the necessary context and pattern matching capabilities to ensure agent responses are grounded in historical interactions and long-term knowledge.
Use Cases
- Technical Troubleshooting: Retrieve historical incident reports and past resolutions from episodic memory to solve recurring infrastructure issues like OOM kills or pod crashes.
- Personalized Context Retrieval: Recall specific user preferences, past project details, and conversation history to provide highly tailored and consistent assistance over time.
- Knowledge Base Querying: Access semantic memory to find established facts, organizational policies, or technical documentation relevant to the current task.
- Pattern Recognition: Analyze similarities across different memory tiers to identify recurring workflow patterns and suggest optimized best practices based on previous successes.
| name | search-memory |
|---|---|
| description | > |
| context retrieval and pattern matching. Keywords | memory, search, retrieve, |
| domain | general |
| category | memory |
| requires-approval | false |
| confidence | 0.9 |
| mcp-servers | [] |
Search Memory
Preconditions
Before applying this skill, verify:
- Memory system is initialized
- Search query is meaningful
- Result limit is specified
Actions
1. Build Search Query
Prepare the semantic search query:
query: $search_text
user_id: $user_id
limit: $result_limit (default: 10)
2. Search Each Tier
Working Memory (exact + recency):
working_results = memory.search_working(query, limit=limit//3)
Episodic Memory (semantic + time decay):
episodic_results = memory.search_episodic(
query=query,
user_id=user_id,
limit=limit//3
)
Semantic Memory (semantic + permanence):
semantic_results = memory.search_semantic(
query=query,
user_id=user_id,
limit=limit//3
)
3. Merge and Rank Results
Combine results from all tiers:
- Apply tier-specific weights
- Remove duplicates
- Sort by relevance score
- Return top N results
Success Criteria
The skill succeeds when:
- All accessible tiers searched
- Results ranked by relevance
- Metadata includes source tier
Failure Handling
If search fails:
- Return partial results from available tiers
- Log which tiers were unreachable
- Include error context in response
Examples
Input Context:
{
"query": "nginx pod memory issues",
"user_id": "k8s-monitor",
"limit": 10
}
Expected Output:
{
"results": [
{
"content": "Pod nginx-abc crashed due to OOM. Fixed by increasing limits.",
"tier": "episodic",
"score": 0.89,
"timestamp": "2024-01-15T10:30:00Z"
},
{
"content": "Nginx pods require 1Gi memory minimum for production workloads",
"tier": "semantic",
"score": 0.85,
"pattern_type": "resource_requirement"
}
],
"total_searched": 3,
"tiers_searched": ["working", "episodic", "semantic"]
}