Skip to main content
Glama

Smart Memory MCP

IMPORTANT

Superseded by Soul MCP 4.0.1. This small TF-IDF/JSON memory server remains available for existing users, but new development has moved to Soul's SQLite-backed provenance, conflict, correction, receipt, and durable-memory runtime. No migration is automatic; review both storage formats before switching.

Persistent memory with semantic search for AI agents.

Your AI agent forgets everything between sessions. Smart Memory fixes that.

Works with Claude Code, Cursor, Windsurf, and any MCP-compatible client.

Features

  • Semantic Search — TF-IDF similarity matching, not just keywords

  • Zero Config — Install and it works. No cloud, no API keys

  • 100% Local — All data stays on your machine as JSON files

  • Bilingual — English and German language support

  • Recency Boost — Recent knowledge ranks higher

  • Usefulness Scoring — Rate entries to improve future recall

Related MCP server: recall-mcp

Quick Start

Claude Code

claude mcp add memory -- npx mcp-smart-memory

Cursor / Windsurf / Other MCP Clients

Add to your MCP configuration:

{
  "mcpServers": {
    "memory": {
      "command": "npx",
      "args": ["mcp-smart-memory"]
    }
  }
}

That's it. Your agent now has persistent memory.

Tools

Tool

Description

memory_learn

Store knowledge with categories and tags

memory_recall

Search using TF-IDF semantic similarity

memory_stats

Knowledge base statistics and overview

memory_patterns

Analyze patterns, tag frequency, co-occurrence

memory_suggest

Proactive suggestions based on current context

memory_evaluate

Rate entries as useful/not useful for better recall

Usage Examples

Store knowledge

memory_learn: "React useEffect cleanup runs before component unmount and before re-running the effect"
  category: "pattern"
  tags: ["react", "hooks", "cleanup"]

Recall knowledge

memory_recall: "how to clean up effects in React"
→ Returns semantically similar entries ranked by relevance

Get suggestions

memory_suggest: "I'm debugging a memory leak in a React component"
→ Returns relevant warnings, solutions, and best practices from your knowledge base

Configuration

Environment Variable

Default

Description

SMART_MEMORY_DIR

~/.smart-memory

Data storage directory

SMART_MEMORY_DB

default

Database name (for multiple knowledge bases)

Multiple Knowledge Bases

{
  "mcpServers": {
    "work-memory": {
      "command": "npx",
      "args": ["mcp-smart-memory"],
      "env": { "SMART_MEMORY_DB": "work" }
    },
    "personal-memory": {
      "command": "npx",
      "args": ["mcp-smart-memory"],
      "env": { "SMART_MEMORY_DB": "personal" }
    }
  }
}

How It Works

Smart Memory uses TF-IDF (Term Frequency-Inverse Document Frequency) with cosine similarity for semantic search — implemented in pure JavaScript with zero ML dependencies.

When you store knowledge:

  1. Text is tokenized and stop-words are removed

  2. An inverted index is built for fast lookup

  3. TF-IDF vectors are computed for similarity matching

When you search:

  1. Your query is vectorized using the same TF-IDF pipeline

  2. Cosine similarity is computed against all entries

  3. Results are boosted by recency and usefulness ratings

  4. Top matches are returned, ranked by relevance score

Data Storage

All data is stored locally as JSON files:

~/.smart-memory/
  └── default/
      ├── knowledge.json    # Your knowledge entries
      └── index.json        # TF-IDF search index

Files are human-readable and portable. Back them up, share them, or version control them.

Why Smart Memory?

Smart Memory

claude-mem

mem0

Zep

MCP Native

✅

❌ Plugin

❌ SDK

❌ SDK

Any MCP Client

✅

❌ Claude only

❌ Python only

❌ Python only

No Cloud

✅

✅

❌

❌

No API Key

✅

✅

❌

❌

Semantic Search

✅ TF-IDF

❌ Basic

✅ Embeddings

✅ Embeddings

Pattern Detection

✅

❌

❌

❌

Proactive Suggestions

✅

❌

❌

❌

Built With

Built by NexTool — an AI-native development studio powered by Claude Opus 4.6.

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      C
      maintenance
      Provides AI agents with persistent, local cross-session shared memory by combining vector semantic retrieval with knowledge graph relationships, and supports short/long-term memory management and local backups.
      -
    • A
      license
      A
      quality
      C
      maintenance
      Provides persistent, cross-session memory for AI agents, letting them store, search, and manage memories with tools like remember, recall, forget, list, summarize, and import/export.
      8
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Gives AI agents a local-first, persistent memory backed by a single SQLite file, letting them save decisions, preferences, and facts, then recall them by meaning or keyword across sessions and projects. Exposes tools for loading pinned context, searching, adding, updating, listing, and deleting memories, so agents stop forgetting between sessions.
      10 npm
      1
      Apache 2.0