Engram

Created By
tstockham963 months ago
Universal memory layer for AI agents. Semantic recall, automatic consolidation, and bi-temporal knowledge — in SQLite. 80% on LOCOMO benchmark using 96% fewer tokens.
Overview

🧠 Engram

The intelligence layer for AI agents

npm version License: BSL 1.1 GitHub stars

Every AI agent is born smart but amnesiac. Engram fixes that. It doesn't just store memories -- it learns, consolidates patterns, detects contradictions, and surfaces context you didn't ask for.

Engram MCP server

Install

npm install -g engram-sdk
engram init

That's it. Works with Claude Code, Cursor, or any MCP client. Also available as a REST API and TypeScript SDK.


Why Engram

Existing memory solutions are storage layers -- they save facts and retrieve them. Engram is an intelligence layer with three tiers:

TierWhat it doesWho has it
Explicit MemoryStores facts, preferences, conversation turnsEveryone
Implicit MemoryDetects behavioral patterns from how users workEngram only
Synthesized MemoryConsolidation produces insights nobody asked forEngram only

Key insight: Engram invests intelligence at read time (when the query is known), not write time (when you don't know what'll matter). This is the fundamental architectural difference from Mem0, Zep, and LangMem.


Benchmarks

Evaluated on LOCOMO -- the standard benchmark for agent memory systems. Same benchmark Mem0 used to claim state of the art.

SystemAccuracyTokens/Query
Engram80.0%1,504
Full Context88.4%23,423
Mem0 (published)66.9%--
MEMORY.md28.8%--

10 conversations, 1,540 questions, 4 categories. 19.6% relative improvement over Mem0 with 93.6% fewer tokens than full context.

Full context (dumping entire conversation history) scores highest but uses 30x more tokens and can't scale past context window limits. Engram closes most of the gap while using 96.6% fewer tokens.

Full benchmark methodology and per-category breakdown


Features

  • MCP Server -- 10 memory tools for Claude Code, Cursor, and any MCP client
  • REST API -- Full HTTP API for any language or framework
  • TypeScript SDK -- Embedded use for Node.js agents
  • CLI -- Interactive REPL, bulk operations, eval tools
  • Model-agnostic -- Works with Gemini, OpenAI, Ollama, Groq, Cerebras (any OpenAI-compatible provider)
  • Zero infrastructure -- SQLite, no Docker, no Neo4j, no Redis
  • Consolidation -- LLM-powered memory merging, contradiction detection, pattern discovery
  • Entity-aware recall -- Knows "Sarah" in the query should boost memories about Sarah
  • Bi-temporal model -- Tracks when facts were true, not just when they were stored
  • Spreading activation -- Graph-based context surfacing

Quick Start

MCP Setup (Claude Code / Cursor)

npm install -g engram-sdk
engram init

REST API

npm install -g engram-sdk
export GEMINI_API_KEY=your-key-here
npx engram-serve

Server starts on http://127.0.0.1:3800.

Remember and Recall

# Store a memory
curl -X POST http://localhost:3800/v1/memories \
  -H "Content-Type: application/json" \
  -d '{"content": "User prefers TypeScript over JavaScript", "type": "semantic"}'

# Recall relevant memories
curl "http://localhost:3800/v1/memories/recall?context=language+preferences&limit=5"

TypeScript SDK

import { Vault } from 'engram-sdk';

const vault = new Vault({ owner: 'my-agent' });

await vault.remember('User prefers TypeScript');
const memories = await vault.recall('language preferences');
await vault.consolidate();

API Reference

Full REST API and MCP tool documentation: engram.fyi/docs


Configuration

VariableDescriptionDefault
GEMINI_API_KEYGemini API key for embeddings and consolidation--
ENGRAM_LLM_BASE_URLCustom API base URL (Groq, Cerebras, Ollama, etc.)provider default
ENGRAM_LLM_MODELLLM model nameprovider default
ENGRAM_DB_PATHSQLite database path~/.engram/default.db
PORTServer port3800
ENGRAM_AUTH_TOKENBearer token for API auth--

Benchmarks & Eval Scripts

This repo contains the evaluation scripts used to benchmark Engram:

  • eval-locomo.ts -- LOCOMO benchmark (the main result)
  • eval-letta.ts -- Letta Context-Bench evaluation
  • eval-codebase-v2.ts -- Enterprise codebase navigation benchmark
  • eval-enron.ts -- Email corpus evaluation

See EVAL.md for methodology and paper/engram-paper.md for the full research paper.


Pricing

TierPriceMemoriesAgents
Free$01,0001
Developer$29/mo10,0001
Team$99/mo50,0005
Business$499/moUnlimitedUnlimited
EnterpriseCustomCustomCustom

Hosted API coming soon. Self-hosting is free.


License

Proprietary License

Engram is proprietary software. You may install and use it freely for internal purposes. See LICENSE for full terms.

For commercial licensing, contact tstockham96@gmail.com.


Server Config

{
  "mcpServers": {
    "engram": {
      "command": "npx",
      "args": [
        "-y",
        "engram-sdk",
        "mcp"
      ],
      "env": {
        "GEMINI_API_KEY": "<YOUR_GEMINI_API_KEY>"
      }
    }
  }
}
Project Info
Created At
3 months ago
Updated At
3 months ago
Author Name
tstockham96
Star
-
Language
-
License
-
Category

Recommend Servers

View All
Bring your real authenticated browser session to AI coding agents. Local-first MCP server + Chrome MV3 extension. No cloud. No telemetry.
@Cubenest

peek records the user's actual logged-in browser (DOM via rrweb, console events, network metadata, optional response bodies via opt-in Deep capture) through a Chrome MV3 extension. The extension ships events through a native-messaging stdio bridge to a local MCP server (peek-mcp), which persists them to a SQLite database at ~/.peek/sessions.db. AI coding agents (Claude Code, Cursor, Cline, Windsurf) read sessions from the database via 10 MCP tools: Tool What it does list_recent_sessions List recently recorded sessions (id, origin, ts, event count). get_session_summary LLM-readable narrative summary of a session. get_session_console_errors Console errors recorded in a session. get_session_network_errors Failed/notable network requests in a session. get_user_action_before_error Last N user actions before a console error. generate_playwright_repro Generate a runnable Playwright test from a session. get_dom_snapshot Reconstruct the DOM at a given timestamp. query_dom_history Timeline of attribute/text changes for a selector. request_authorization Side-panel consent for write actions (Level 3). execute_action Dispatch a UI action (gated by permission level + destructive blocklist). Why local-first matters Every other "browser session for AI" tool ships to a vendor cloud. peek's SQLite + extension live on the user's machine — no remote endpoints, no telemetry. The privacy policy (docs/peek/PRIVACY_POLICY.md) is the source of truth. Install # 1. Add the MCP server to Claude Code claude mcp add peek -- npx -y @peekdev/mcp # 2. Install the Chrome extension from the Chrome Web Store # (link added once the CWS listing is approved)

4 hours ago
Gpt Scrambler

a day ago