Mnemo
日本語
Knowledge memory system for Claude Code.
Mnemo helps Claude Code remember what you've learned across sessions. It stores lessons, pitfalls, patterns, and solutions in a local vector database, then automatically injects relevant knowledge into future sessions via semantic search.
Features
- Semantic Knowledge Search — Hybrid search (vector + full-text) with Reciprocal Rank Fusion scoring
- 7 Knowledge Types — lesson, pitfall, pattern, preference, solution, reference, procedure
- Confidence Decay — Old, unused knowledge fades naturally; frequently accessed knowledge stays fresh
- CLAUDE.md Auto-Generation — Automatically maintains project context from stored knowledge
- Session Continuity — Session logs bridge context between conversations
- User Profile — Persistent preferences (tools, coding style, communication language)
- Setup Procedures — Save and replay tool setup guides across projects
- Obsidian Export — Export your knowledge base to an Obsidian vault with wikilinks and frontmatter
- MCP + CLI — Use from Claude Code (MCP tools) or terminal (CLI commands)
Prerequisites
- Node.js 18+
- Ollama with
nomic-embed-text model (for local embedding generation)
Install Ollama from ollama.com, then:
ollama pull nomic-embed-text
Installation
npm install -g @techarm/mnemo
Setup
Project Setup (recommended for first-time users)
Set up Mnemo for a single project. This configures MCP server, hooks, and skills within the project:
cd your-project
mnemo init
This will:
- Add MCP server config to
.mcp.json
- Copy hook scripts to
.claude/hooks/
- Configure hooks in
.claude/settings.json
- Copy skill definitions to
.claude/skills/
- Register the project in Mnemo
Global Setup (all projects)
Set up Mnemo globally so it's available in all Claude Code sessions:
mnemo init --global
This will:
- Register MCP server globally via
claude mcp add --scope user
- Copy hook scripts to
~/.mnemo/hooks/
- Configure hooks in
~/.claude/settings.json
Note: Skills (slash commands) are project-specific. Run mnemo init in each project to add skills.
Removing Configuration
Remove Mnemo configuration from the current project:
mnemo cleanup
Remove global configuration:
mnemo cleanup --global
Note: cleanup removes configuration only. Your knowledge data in ~/.mnemo/ is preserved.
Usage
After running mnemo init, start Claude Code in your project. Mnemo works through three mechanisms:
- Hooks — Automatically inject context at session start and detect events during work
- MCP Tools — Claude Code calls Mnemo's tools behind the scenes (search, store, generate)
- Skills — Slash commands you invoke to capture and organize knowledge
Workflow
Session Start (automatic)
├─ Injects user profile (name, tools, coding style)
├─ Searches relevant knowledge for this project
└─ Shows last session summary
↓
During Work
├─ /learn — record insights and pitfalls
├─ /research — research topics, save as reference
├─ /setup — research tool setup, save as reusable procedure
├─ /doc — create/update project spec documents
└─ Auto-detection: commits → suggest marking tasks done
↓
Session End
└─ /session-review — extract learnings, update tasks & docs, write session log
Skills
/learn
Extract and record knowledge from the current session. Mnemo automatically determines the type (lesson, pitfall, pattern, solution, etc.).
You: /learn LanceDB query() has a default limit of 10
/research [topic]
Research a topic via web search or Context7 (library docs), then save findings as a reference with automatic expiration.
You: /research React 19 Server Components
/setup [tool]
First time: research tool setup → organize into steps → save as a permanent procedure.
Next time: retrieve and execute the saved procedure.
You: /setup oxlint
/doc [topic] or /doc init
Create or update project specification documents in .claude/docs/.
/doc init — Auto-generate initial docs by surveying the codebase
/doc authentication — Create or update a specific doc
/session-review
End-of-session review that:
- Extracts knowledge (pitfalls, lessons, solutions) from the session
- Marks completed tasks
- Checks if project docs need updating
- Regenerates CLAUDE.md with latest knowledge
- Writes a session log for next session continuity
/code-reuse-finder
Scan for duplicated code patterns and suggest refactoring opportunities.
CLI Usage
Record Knowledge