AgentKits Memory

AgentKits Memory

agentkits-memory•byaitytech

AgentKits Memory is a local persistent memory system for AI coding assistants that exposes memory tools through an MCP server.

License: MIT•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Offers an MCP server with memory tools for saving decisions, patterns, errors, and context, and updating memory content or tags.
  • •Persists memories locally in a single SQLite database on the user's machine.
  • •Automatically captures decisions, patterns, errors, and tool usage, and injects session context on the next session start.
  • •Uses a local ONNX model for offline semantic vector search.

BEST FOR

  • •Remembering architecture decisions, coding patterns, and bug fixes across AI coding sessions.
  • •Starting a later session with relevant history from past sessions.
  • •Viewing and managing stored memories through a browser interface.

ABOUT AGENTKITS-MEMORY

AgentKits Memory is cataloged as an MCP server attributed to aitytech. AgentKits Memory is a local persistent memory system for AI coding assistants that exposes memory tools through an MCP server. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for AgentKits Memory are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Where are memories stored?

Memories are stored in `.claude/memory/` within your project directory.

Does AgentKits Memory require cloud services or API keys?

No; all data stays on your machine, with no cloud or API keys required.

Can memories be exported and imported?

Yes; the system supports backup and restore of memories as JSON.

Upstream README

View this exact version on GitHub

README.md · 454a4be6ed4b · Fetched 2026-11-13 08:12:17 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

AgentKits Logo

AgentKits Memory

by AityTech

npm License Claude Code Cursor Windsurf Cline OpenCode
Tests Coverage

Persistent Memory System for AI Coding Assistants

Your AI assistant forgets everything between sessions. AgentKits Memory fixes that.
Decisions, patterns, errors, and context — all persisted locally via MCP.

Website • Docs • Quick Start • How It Works • Platforms • CLI • Web Viewer

English · 简体中文 · 日本語 · 한국어 · Español · Deutsch · Français · Português · Tiếng Việt · Русский · العربية


Features

FeatureBenefit
100% LocalAll data stays on your machine. No cloud, no API keys, no accounts
Blazing FastNative SQLite (better-sqlite3) = instant queries, zero latency
Zero ConfigWorks out of the box. No database setup required
Multi-PlatformClaude Code, Cursor, Windsurf, Cline, OpenCode — one setup command
MCP Server9 tools: save, search, timeline, details, recall, list, update, delete, status
Auto-CaptureHooks capture session context, tool usage, summaries automatically
AI EnrichmentBackground workers enrich observations with AI-generated summaries
Vector Searchsqlite-vec semantic similarity with multilingual embeddings (100+ languages)
Web ViewerBrowser UI to view, search, add, edit, delete memories
3-Layer SearchProgressive disclosure saves ~87% tokens vs fetching everything
Lifecycle MgmtAuto-compress, archive, and clean up old sessions
Export/ImportBackup and restore memories as JSON

How It Works

Session 1: "Use JWT for auth"          Session 2: "Add login endpoint"
┌──────────────────────────┐          ┌──────────────────────────┐
│  You code with AI...     │          │  AI already knows:       │
│  AI makes decisions      │          │  ✓ JWT auth decision     │
│  AI encounters errors    │   ───►   │  ✓ Error solutions       │
│  AI learns patterns      │  saved   │  ✓ Code patterns         │
│                          │          │  ✓ Session context        │
└──────────────────────────┘          └──────────────────────────┘
         │                                      ▲
         ▼                                      │
    .claude/memory/memory.db  ──────────────────┘
    (SQLite, 100% local)
  1. Setup once — npx @aitytech/agentkits-memory configures your platform
  2. Auto-capture — Hooks record decisions, tool usage, and summaries as you work
  3. Context injection — Next session starts with relevant history from past sessions
  4. Background processing — Workers enrich observations with AI, generate embeddings, compress old data
  5. 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 ChoiceWhy It Matters
Single SQLite databaseOne file (memory.db) holds everything — memories, sessions, observations, embeddings. No scattered files to sync, no merge conflicts, no orphaned data. Backup = copy one file
Native Node.js, zero PythonRuns wherever Node runs. No conda, no pip, no virtualenv. Same language as your MCP server — one npx command, done
Token-efficient 3-layer searchSearch 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 hooksDecisions, 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 callsVector search uses a local ONNX model (multilingual-e5-small). Semantic search works offline, costs nothing, and supports 100+ languages
Background workersAI enrichment, embedding generation, and compression run asynchronously. Your coding flow is never blocked
Multi-platform from day oneOne --platform=all flag configures Claude Code, Cursor, Windsurf, Cline, and OpenCode simultaneously. Same memory database, different editors
Structured observation dataTool usage is captured with type classification (read/write/execute/search), file tracking, intent detection, and AI-generated narratives — not raw text dumps
No process leaksBackground 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 leaksHooks 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.

npx @aitytech/agentkits-memory web

Then open http://localhost:1905 in your browser.

Session List

Browse all sessions with timeline view and activity details.

Session List

Memory List

Browse all stored memories with search and namespace filtering.

Memory List

Add Memory

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

Add Memory

Memory Details

View full memory details with edit and delete options.

Memory Detail

Manage Embeddings

Generate and manage vector embeddings for semantic search.

Manage Embeddings


Quick Start

Install as a plugin with one command — no manual configuration needed:

/plugin marketplace add aitytech/agentkits-memory
/plugin install agentkits-memory@agentkits-memory

This installs hooks, MCP server, and memory workflow skill automatically. Restart Claude Code after installation.

Option 2: Automated Setup (All Platforms)

npx @aitytech/agentkits-memory

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:

npx @aitytech/agentkits-memory --platform=cursor
npx @aitytech/agentkits-memory --platform=windsurf,cline
npx @aitytech/agentkits-memory --platform=all

Option 3: Manual MCP Configuration

If you prefer manual setup, add to your MCP config:

{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["-y", "@aitytech/agentkits-memory", "server"]
    }
  }
}

Config file locations:

  • Claude Code: .claude/settings.json (embedded in mcpServers key)
  • Cursor: .cursor/mcp.json
  • Windsurf: .windsurf/mcp.json
  • Cline / OpenCode: .mcp.json (project root)

3. MCP Tools

Once configured, your AI assistant can use these tools:

ToolDescription
memory_statusCheck memory system status (call first!)
memory_saveSave decisions, patterns, errors, or context
memory_search[Step 1] Search index — lightweight IDs + titles (~50 tokens/result)
memory_timeline[Step 2] Get temporal context around a memory
memory_details[Step 3] Get full content for specific IDs
memory_recallQuick topic overview — grouped summary
memory_listList recent memories
memory_updateUpdate existing memory content or tags
memory_deleteRemove outdated memories

AgentKits Memory uses a 3-layer search pattern that saves ~70% tokens compared to fetching full content upfront.

How It Works

┌─────────────────────────────────────────────────────────────┐
│  Step 1: memory_search                                      │
│  Returns: IDs, titles, tags, scores (~50 tokens/item)       │
│  → Review index, pick relevant memories                     │
└─────────────────────────────────────────────────────────────┘
                             ↓
┌─────────────────────────────────────────────────────────────┐
│  Step 2: memory_timeline (optional)                         │
│  Returns: Context ±30 minutes around memory                 │
│  → Understand what happened before/after                    │
└─────────────────────────────────────────────────────────────┘
                             ↓
┌─────────────────────────────────────────────────────────────┐
│  Step 3: memory_details                                     │
│  Returns: Full content for selected IDs only                │
│  → Fetch only what you actually need                        │
└─────────────────────────────────────────────────────────────┘

Example Workflow

// Step 1: Search - get lightweight index
memory_search({ query: "authentication" })
// → Returns: [{ id: "abc", title: "JWT pattern...", score: 85% }]

// Step 2: (Optional) See temporal context
memory_timeline({ anchor: "abc" })
// → Returns: What happened before/after this memory

// Step 3: Get full content only for what you need
memory_details({ ids: ["abc"] })
// → Returns: Full content for selected memory

Token Savings

ApproachTokens Used
Old: Fetch all content~500 tokens × 10 results = 5000 tokens
New: Progressive disclosure50 × 10 + 500 × 2 = 1500 tokens
Savings70% reduction

CLI Commands

# One-command setup (auto-detects platform)
npx @aitytech/agentkits-memory
npx @aitytech/agentkits-memory setup --platform=cursor   # specific platform
npx @aitytech/agentkits-memory setup --platform=all      # all platforms
npx @aitytech/agentkits-memory setup --force             # re-install/update

# Start MCP server
npx @aitytech/agentkits-memory server

# Web viewer (port 1905)
npx @aitytech/agentkits-memory web

# Terminal viewer
npx @aitytech/agentkits-memory viewer
npx @aitytech/agentkits-memory viewer --stats
npx @aitytech/agentkits-memory viewer --json

# Save from CLI
npx @aitytech/agentkits-memory save "Use JWT with refresh tokens" --category pattern --tags auth,security

# Settings
npx @aitytech/agentkits-memory hook settings .
npx @aitytech/agentkits-memory hook settings . --reset
npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-...

# Export / Import
npx @aitytech/agentkits-memory hook export . my-project ./backup.json
npx @aitytech/agentkits-memory hook import . ./backup.json

# Lifecycle management
npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30
npx @aitytech/agentkits-memory hook lifecycle-stats .

Programmatic Usage

import { ProjectMemoryService } from '@aitytech/agentkits-memory';

const memory = new ProjectMemoryService({
  baseDir: '.claude/memory',
  dbFilename: 'memory.db',
});
await memory.initialize();

// Store a memory
await memory.storeEntry({
  key: 'auth-pattern',
  content: 'Use JWT with refresh tokens for authentication',
  namespace: 'patterns',
  tags: ['auth', 'security'],
});

// Query memories
const results = await memory.query({
  type: 'hybrid',
  namespace: 'patterns',
  content: 'authentication',
  limit: 10,
});

// Get by key
const entry = await memory.getByKey('patterns', 'auth-pattern');

Auto-Capture Hooks

Hooks automatically capture your AI coding sessions (Claude Code and OpenCode only):

HookTriggerAction
contextSession StartInjects previous session context + memory status
session-initUser PromptInitializes/resumes session, records prompts
observationAfter Tool UseCaptures tool usage with intent detection
summarizeSession EndGenerates structured session summary
user-messageSession StartDisplays memory status to user (stderr)

Setup hooks:

npx @aitytech/agentkits-memory

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

PlatformMCPHooksRules FileSetup
Claude Code.claude/settings.json✅ FullCLAUDE.md (skill)--platform=claude-code
Cursor.cursor/mcp.json—.cursorrules--platform=cursor
Windsurf.windsurf/mcp.json—.windsurfrules--platform=windsurf
Cline.mcp.json—.clinerules--platform=cline
OpenCode.mcp.json✅ Full—--platform=opencode
  • 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:

WorkerTaskDescription
embed-sessionEmbeddingsGenerate vector embeddings for semantic search
enrich-sessionAI EnrichmentEnrich observations with AI-generated summaries, facts, concepts
compress-sessionCompressionCompress 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).

ProviderTypeDefault ModelNotes
Claude CLIclaude-clihaikuUses claude --print, no API key needed
OpenAIopenaigpt-4o-miniAny OpenAI model
Google Geminigeminigemini-2.0-flashGoogle AI Studio key
OpenRouteropenaianySet baseUrl to https://openrouter.ai/api/v1
GLM (Zhipu)openaianySet baseUrl to https://open.bigmodel.cn/api/paas/v4
OllamaopenaianySet baseUrl to http://localhost:11434/v1

Option 1: Environment Variables

# OpenAI
export AGENTKITS_AI_PROVIDER=openai
export AGENTKITS_AI_API_KEY=sk-...

# Google Gemini
export AGENTKITS_AI_PROVIDER=gemini
export AGENTKITS_AI_API_KEY=AIza...

# OpenRouter (uses OpenAI-compatible format)
export AGENTKITS_AI_PROVIDER=openai
export AGENTKITS_AI_API_KEY=sk-or-...
export AGENTKITS_AI_BASE_URL=https://openrouter.ai/api/v1
export AGENTKITS_AI_MODEL=anthropic/claude-3.5-haiku

# Local Ollama (no API key needed)
export AGENTKITS_AI_PROVIDER=openai
export AGENTKITS_AI_BASE_URL=http://localhost:11434/v1
export AGENTKITS_AI_MODEL=llama3.2

# Disable AI enrichment entirely
export AGENTKITS_AI_ENRICHMENT=false

Option 2: Persistent Settings

# Saved to .claude/memory/settings.json — persists across sessions
npx @aitytech/agentkits-memory hook settings . aiProvider.provider=openai aiProvider.apiKey=sk-...
npx @aitytech/agentkits-memory hook settings . aiProvider.provider=gemini aiProvider.apiKey=AIza...
npx @aitytech/agentkits-memory hook settings . aiProvider.baseUrl=https://openrouter.ai/api/v1

# View current settings
npx @aitytech/agentkits-memory hook settings .

# Reset to defaults
npx @aitytech/agentkits-memory hook settings . --reset

Priority: Environment variables override settings.json. Settings.json overrides defaults.


Lifecycle Management

Manage memory growth over time:

# Compress observations older than 7 days, archive sessions older than 30 days
npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30

# Also auto-delete archived sessions older than 90 days
npx @aitytech/agentkits-memory hook lifecycle . --compress-days=7 --archive-days=30 --delete --delete-days=90

# View lifecycle statistics
npx @aitytech/agentkits-memory hook lifecycle-stats .
StageWhat Happens
CompressAI-compresses observations, generates session digests
ArchiveMarks old sessions as archived (excluded from context)
DeleteRemoves archived sessions (opt-in, requires --delete)

Export / Import

Backup and restore your project memories:

# Export all sessions for a project
npx @aitytech/agentkits-memory hook export . my-project ./backup.json

# Import from backup (deduplicates automatically)
npx @aitytech/agentkits-memory hook import . ./backup.json

Export format includes sessions, observations, prompts, and summaries.


Memory Categories

CategoryUse Case
decisionArchitecture decisions, tech stack picks, trade-offs
patternCoding conventions, project patterns, recurring approaches
errorBug fixes, error solutions, debugging insights
contextProject background, team conventions, environment setup
observationAuto-captured session observations

Storage

Memories are stored in .claude/memory/ within your project directory.

.claude/memory/
├── memory.db          # SQLite database (all data)
├── memory.db-wal      # Write-ahead log (temp)
├── settings.json      # Persistent settings (AI provider, context config)
└── embeddings-cache/  # Cached vector embeddings

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:

import { ProjectMemoryService } from '@aitytech/agentkits-memory';

const memory = new ProjectMemoryService('.claude/memory');
await memory.initialize();

// Store CJK content
await memory.storeEntry({
  key: 'auth-pattern',
  content: '認証機能の実装パターン - JWT with refresh tokens',
  namespace: 'patterns',
});

// Search in Japanese, Chinese, or Korean - it just works!
const results = await memory.query({
  type: 'hybrid',
  content: '認証機能',
});

How It Works

  • Native SQLite: Uses better-sqlite3 for maximum performance
  • Trigram 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:

import { createJapaneseOptimizedBackend } from '@aitytech/agentkits-memory';

const backend = createJapaneseOptimizedBackend({
  databasePath: '.claude/memory/memory.db',
  linderaPath: './path/to/liblindera_sqlite.dylib',
});

Requires lindera-sqlite build.


API Reference

ProjectMemoryService

interface ProjectMemoryConfig {
  baseDir: string;              // Default: '.claude/memory'
  dbFilename: string;           // Default: 'memory.db'
  enableVectorIndex: boolean;   // Default: false
  dimensions: number;           // Default: 384
  embeddingGenerator?: EmbeddingGenerator;
  cacheEnabled: boolean;        // Default: true
  cacheSize: number;            // Default: 1000
  cacheTtl: number;             // Default: 300000 (5 min)
}

Methods

MethodDescription
initialize()Initialize the memory service
shutdown()Shutdown and persist changes
storeEntry(input)Store a memory entry
get(id)Get entry by ID
getByKey(namespace, key)Get entry by namespace and key
update(id, update)Update an entry
delete(id)Delete an entry
query(query)Query entries with filters
semanticSearch(content, k)Semantic similarity search
count(namespace?)Count entries
listNamespaces()List all namespaces
getStats()Get statistics

Code Quality

AgentKits Memory is thoroughly tested with 970 unit tests across 21 test suites.

MetricCoverage
Statements90.29%
Branches80.85%
Functions90.54%
Lines91.74%

Test Categories

CategoryTestsWhat's Covered
Core Memory Service56CRUD, search, pagination, categories, tags, import/export
SQLite Backend65Schema, migrations, FTS5, transactions, error handling
sqlite-vec Vector Index47Insert, search, delete, persistence, edge cases
Hybrid Search44FTS + vector fusion, scoring, ranking, filters
Token Economics273-layer search budgets, truncation, optimization
Embedding System63Cache, subprocess, local models, CJK support
Hook System502Context, session-init, observation, summarize, AI enrichment, service lifecycle, queue workers, adapters, types
MCP Server48All 9 MCP tools, validation, error responses
CLI34Platform detection, rules generation
Integration84End-to-end flows, embedding integration, multi-session
# Run tests
npm test

# Run with coverage
npm run test:coverage

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 VersionStatusNotes
18.x LTS✅ WorksPrebuilt binaries
20.x LTS✅ WorksPrebuilt binaries
22.x LTS✅ WorksPrebuilt binaries
19.x, 21.x, 23.x⚠️ Requires build toolsNo 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

# Download and install from:
# https://visualstudio.microsoft.com/visual-cpp-build-tools/
# Select "Desktop development with C++" workload

Option 2: windows-build-tools (npm)

npm install --global windows-build-tools

Option 3: Chocolatey

choco install visualstudio2022-workload-vctools

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.

ProductDescriptionLink
AgentKits Engineer28 specialized agents, 100+ skills, enterprise patternsGitHub
AgentKits MarketingAI-powered marketing content generationGitHub
AgentKits MemoryPersistent memory for AI assistants (this package)npm

agentkits.net


Star History

Star History Chart

License

MIT


Give your AI assistant memory that persists.

AgentKits Memory by AityTech

Star this repo if it helps your AI remember.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for AgentKits Memory from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/agentkits-memory)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools