Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AgentKits MemoryRecall the patterns we used for handling API errors"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Features
Feature | Benefit |
100% Local | All data stays on your machine. No cloud, no API keys, no accounts |
Blazing Fast | Native SQLite (better-sqlite3) = instant queries, zero latency |
Zero Config | Works out of the box. No database setup required |
Multi-Platform | Claude Code, Cursor, Windsurf, Cline, OpenCode — one setup command |
MCP Server | 9 tools: save, search, timeline, details, recall, list, update, delete, status |
Auto-Capture | Hooks capture session context, tool usage, summaries automatically |
AI Enrichment | Background workers enrich observations with AI-generated summaries |
Vector Search | sqlite-vec semantic similarity with multilingual embeddings (100+ languages) |
Web Viewer | Browser UI to view, search, add, edit, delete memories |
3-Layer Search | Progressive disclosure saves ~87% tokens vs fetching everything |
Lifecycle Mgmt | Auto-compress, archive, and clean up old sessions |
Export/Import | Backup and restore memories as JSON |
How It Works
Setup once —
npx @aitytech/agentkits-memoryconfigures your platformAuto-capture — Hooks record decisions, tool usage, and summaries as you work
Context injection — Next session starts with relevant history from past sessions
Background processing — Workers enrich observations with AI, generate embeddings, compress old data
Search anytime — AI uses MCP tools (
memory_search→memory_details) to find past context
All data stays in .claude/memory/memory.db on your machine. No cloud. No API keys required.
Design Decisions That Matter
Most memory tools scatter data across markdown files, require Python runtimes, or send your code to external APIs. AgentKits Memory makes fundamentally different choices:
Design Choice | Why It Matters |
Single SQLite database | One file ( |
Native Node.js, zero Python | Runs wherever Node runs. No conda, no pip, no virtualenv. Same language as your MCP server — one |
Token-efficient 3-layer search | Search index first (~50 tokens/result), then timeline context, then full details. Only fetch what you need. Other tools dump entire memory files into context, burning tokens on irrelevant content |
Auto-capture via hooks | Decisions, patterns, and errors are recorded as they happen — not after you remember to save them. Session context injection happens automatically on next session start |
Local embeddings, no API calls | Vector search uses a local ONNX model (multilingual-e5-small). Semantic search works offline, costs nothing, and supports 100+ languages |
Background workers | AI enrichment, embedding generation, and compression run asynchronously. Your coding flow is never blocked |
Multi-platform from day one | One |
Structured observation data | Tool usage is captured with type classification (read/write/execute/search), file tracking, intent detection, and AI-generated narratives — not raw text dumps |
No process leaks | Background workers self-terminate after 5 minutes, use PID-based lock files with stale-lock cleanup, and handle SIGTERM/SIGINT gracefully. No zombie processes, no orphaned workers |
No memory leaks | Hooks run as short-lived processes (not long-running daemons). Database connections close on shutdown. Embedding subprocess has bounded respawn (max 2), pending request timeouts, and graceful cleanup of all timers and queues |
Web Viewer
View and manage your memories through a modern web interface.
Then open http://localhost:1905 in your browser.
Session List
Browse all sessions with timeline view and activity details.

Memory List
Browse all stored memories with search and namespace filtering.

Add Memory
Create new memories with key, namespace, type, content, and tags.

Memory Details
View full memory details with edit and delete options.

Manage Embeddings
Generate and manage vector embeddings for semantic search.

Quick Start
Option 1: Claude Code Plugin Marketplace (Recommended for Claude Code)
Install as a plugin with one command — no manual configuration needed:
This installs hooks, MCP server, and memory workflow skill automatically. Restart Claude Code after installation.
Option 2: Automated Setup (All Platforms)
This auto-detects your platform and configures everything: MCP server, hooks (Claude Code/OpenCode), rules files (Cursor/Windsurf/Cline), and downloads the embedding model.
Target a specific platform:
Option 3: Manual MCP Configuration
If you prefer manual setup, add to your MCP config:
Config file locations:
Claude Code:
.claude/settings.json(embedded inmcpServerskey)Cursor:
.cursor/mcp.jsonWindsurf:
.windsurf/mcp.jsonCline / OpenCode:
.mcp.json(project root)
3. MCP Tools
Once configured, your AI assistant can use these tools:
Tool | Description |
| Check memory system status (call first!) |
| Save decisions, patterns, errors, or context |
| [Step 1] Search index — lightweight IDs + titles (~50 tokens/result) |
| [Step 2] Get temporal context around a memory |
| [Step 3] Get full content for specific IDs |
| Quick topic overview — grouped summary |
| List recent memories |
| Update existing memory content or tags |
| Remove outdated memories |
Progressive Disclosure (Token-Efficient Search)
AgentKits Memory uses a 3-layer search pattern that saves ~70% tokens compared to fetching full content upfront.
How It Works
Example Workflow
Token Savings
Approach | Tokens Used |
Old: Fetch all content | ~500 tokens × 10 results = 5000 tokens |
New: Progressive disclosure | 50 × 10 + 500 × 2 = 1500 tokens |
Savings | 70% reduction |
CLI Commands
Programmatic Usage
Auto-Capture Hooks
Hooks automatically capture your AI coding sessions (Claude Code and OpenCode only):
Hook | Trigger | Action |
| Session Start | Injects previous session context + memory status |
| User Prompt | Initializes/resumes session, records prompts |
| After Tool Use | Captures tool usage with intent detection |
| Session End | Generates structured session summary |
| Session Start | Displays memory status to user (stderr) |
Setup hooks:
What gets captured automatically:
File reads/writes with paths
Code changes as structured diffs (before → after)
Developer intent (bugfix, feature, refactor, investigation, etc.)
Session summaries with decisions, errors, and next steps
Multi-prompt tracking within sessions
Multi-Platform Support
Platform | MCP | Hooks | Rules File | Setup |
Claude Code |
| ✅ Full | CLAUDE.md (skill) |
|
Cursor |
| — |
|
|
Windsurf |
| — |
|
|
Cline |
| — |
|
|
OpenCode |
| ✅ Full | — |
|
MCP Server works with all platforms (memory tools via MCP protocol)
Hooks provide auto-capture on Claude Code and OpenCode
Rules files teach Cursor/Windsurf/Cline the memory workflow
Memory data always stored in
.claude/memory/(single source of truth)
Background Workers
After each session, background workers process queued tasks:
Worker | Task | Description |
| Embeddings | Generate vector embeddings for semantic search |
| AI Enrichment | Enrich observations with AI-generated summaries, facts, concepts |
| Compression | Compress old observations (10:1–25:1) and generate session digests (20:1–100:1) |
Workers run automatically after session end. Each worker:
Processes up to 200 items per run
Uses lock files to prevent concurrent execution
Auto-terminates after 5 minutes (prevents zombies)
Retries failed tasks up to 3 times
AI Provider Configuration
AI enrichment uses pluggable providers. Default is claude-cli (no API key needed).
Provider | Type | Default Model | Notes |
Claude CLI |
|
| Uses |
OpenAI |
|
| Any OpenAI model |
Google Gemini |
|
| Google AI Studio key |
OpenRouter |
| any | Set |
GLM (Zhipu) |
| any | Set |
Ollama |
| any | Set |
Option 1: Environment Variables
Option 2: Persistent Settings
Priority: Environment variables override settings.json. Settings.json overrides defaults.
Lifecycle Management
Manage memory growth over time:
Stage | What Happens |
Compress | AI-compresses observations, generates session digests |
Archive | Marks old sessions as archived (excluded from context) |
Delete | Removes archived sessions (opt-in, requires |
Export / Import
Backup and restore your project memories:
Export format includes sessions, observations, prompts, and summaries.
Memory Categories
Category | Use Case |
| Architecture decisions, tech stack picks, trade-offs |
| Coding conventions, project patterns, recurring approaches |
| Bug fixes, error solutions, debugging insights |
| Project background, team conventions, environment setup |
| Auto-captured session observations |
Storage
Memories are stored in .claude/memory/ within your project directory.
CJK Language Support
AgentKits Memory has automatic CJK support for Chinese, Japanese, and Korean text search.
Zero Configuration
When better-sqlite3 is installed (default), CJK search works automatically:
How It Works
Native SQLite: Uses
better-sqlite3for maximum performanceTrigram tokenizer: FTS5 with trigram creates 3-character sequences for CJK matching
Smart fallback: Short CJK queries (< 3 chars) automatically use LIKE search
BM25 ranking: Relevance scoring for search results
Advanced: Japanese Word Segmentation
For advanced Japanese with proper word segmentation, optionally use lindera:
Requires lindera-sqlite build.
API Reference
ProjectMemoryService
Methods
Method | Description |
| Initialize the memory service |
| Shutdown and persist changes |
| Store a memory entry |
| Get entry by ID |
| Get entry by namespace and key |
| Update an entry |
| Delete an entry |
| Query entries with filters |
| Semantic similarity search |
| Count entries |
| List all namespaces |
| Get statistics |
Code Quality
AgentKits Memory is thoroughly tested with 970 unit tests across 21 test suites.
Metric | Coverage |
Statements | 90.29% |
Branches | 80.85% |
Functions | 90.54% |
Lines | 91.74% |
Test Categories
Category | Tests | What's Covered |
Core Memory Service | 56 | CRUD, search, pagination, categories, tags, import/export |
SQLite Backend | 65 | Schema, migrations, FTS5, transactions, error handling |
sqlite-vec Vector Index | 47 | Insert, search, delete, persistence, edge cases |
Hybrid Search | 44 | FTS + vector fusion, scoring, ranking, filters |
Token Economics | 27 | 3-layer search budgets, truncation, optimization |
Embedding System | 63 | Cache, subprocess, local models, CJK support |
Hook System | 502 | Context, session-init, observation, summarize, AI enrichment, service lifecycle, queue workers, adapters, types |
MCP Server | 48 | All 9 MCP tools, validation, error responses |
CLI | 34 | Platform detection, rules generation |
Integration | 84 | End-to-end flows, embedding integration, multi-session |
Requirements
Node.js LTS: 18.x, 20.x, or 22.x (recommended)
MCP-compatible AI coding assistant
Node.js Version Notes
This package uses better-sqlite3 which requires native binaries. Prebuilt binaries are available for LTS versions only.
Node Version | Status | Notes |
18.x LTS | ✅ Works | Prebuilt binaries |
20.x LTS | ✅ Works | Prebuilt binaries |
22.x LTS | ✅ Works | Prebuilt binaries |
19.x, 21.x, 23.x | ⚠️ Requires build tools | No prebuilt binaries |
Using Non-LTS Versions (Windows)
If you must use a non-LTS version (19, 21, 23), install build tools first:
Option 1: Visual Studio Build Tools
Option 2: windows-build-tools (npm)
Option 3: Chocolatey
See node-gyp Windows guide for more details.
AgentKits Ecosystem
AgentKits Memory is part of the AgentKits ecosystem by AityTech - tools that make AI coding assistants smarter.
Product | Description | Link |
AgentKits Engineer | 28 specialized agents, 100+ skills, enterprise patterns | |
AgentKits Marketing | AI-powered marketing content generation | |
AgentKits Memory | Persistent memory for AI assistants (this package) |
Star History
License
MIT