Engram

io.github.HBarefoot由 GitHub 帳號 HBarefoot 發布v1.6.3更新於 Oct 25, 2026

Local-first persistent memory for AI agents — SQLite + local embeddings, MCP-native, no cloud.

發布方自己的服務:Engram

已驗證STDIO僅桌面資料庫知識與記憶

概覽

AI 產生的概覽

Engram 是為 AI 代理打造的本地優先持久記憶伺服器,以 SQLite 和本機嵌入儲存記憶,讓助理記住事實、偏好、模式與決策。

可以做什麼
依類別、實體、信心度、命名空間與標籤儲存記憶,每次寫入自動進行金鑰偵測(engram_remember)。
適用情境
當你希望助理跨工作階段、跨用戶端保留持久脈絡,又不想架設資料庫、雲端帳號或 API 金鑰時使用。
執行需求
透過 npm 套件 @hbarefoot/engram 以本機 stdio 程序執行(需要 Node.js)。未宣告帳號、API 金鑰或標頭。嵌入模型(約 23 MB)首次下載後快取在使用者家目錄;預設路徑可離線運作。
安裝前請注意
記憶會寫入本機 SQLite 資料庫,並在共用同一執行個體的工作階段與用戶端之間持久保存。寫入與刪除會改動已存資料(engram_forget、批次刪除)。金鑰偵測採樣式比對,可能漏判,請勿刻意儲存憑證。選用的本機 LLM 層會把記憶內容送往所設定的端點,只有端點位於本機時才真正不外傳。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Engram,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[Engram] Engram

Persistent memory for AI agents. In-process. No infra.

Give your AI agent the memory of a colleague who's worked with you for years — without cloud, API keys, or Docker.

⭐ Useful to you? Star it on GitHub — it's the simplest way to help others find Engram.

[CI] [npm version] [Website] [License: MIT] [Node.js] [MCP] [engram MCP server]

bash
npm install -g @hbarefoot/engramengram start

[Engram quickstart demo: install, remember two facts, recall by meaning]

Your AI agent now has long-term memory. Two minutes, no setup, no cloud.

  • 🧠 In-process — runs inside your agent's stack. No separate server to deploy, no IPC overhead, nothing to fork.
  • 📴 Offline — local SQLite + bundled embeddings (~23 MB). No API keys, no data leaving your machine.
  • 🔌 MCP-native — first-class Model Context Protocol integration with Claude Desktop, Claude Code, Cursor, Windsurf, and Cline.
  • 🔐 Safety by default — automatic secret detection on every write. API keys, private keys, connection strings, JWTs blocked before they hit the database.

Why local-first, in numbers

Engram runs inside your agent's process — no service to deploy, no account, nothing leaving your machine. That design choice is measurable:

MetricEngram
Cold start → first recallunder 200 msimport → first answer, model load included (M-series; hardware-dependent)
Warm recall (p50, 1k memories)~4 msmedian query latency once the model is in memory
Package download~571 KBthe npm package (1.3 MB unpacked)
Embedding model~23 MBall-MiniLM-L6-v2, fetched once, cached at ~/.engram/models
External services0no database, broker, or cloud account
Works offline✅zero network calls on the default path

Measured on an Apple M4 Pro over 1,000 seeded memories — reproduce with npm run bench. These are footprint and latency numbers, not an accuracy claim: Engram doesn't try to out-rank Mem0 or Zep on memory benchmarks. The point is solid recall with none of the operational surface.

Optional accuracy lift — still 100% local. If you already run a local model, the opt-in LLM layer sharpens fact extraction: entity-extraction accuracy climbs from 45.8% (rule-based) to 95.8% with the recommended henrybarefoot1987/engram-extract model (qwen3:1.7b) — +50 pts — without a single byte leaving your device.


Support Engram

Engram is free and MIT-licensed — and always will be. No paywalls, no tier-locked features, no telemetry. Every feature ships in the open-source package. Sponsorship is purely a way to fund continued development, not to unlock anything.

[Support Engram]

If Engram saves you time, you can sponsor it via Polar:

TierPrice / monthFor
🌱 Supporter$5Individuals who want the project to keep shipping.
⚡ Power User$25Heavy users who rely on Engram day to day.
👥 Team$100Teams standardizing on Engram across projects.
🏢 Enterprise$499Priority response on issues + dedicated integration help.

About Enterprise. Engram is MIT-licensed, so commercial use is already granted — you don't need to buy a license to use it at work. The Enterprise tier buys priority response on issues and dedicated help wiring Engram into your stack. For organizations whose policy precludes depending on MIT-licensed software, an optional commercial-license override is available on request. (Engram is maintained by a solo developer, so this is best-effort priority response, not a contractual SLA.)


Why Engram?

Most agent-memory products are services you run alongside your agent — Postgres, Docker, cloud accounts, API keys. Engram embeds inside your agent's process: a focused, stable npm package with practical guardrails.

EngramLodisMem0 / OpenMemoryZepLetta
Maturityv1.9.x, stablev0.5.x, earlymature / SaaSv0.xv0.x
Infra to operateNone (npm package)None (npx package)Cloud account or multi-container DockerDocker + Postgres + GraphitiDocker + Postgres
Install footprint~23 MB~22 MBHundreds of MB containers (self-hosted)Hundreds of MBHundreds of MB
Works offline✅✅❌ Cloud / ✅ if self-hosted❌ External embed provider❌ External LLM provider
MCP-native✅ Primary✅ Primary🟡 OpenMemory ships an MCP server❌ REST/SDK❌ REST/SDK
REST API alongside MCP✅❌ MCP-only✅ Cloud✅✅
Surface area6 tools, 5 categories40 tools, 14 entity types + 4 permanence tiers + temporal supersessionvariesvariesvaries
Automatic secret detection✅ Blocks on every write🟡 memory_scrub opt-in tool🟡 Not first-class🟡 Not first-class🟡 Not first-class
Agent auto-discovery✅ Dashboard Integration Wizard❌ Manual config❌❌❌
Desktop app✅ macOS Tauri menu bar❌❌❌❌
LLM-powered extraction✅ Optional, on-device (Ollama; rule-based default)❌ LLM-free read/write✅ Built-in✅ Built-in✅ Built-in
Feedback / contradiction workflow✅ Side-by-side conflict-resolution UI + feedback loop🟡 Programmatic correct/confirm/supersede tools🟡 No first-class feedback🟡🟡

Sources: @sunriselabs/lodis, Sunrise-Labs-Dot-AI/engrams, mem0.ai, github.com/getzep/zep, github.com/letta-ai/letta. See docs/competitive-intel.md for the full breakdown. Engram ships optional, on-device LLM extraction (v1.9+): point llm.* at a local model — the recommended henrybarefoot1987/engram-extract (Qwen3-1.7B, Apache-2.0) or any Ollama / OpenAI-compatible endpoint — to sharpen category/entity extraction (entity recognition +50 pts vs rules — 45.8% → 95.8% — with engram-extract (qwen3:1.7b) in our benchmark), still 100% local and off by default (the zero-config path stays rule-based, offline, and infra-free). Mem0/Zep/Letta build LLM extraction in via a cloud model; Lodis is LLM-free read/write with a broader feature surface — we list it honestly.

TL;DR — when each one fits. Pick Engram if you want a focused, stable, local-first memory layer with practical guardrails (secret detection, agent auto-discovery, desktop app), a simple 5-category mental model, and optional on-device LLM extraction when you want it. Pick Lodis if you want a knowledge-graph-style memory with 14 entity types and temporal supersession. Pick Mem0/Zep/Letta if you want cloud-LLM extraction built in and don't mind operating infrastructure for it.


Quickstart

1. Install

bash
npm install -g @hbarefoot/engram

2. Start the server

bash
engram start             # MCP + REST + Dashboard on localhost:3838engram start --mcp-only  # MCP server only, stdio mode (for agent integration)

3. Connect your AI agent

Claude Code:

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

Claude Desktop — add to ~/Library/Application Support/Claude/claude_desktop_config.json:

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

Cline / Cursor / Windsurf — add the same mcpServers block to your editor's MCP config. The built-in dashboard at http://localhost:3838 has an Integration Wizard that auto-detects your installed agents and generates the config for you.

4. Use it

You:    "Remember that our API uses JWT tokens with 24-hour expiry."Claude: (stores via engram_remember)
You:    (next day) "What authentication approach are we using?"Claude: (recalls via engram_recall) — "JWT tokens, 24-hour expiry."

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


Memory that improves over time

Most memory systems are append-only stores: write once, retrieve forever, hope for the best. Engram learns.

  • Feedback loop (engram_feedback) — when an agent recalls a memory, you or the agent can vote it helpful or unhelpful. Memories accumulate a score in [-1, 1]; consistently-unhelpful memories see their confidence decay automatically.
  • Contradiction detection — when two memories conflict ("prefers Fastify" vs "switched to Express"), the consolidation engine flags them. The dashboard's Conflicts tab shows them side-by-side with four resolution actions: keep A, keep B, keep both, or dismiss.
  • Deduplication on insert — identical memories (≥0.95 cosine similarity) are rejected. Near-duplicates (0.92–0.95) absorb the new content into the existing record. The store stays clean without manual pruning.
  • Decay — memories that aren't recalled lose confidence over time and stop polluting future results.

The longer you use Engram, the sharper its recall gets.


MCP Tools

Engram exposes 6 tools to AI agents over stdio:

ToolDescription
engram_rememberStore a memory with category, entity, confidence, namespace, tags. Auto-runs secret detection.
engram_recallHybrid semantic + FTS5 search. Supports category, namespace, threshold, and time_filter.
engram_forgetDelete a specific memory by ID.
engram_feedbackVote a memory helpful/unhelpful. Drives the feedback loop above.
engram_contextPre-formatted context block (markdown / xml / json / plain) with a token budget for system-prompt injection.
engram_statusHealth check: memory count, model status, configuration.

Memory categories

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

Teach your agent to use Engram

Connecting the MCP server gives your agent the memory tools — but not the judgment to use them well. The bundled engram-memory skill is that judgment layer: it teaches an agent to recall at the start of a session, store durable decisions, corrections, and outcomes as they happen, and write results back at the end — without being told each time.

bash
engram skill install                     # → ~/.claude/skills/engram-memory/engram skill install --project           # → ./.claude/skills/  (commit it for your team)engram skill install --platform agents   # → ~/.agents/skills/  (cross-framework)

Works in Claude Code, Claude Desktop, Cowork, or any framework that reads the Agent Skills spec (.agents/skills). The skill is vendored in the package, so it versions with Engram and updates land on the next engram skill install; engram skill uninstall removes it cleanly.


CLI Reference

bash
engram start                       # Start MCP + REST + dashboardengram start --mcp-only            # MCP server only (stdio mode)engram start --port 3838           # Custom REST port
engram remember "<content>"        # Store a memory   (-c category -e entity -n namespace --confidence)engram recall "<query>"            # Search memories  (-l limit -c category -n namespace --threshold)engram forget <id>                 # Delete by IDengram list                        # List memories    (-l limit --offset -c category -n namespace)engram status                      # Health check
engram consolidate                 # Deduplicate, detect contradictions, decay                                   # (--no-duplicates / --no-contradictions / --no-decay / --cleanup-stale)engram conflicts                   # List unresolved contradictionsengram export-context              # Export curated context block                                   # (-o file -f markdown|claude|txt|json -c categories --min-confidence ...)engram import                      # Import from local sources                                   # (-s cursorrules|claude|package|git|ssh|shell|obsidian|env --dry-run)
engram skill install               # Install the engram-memory agent skill                                   # (--project → ./.claude, --platform agents → ~/.agents)engram skill uninstall             # Remove the engram-memory skill

Run engram --help for the full flag list.


REST API

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

MethodEndpointDescription
GET/healthLiveness check
GET/api/statusSystem status + stats
GET/api/installation-infoDetected agents, runtime, install location
POST/api/memoriesCreate a memory
GET/api/memoriesList with pagination + filters
POST/api/memories/searchSemantic search
GET/api/memories/:idRead a single memory
DELETE/api/memories/:idDelete by ID
POST/api/memories/bulk-deleteBulk-delete by ID list
POST/api/consolidateRun consolidation pipeline
GET/api/conflictsLegacy tag-based conflict view
GET/api/contradictionsUnresolved contradictions
POST/api/contradictions/:id/resolveResolve (keep_first / keep_second / keep_both / dismiss)
GET/api/contradictions/countUnresolved count (for badge)
GET/api/analytics/overviewMemory health dashboard data
GET/api/analytics/staleMemories with no recent recall
GET/api/analytics/never-recalledMemories never returned by any query
GET/api/analytics/duplicatesDetected near-duplicates
GET/api/analytics/trendsTime-series creation/recall trends
POST/api/export/staticExport context block as a static file
GET/api/import/sourcesList importable local sources
POST/api/import/scanTwo-phase import: preview extracted memories
POST/api/import/commitTwo-phase import: commit selected memories

Web Dashboard

A built-in React dashboard at http://localhost:3838:

  • Dashboard — Memory stats, recent activity, health gauge.
  • Memories — Browse, filter, inline-edit, bulk-delete.
  • Search — Semantic search with score breakdown.
  • Statistics — Charts by category, namespace, and time.
  • Health — Stale, never-recalled, low-feedback memories with one-click cleanup.
  • Conflicts — Side-by-side contradiction resolution.
  • Agents — Integration wizard that auto-detects installed AI clients and writes their MCP configs (with timestamped backups).
  • Import — Wizard for cursorrules, .claude files, package.json, git config, SSH config, shell history, Obsidian, and .env.

How it works

  1. Store: engram_remember runs content through secret detection, then embeds it locally using all-MiniLM-L6-v2 (~23 MB, CPU-only, downloaded once and cached at ~/.engram/models/). The embedding and metadata land in SQLite at ~/.engram/memory.db.
  2. Recall: engram_recall embeds the query, fetches candidates via FTS5 + in-namespace embeddings, and scores them as (similarity × 0.45) + (recency × 0.15) + (confidence × 0.15) + (access × 0.05) + (feedback × 0.10) + fts_boost. Top results are returned and their access stats updated.
  3. Deduplicate: on insert, identical memories (≥0.95 similarity) are rejected; near-duplicates (0.92–0.95) absorb new content into the existing row.
  4. Learn: engram_feedback adjusts a memory's feedback_score and — after 5+ votes — bumps the confidence score up or down.
  5. Protect: every write passes through pattern-based secret detection (OpenAI/Stripe/AWS/GitHub/Slack/Google keys, private keys, connection strings, JWTs, high-entropy strings). Detected secrets either reject the memory or redact the secret portion.

Configuration

Engram stores everything under ~/.engram/:

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

Defaults work out of the box. To customize:

json
{  "port": 3838,  "dataDir": "~/.engram",  "defaults": {    "namespace": "default",    "recallLimit": 5,    "confidenceThreshold": 0.3,    "tokenBudget": 500,    "maxRecallResults": 20  },  "embedding": {    "provider": "local",    "model": "Xenova/all-MiniLM-L6-v2"  },  "consolidation": {    "enabled": true,    "intervalHours": 24,    "duplicateThreshold": 0.92,    "decayEnabled": true  },  "security": {    "secretDetection": true,    "auditLog": false  }}

The llm.* block powers the optional local AI enhancement below. It is off by default (llm.provider: null); the zero-config path uses rule-based extraction and makes no LLM calls.


Optional: local AI enhancement (Ollama)

Engram works fully offline with zero AI dependencies. If you want a little more accuracy and already run a local model, you can optionally turn on "Layer 1" — and it stays 100% on your machine.

  • Free, opt-in, off by default. Nothing changes unless you enable it.
  • Local-first. Uses your own Ollama (default) or any OpenAI-compatible local server (LM Studio, llama.cpp). No cloud, no API key, no telemetry — your memory content never leaves your device.
  • Graceful. Every call has a timeout and falls back to the built-in rule-based path if the model is slow, unreachable, or returns junk. Engram never crashes because a model is down.

What it improves when enabled: sharper category/entity/confidence on new memories, and an LLM confirmation step that reduces false-positive contradiction flags.

Recommended model: henrybarefoot1987/engram-extract. The layer's two jobs are classification, not generation — so a small model with constrained decoding (the model is forced to emit valid JSON) and thinking turned off is fast (sub-second), cool, and accurate. Pull it (or build it locally from the Modelfile):

bash
ollama pull henrybarefoot1987/engram-extract# …or build from source:ollama create henrybarefoot1987/engram-extract -f models/engram-extract.Modelfile

Then set the model to henrybarefoot1987/engram-extract. It's a recommendation, not a lock-in — any Ollama or OpenAI-compatible model still works. See docs/llm/recommended-model.md for the base model, licensing, and how to pick the smallest model that beats rules on your hardware.

Attribution. henrybarefoot1987/engram-extract is built on Qwen3-1.7B (© Alibaba Cloud, Apache-2.0). Engram only adds the extraction prompt and the constrained-output configuration; the base model's weights, license, and notice are unchanged.

Enable it (desktop app): Preferences → AI Enhancement → toggle on, pick a model, Test connection, Save. The same tab shows a live status badge, activity stats (enhanced vs fallback extractions, contradictions filtered, average latency), and a recent-events list so you can see the layer actually working. Programmatically, GET /api/llm/status and GET /api/llm/stats expose the same data (all local — no telemetry).

Enable it (config file) — ~/.engram/config.json:

json
{  "llm": {    "provider": "ollama",    "endpoint": "http://localhost:11434",    "model": "llama3.2:3b",    "apiKey": null  }}

First: ollama pull llama3.2:3b. Set "provider": null to turn it back off (the default). For an OpenAI-compatible local server, use "provider": "openai-compatible" and point endpoint at it (e.g. http://localhost:1234); apiKey is sent only if set.

Privacy note: "no memory data leaves your device" is only literally true when endpoint is local (localhost/127.0.0.1). If you point it at a non-local host, memory content is sent there for classification — the desktop AI Enhancement tab shows an explicit warning in that case. If the model is unreachable, a circuit breaker pauses the layer and Engram falls back to rule-based extraction with no added latency.


Advanced usage

Sandboxed evaluation

Redirect Engram's data directory to a throwaway location so it doesn't touch ~/.engram/memory.db. Useful for first-time evaluators, CI runs, or testing the desktop sidecar against a fresh DB:

bash
# Via CLI flag (highest priority)engram start --data-dir /tmp/engram-eval
# Or via env varENGRAM_DATA_DIR=/tmp/engram-eval engram start
# Works on every Engram command that touches the DB:ENGRAM_DATA_DIR=/tmp/engram-eval engram remember "test memory" -c factENGRAM_DATA_DIR=/tmp/engram-eval engram recall "test"ENGRAM_DATA_DIR=/tmp/engram-eval engram status

Override priority: --data-dir flag > ENGRAM_DATA_DIR env var > dataDir in ~/.engram/config.json > default (~/.engram).

Namespace isolation

bash
engram remember "Uses Next.js 14 app router" -n my-saasengram remember "WordPress multisite + Redis" -n client-site
engram recall "what framework?" -n my-saas

Temporal queries

Time-range filtering is available via MCP and REST. Agents pass a time_filter object to engram_recall:

json
{  "query": "deployment changes",  "time_filter": { "after": "last week" }}
json
{  "query": "API decisions",  "time_filter": { "after": "2026-01-01", "before": "2026-06-01" }}

Supported shapes: after / before (ISO date or relative string like "3 days ago"), or period shorthand (today, yesterday, this_week, last_week, this_month, last_month, this_year, last_year).

Export context for documentation

bash
engram export-context -f markdown -n my-project -o PROJECT_CONTEXT.mdengram export-context -f claude -o CLAUDE.md

Programmatic usage

Engram also works as a library inside your Node.js app:

javascript
import {  loadConfig,  getDatabasePath,  getModelsPath,  initDatabase,  createMemory,  recallMemories} from '@hbarefoot/engram';
const config = loadConfig();const db = initDatabase(getDatabasePath(config));
createMemory(db, {  content: 'User prefers Fastify over Express',  category: 'preference',  confidence: 0.9});
const results = await recallMemories(  db,  'preferred web framework',  { limit: 5 },  getModelsPath(config));

Contributing

See CONTRIBUTING.md for development setup, the versioning policy (npm + desktop bump together), and the release checklist. The project's licensing and sustainability stance is in BUSINESS_MODEL.md — short version: pure OSS, MIT forever, no paywalls.

bash
git clone https://github.com/HBarefoot/engram.gitcd engramnpm installnpm run dev

If Engram is useful to you, here's how to help:

  • ⭐ Star the repo — the loudest signal that this is worth continuing.
  • 🐛 Open an issue — bug, feature request, or "we use Engram at <company> for <thing>" stories all welcome.
  • 💬 Start a discussion — design questions, integration ideas, "how would I…" — all good.
  • 💜 Support Engram — sponsor via Polar to fund continued development. No tier-locked features; sponsorship goes straight to keeping the project shipping.

Feedback

Using Engram? Tell me what's working and what isn't — open a Discussion, file feedback, or run engram feedback from the CLI. No telemetry, ever — Engram never phones home, so the only feedback I get is what you choose to send.


Find Engram on Glama

Engram is listed in the Glama MCP directory and the official MCP Registry as io.github.HBarefoot/engram.

[engram MCP server]


License

MIT © 2026 HBarefoot

來源:README.md,提交 133e7e2

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.6.3最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Engram 整合