Memory
The rulebook memory system provides persistent context across AI sessions using hybrid search (BM25 keyword + HNSW vector) with zero native dependenci
Best use case
Memory is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
The rulebook memory system provides persistent context across AI sessions using hybrid search (BM25 keyword + HNSW vector) with zero native dependenci
Teams using Memory should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/memory/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How Memory Compares
| Feature / Agent | Memory | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
The rulebook memory system provides persistent context across AI sessions using hybrid search (BM25 keyword + HNSW vector) with zero native dependenci
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
<!-- MEMORY:START -->
## Persistent Memory System
The rulebook memory system provides persistent context across AI sessions using hybrid search (BM25 keyword + HNSW vector) with zero native dependencies.
### 3-Layer Search Pattern (Token-Efficient)
**Layer 1 — Compact Search**: Get brief results to scan relevance.
```
rulebook_memory_search({ query: "authentication bug", mode: "hybrid", limit: 10 })
→ Returns: { id, title, type, score, matchType, createdAt } per result (~50 tokens each)
```
**Layer 2 — Timeline**: Get chronological context around a memory.
```
rulebook_memory_timeline({ memoryId: "abc-123", window: 5 })
→ Returns: 5 memories before + anchor + 5 memories after (~200 tokens each)
```
**Layer 3 — Full Details**: Get complete content only for selected memories.
```
rulebook_memory_get({ ids: ["abc-123", "def-456"] })
→ Returns: Full memory objects with content (~500-1000 tokens each)
```
### Memory Types
- **bugfix**: Bug fixes, error resolutions
- **feature**: New features, additions
- **refactor**: Code restructuring
- **decision**: Architectural decisions (protected from eviction)
- **discovery**: Insights and learnings
- **change**: Updates and modifications
- **observation**: General observations
### CLI Commands
```bash
rulebook memory search "authentication bug" # Hybrid search
rulebook memory save "Decided to use sql.js" --type decision --title "DB Choice"
rulebook memory list --limit 10 # Recent memories
rulebook memory stats # Database statistics
rulebook memory cleanup --force # Force eviction
rulebook memory export --format json # Export all memories
```
### Configuration (.rulebook)
```json
{
"memory": {
"enabled": true,
"dbPath": ".rulebook-memory/memory.db",
"maxSizeBytes": 524288000,
"vectorDimensions": 256
}
}
```
### Privacy
Content between `<private>` and `</private>` tags is automatically stripped before storage.
<!-- MEMORY:END -->Related Skills
Vectorizer
Use MCP Vectorizer as primary data source for project information instead of file reading.
Synap
Use MCP Synap for persistent task and data storage across context windows.
Supabase
Use MCP Supabase for database operations, authentication, and storage.
Serena
Use MCP Serena for AI-powered development assistance, code analysis, and intelligent automation.
Playwright
Use MCP Playwright for automated browser testing and web automation.
Notion
Use MCP Notion for documentation, task tracking, and knowledge management.
Grafana
Use MCP Grafana for metrics visualization, alerting, and observability dashboards.
GitHub MCP
Monitor CI/CD workflows after every `git push` using GitHub MCP.
Figma
Use MCP Figma for design system integration, asset export, and design-to-code workflows.
Context7
Use MCP Context7 to access up-to-date library documentation before adding dependencies.
Atlassian
Use MCP Atlassian for Jira issues, Confluence documentation, and Bitbucket repositories.
Zig
Execute these commands after EVERY implementation (see AGENT_AUTOMATION module for full workflow).