npm install -g knol-local

Local Memory for AI Assistants

knol-local is a lightweight MCP server and CLI backed by SQLite. Zero setup — no Docker, no PostgreSQL, no API key. Install once and your AI tools remember everything.

SQLite + FTS5

No server required

All data lives in ~/.knol-local/memories.db. Works fully offline.

MCP native

Claude, Cursor & more

Exposes 6 tools via the Model Context Protocol. Auto-configures on install.

HTTP REST API

Works with Codex

Run knol-local serve for a local REST endpoint any tool can hit.

MIT · Node 18+

Open source

Uses built-in node:sqlite on Node 22.5+. Zero extra deps for most users.

Install & Setup

The postinstall script automatically patches any existing Claude Desktop or Cursor config files. Nothing is created if the config file doesn't already exist — no surprises.

Installation
# Install globally — auto-configures Claude Desktop & Cursor
npm install -g knol-local

# Or configure manually for a specific client
knol-local setup claude       # Claude Desktop
knol-local setup cursor       # Cursor
knol-local setup claude-code  # Claude Code CLI
knol-local setup codex        # Codex (shows HTTP instructions)

How It Works

01

Install once

npm install -g knol-local patches your Claude Desktop and Cursor MCP configs automatically. No manual JSON editing.

02

AI tools use the MCP tools

Claude calls remember, recall, and list_memories during your conversations. Memories persist across sessions in a local SQLite file.

03

Every session picks up where you left off

Your projects, preferences, and decisions are recalled automatically. You never repeat yourself between sessions.

MCP Tools

Once connected, Claude (or any MCP client) can call these six tools automatically:

remember

Store a memory with optional tags and importance score (0–1).

recall

Full-text search across memories. Returns ranked results with scores.

forget

Delete a memory by ID.

list_memories

List recent memories with optional tag filters and limit.

update_memory

Update the content, tags, or importance of an existing memory.

memory_stats

Return total count, oldest, and newest memory timestamps.

Claude Code Setup

Claude Code uses its own config. Add knol-local globally with one command, or per-project via .claude/settings.json.

Claude Code CLI
# One-time setup via Claude Code CLI
claude mcp add knol-local knol-local

# Or add per-project in .claude/settings.json
{
  "mcpServers": {
    "knol-local": { "command": "knol-local" }
  }
}

CLI Reference

Manage memories directly from the terminal — useful for scripting, backup automation, or quick lookups.

CLI commands
# Add a memory
knol-local add "Prefer strict TypeScript and functional patterns" --tag coding

# Search memories
knol-local search "TypeScript preferences" --limit 5

# List all memories
knol-local list --limit 20 --tag coding

# Summary statistics
knol-local stats

# Export / import
knol-local export --out backup.json
knol-local import backup.json

# Backup / restore the SQLite database
knol-local backup --out ~/backups/
knol-local restore ~/backups/memories-2026-05-09.db

# Start the HTTP REST API (for Codex or scripts)
knol-local serve --port 3001 --key my-secret

HTTP REST API

Run knol-local serve to start a local REST server — useful for Codex, scripts, or any tool without native MCP support. Optionally protect it with --key.

MethodPathDescription
GET/memoriesList memories (supports ?tag=&limit=)
POST/memoriesAdd a memory { content, tags?, importance? }
GET/memories/searchFull-text search (?q=&limit=&tag=)
DELETE/memories/:idDelete a memory by ID
GET/exportExport all memories as JSON
POST/importImport memories from JSON
GET/healthHealth check
HTTP API examples
# Start the REST server
knol-local serve --port 3001

# Add a memory
curl -X POST http://localhost:3001/memories \
  -H "Content-Type: application/json" \
  -d '{"content": "Prefer functional patterns", "tags": ["coding"]}'

# Search
curl "http://localhost:3001/memories/search?q=TypeScript&limit=5"

# Health check
curl http://localhost:3001/health

Configuration

VariableDefaultDescription
KNOL_LOCAL_DB~/.knol-local/memories.dbOverride the SQLite database path

Node 22.5+ uses the built-in node:sqlite — no extra dependencies. Older runtimes (Claude Desktop embeds Node 18) auto-install better-sqlite3 during postinstall.

knol-local vs Knol

knol-localKnol (full)
Setupnpm install -gDocker / self-host / cloud
StorageSQLite (local file)PostgreSQL + pgvector
RetrievalFull-text (FTS5)Vector + BM25 + graph (hybrid)
Knowledge graph
Multi-user✓ (RLS isolation)
Memory decay
HTTP REST API✓ (local)✓ (production-grade)
MCP tools6 tools6 tools + graph query
Conflict detection
Best forPersonal use / local devTeams & production apps

Ready to give your AI persistent memory?

One command. Works immediately with Claude Desktop, Cursor, and Claude Code. Upgrade to the full Knol stack when you need teams, graphs, or hybrid retrieval.

npm install -g knol-local