Engram

Engram

Engram is a local-first memory server that lets AI agents remember things across sessions with zero cloud dependencies.

Category
访问服务器

README

Engram Engram

CI npm version License: MIT Node.js MCP

Give your AI agents persistent memory. Zero cloud. Zero API keys. Two-minute setup.

Engram is a local-first memory server that lets AI agents like Claude, Cursor, Cline, and Windsurf remember things across sessions. It runs entirely on your machine — no external services, no data leaving your device, no monthly bills.

npm install -g @hbarefoot/engram
engram start

That's it. Your AI agent now has long-term memory.


Why Engram?

Most AI memory solutions require cloud infrastructure, API keys, and external vector databases. Engram takes a different approach:

Engram Mem0 Zep
Setup time 2 minutes Requires API keys + cloud setup Requires Docker + API keys
Dependencies None — SQLite + local embeddings OpenAI API, vector DB (Qdrant/Pinecone) PostgreSQL, OpenAI API
Data location Your machine only Cloud (or self-hosted with infra) Cloud (or self-hosted with infra)
Cost Free forever Pay per API call Pay per API call
Privacy Complete — nothing leaves your device Data sent to external APIs Data sent to external APIs
MCP native ✅ First-class ❌ REST only ❌ REST only

Engram is built for developers who want AI memory without the overhead.


Features

  • 🔒 Fully Local — SQLite database + local embeddings (all-MiniLM-L6-v2, 23 MB). No network calls, ever
  • 🤖 MCP Native — First-class Model Context Protocol integration. Works with Claude Desktop, Claude Code, Cline, Cursor, Windsurf, and any MCP client
  • 🔍 Hybrid Search — Combines vector similarity with full-text search (FTS5) for accurate recall
  • 🧹 Smart Deduplication — Automatically detects and merges similar memories (>0.92 similarity threshold)
  • 📊 Feedback Loop — Rate memory usefulness to improve future recall accuracy
  • 🔐 Secret Detection — Automatically blocks API keys, passwords, and tokens from being stored
  • Temporal Queries — Filter memories by time: "last week", "3 days ago", or exact dates
  • 📦 Namespace Isolation — Organize memories by project, client, or any scope you need
  • 🌐 REST API — Full HTTP API with CORS support for custom integrations
  • 🖥️ Web Dashboard — React-based UI for browsing, searching, and managing memories
  • 💾 Export — Export memories to Markdown, JSON, or plain text for documentation

Quick Start

1. Install

npm install -g @hbarefoot/engram

2. Start the server

engram start

3. Connect to your AI agent

Add Engram to your MCP client config:

Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "engram": {
      "command": "engram",
      "args": ["start", "--mcp-only"]
    }
  }
}

Claude Code:

claude mcp add engram -- engram start --mcp-only

Cline / Cursor / Windsurf: Add the same MCP config to your editor's settings. Engram's built-in Integration Wizard can auto-detect your setup:

engram connect

4. Use it

Once connected, your AI agent can store and recall memories naturally:

You: "Remember that our API uses JWT tokens with 24-hour expiry"

Claude: stores the memory via engram_remember

You: (next day) "What authentication approach are we using?"

Claude: recalls via engram_recall — "Your API uses JWT tokens with 24-hour expiry."

Memories persist across sessions, restarts, and even different AI clients sharing the same Engram instance.


MCP Tools

Engram exposes 6 tools to AI agents via the Model Context Protocol:

Tool Description
engram_remember Store a memory with category, entity, confidence, namespace, and tags
engram_recall Retrieve relevant memories by semantic query with optional filters
engram_forget Delete a specific memory by ID
engram_feedback Rate a memory as helpful or unhelpful to improve future recall
engram_context Generate a pre-formatted context block (markdown/xml/json) with token budget
engram_status Health check with memory count, model status, and configuration info

Memory Categories

Memories are organized by type for better retrieval:

  • fact — Objective truths about setup, architecture, or configuration
  • preference — User likes, dislikes, and style choices
  • pattern — Recurring workflows and habits
  • decision — Choices made and the reasoning behind them
  • outcome — Results of actions taken

CLI Reference

engram start                    # Start MCP + REST server
engram start --mcp-only         # MCP server only (for agent integration)
engram start --port 3838        # Custom port for REST API

engram remember "content"       # Store a memory from the command line
engram recall "query"           # Search memories
engram forget <id>              # Delete a memory
engram list                     # List all memories
engram status                   # Health check and stats

engram export                   # Export memories to JSON
engram import <file>            # Import memories from file
engram consolidate              # Run deduplication and cleanup

engram agents                   # List detected AI agents on your system
engram connect                  # Interactive setup wizard for MCP clients

REST API

The REST API runs on http://localhost:3838 by default.

Endpoint Method Description
/health GET Health check
/api/status GET System status with stats
/api/memories POST Create a memory
/api/memories GET List memories (with pagination, category/namespace filters)
/api/memories/search POST Semantic search
/api/memories/:id GET Get a single memory
/api/memories/:id DELETE Delete a memory
/api/consolidate POST Run deduplication and cleanup
/api/conflicts GET Get detected memory conflicts

Web Dashboard

Engram includes a built-in web dashboard at http://localhost:3838 when running the full server:

  • Dashboard — Overview of memory stats and recent activity
  • Memory Browser — Browse, filter, and manage all stored memories
  • Search — Semantic search with similarity scores
  • Statistics — Charts and breakdowns by category, namespace, and time
  • Agents — Integration hub with a setup wizard for connecting MCP clients

How It Works

  1. Store: When an AI agent calls engram_remember, the memory text is embedded locally using all-MiniLM-L6-v2 (a 23 MB model that runs on CPU). The embedding and metadata are stored in a local SQLite database at ~/.engram/memory.db.

  2. Recall: When engram_recall is called, the query is embedded with the same model and matched against stored memories using cosine similarity. FTS5 keyword matching runs in parallel, and results are merged using a hybrid scoring algorithm.

  3. Deduplicate: Before storing, Engram checks existing memories for similarity. Exact duplicates (>0.95) are rejected. Near-duplicates (0.92–0.95) are merged intelligently.

  4. Learn: The engram_feedback tool lets agents mark memories as helpful or unhelpful. This adjusts confidence scores and influences future recall ranking.

  5. Protect: Every memory passes through secret detection before storage. API keys, passwords, tokens, and other sensitive data are automatically blocked.


Configuration

Engram stores its data and config in ~/.engram/:

~/.engram/
├── memory.db          # SQLite database (memories + embeddings)
├── config.json        # Server configuration
└── models/            # Cached embedding model (~23 MB)

Default settings work out of the box. To customize:

// ~/.engram/config.json
{
  "port": 3838,
  "defaultNamespace": "default",
  "recallLimit": 5,
  "confidenceThreshold": 0.3,
  "secretDetection": true
}

Advanced Usage

Namespace Isolation

Organize memories by project or client:

# Store memories in different namespaces
engram remember "Uses Next.js 14 with app router" --namespace my-saas
engram remember "WordPress multisite with Redis cache" --namespace client-site

# Recall searches within a namespace
engram recall "what framework?" --namespace my-saas

AI agents can use namespaces automatically — just include the namespace parameter in engram_remember and engram_recall calls.

Temporal Queries

Filter memories by time:

engram recall "deployment changes" --after "last week"
engram recall "API decisions" --after "2025-01-01" --before "2025-06-01"

Export for Documentation

Export your project's memory as documentation:

engram export --format markdown --namespace my-project > PROJECT_CONTEXT.md
engram export --format json > memories-backup.json

Contributing

See CONTRIBUTING.md for development setup and guidelines.

git clone https://github.com/HBarefoot/engram.git
cd engram
npm install
npm run dev

License

MIT © 2026 HBarefoot

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选