mcpField
E
engram-server

engram-server

Local
java-ai-memory.devMemory & Knowledge23Updated 2w ago

About engram-server

Engram is a durable memory server for AI agents that extracts facts from conversations and stores them in a temporal knowledge graph backed by SQLite or PostgreSQL. It ships as a single binary without a Python sidecar, aimed at developers who want a self-hostable memory layer.

Key features

  1. 01Fact extraction from conversations
  2. 02SQLite or PostgreSQL storage
  3. 03Hybrid vector and keyword retrieval
  4. 04Temporal knowledge graph with scoped memory
  5. 05Multiple LLM backends and command extension

Use cases

  1. 01Keep user preferences and facts across sessions for a local agent
  2. 02Set up a lightweight memory layer in a single SQLite file
  3. 03Isolate memory per org, user or session in multi-user apps

MCP support

The server exposes an MCP interface over stdio with seven memory tools, including memory_add, memory_recall, memory_search and memory_forget, plus four message store tools. It also offers a REST mode.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"jamjet-labs-engram-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/jamjet-labs/engram-server:0.5.0"
]
}
}
}
Run commanddocker run -i --rm ghcr.io/jamjet-labs/engram-server:0.5.0

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
ocighcr.io/jamjet-labs/engram-server:0.5.0

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

⚡ Engram

Durable memory for AI agents — temporal knowledge graph, hybrid retrieval, SQLite or PostgreSQL.

crates.io (lib) crates.io (server) Docker MCP Registry License

java-ai-memory.dev · Main repo · JamJet docs · Discord


Engram is a durable memory layer for AI agents. It extracts facts from conversations, stores them in a temporal knowledge graph, and retrieves them with hybrid semantic + keyword search — backed by a single SQLite file or a PostgreSQL database.

It ships in two shapes:

  • jamjet-engram — a Rust library you embed in your own application.
  • jamjet-engram-server (this crate) — a standalone binary that speaks MCP over stdio and REST over HTTP, so Claude Desktop, Cursor, and any HTTP client can use it with no code.

Engram is provider-agnostic. Five LLM backends are wired in out of the box, and a sixth — command — lets you shell out to any external script, so you can plug in a provider Engram does not ship natively without touching Rust code:

ENGRAM_LLM_PROVIDER=What it does
ollama (default)Local Ollama via /api/chat. Free, no API keys, runs on your laptop.
openai-compatibleAny endpoint that speaks OpenAI's chat-completions protocol — see the long list below.
anthropicAnthropic Claude via the Messages API.
googleGoogle Gemini via generateContent with native JSON mode.
commandShell out to a user-supplied script. Infinite extensibility, zero recompile.
mockDeterministic tests-only backend — returns empty facts.

Pick one with ENGRAM_LLM_PROVIDER=… — the same binary handles all of them.

State of the project, April 2026. Engram is new — v0.3.2, small community, no public LongMemEval / DMR numbers yet. The architecture below works, the tests pass, the Docker image runs. If you need production-scale memory today, Mem0 Cloud and Zep Cloud are more mature. If you need a tryable, self-hostable, single-binary memory layer that doesn't require Python, Postgres, Qdrant, or Neo4j, Engram is built for you.

Why Engram?

ProblemEngram's answer
Every agent memory library is Python-firstRust core with native Python, Java, and MCP clients — no sidecar required
Needs Postgres + Qdrant + Neo4j just to trySingle SQLite file (zero infra) or Postgres when you need it
Conversation history is not knowledge memoryFact extraction pipeline — pulls structured facts out of messages
Old facts drift and contradict each otherConflict detection + consolidation — decay, promote, dedup, summarize, reflect
Memory recall is either semantic OR keywordHybrid retrieval — vector search + SQLite FTS5 in one query
Agents lose memory across processesDurable by default — SQLite or Postgres, crash-safe, portable
MCP support is an afterthoughtMCP-native — 7 tools exposed by a single binary
No time-travel over what the agent knewTemporal knowledge graph — every fact is scoped and timestamped
Can't isolate memory per user or tenantFirst-class scopes — org / user / session built into every query

Quickstart — 30 seconds

Engram speaks to four LLM providers out of the box: Ollama (default — free, local), OpenAI, Anthropic Claude, and Google Gemini. Pick one.

Option A — Ollama (free, local, zero API keys)

Requirements: Ollama with llama3.2 and nomic-embed-text pulled:

ollama pull llama3.2
ollama pull nomic-embed-text

Docker (easiest):

docker run --rm -i \
  -v engram-data:/data \
  ghcr.io/jamjet-labs/engram-server:0.3.2

The container defaults to Ollama at host.docker.internal:11434 — works out of the box on Docker Desktop for Mac and Windows. Linux users need --add-host=host.docker.internal:host-gateway.

Option B — Anthropic Claude (hosted, highest quality)
docker run --rm -i \
  -e ENGRAM_LLM_PROVIDER=anthropic \
  -e ANTHROPIC_API_KEY=sk-ant-... \
  -v engram-data:/data \
  ghcr.io/jamjet-labs/engram-server:0.3.2

Defaults to claude-haiku-4-5-20251001. Override with -e ENGRAM_ANTHROPIC_MODEL=claude-sonnet-4-6.

Note: Anthropic has no native JSON mode, so Engram parses JSON from text responses. The llm_util::extract_json_payload helper strips markdown fences that Claude occasionally emits.

Option C — Google Gemini
docker run --rm -i \
  -e ENGRAM_LLM_PROVIDER=google \
  -e GOOGLE_API_KEY=AIza... \
  -v engram-data:/data \
  ghcr.io/jamjet-labs/engram-server:0.3.2

Defaults to gemini-flash-latest. Override with -e ENGRAM_GOOGLE_MODEL=gemini-2.5-flash.

Option D — Any OpenAI-compatible endpoint
docker run --rm -i \
  -e ENGRAM_LLM_PROVIDER=openai-compatible \
  -e OPENAI_API_KEY=sk-... \
  -v engram-data:/data \
  ghcr.io/jamjet-labs/engram-server:0.3.2

Defaults to OpenAI itself (https://api.openai.com/v1, gpt-4o-mini). Change one env var to point at any of these providers without recompiling:

ProviderENGRAM_OPENAI_BASE_URL=Note
OpenAIhttps://api.openai.com/v1default
Azure OpenAIhttps://<resource>.openai.azure.com/openai/deployments/<deployment>
Groqhttps://api.groq.com/openai/v1very fast inference
Together.aihttps://api.together.xyz/v1
Mistralhttps://api.mistral.ai/v1
DeepSeekhttps://api.deepseek.com/v1
Perplexityhttps://api.perplexity.ai
OpenRouterhttps://openrouter.ai/api/v1one key, many models
Fireworkshttps://api.fireworks.ai/inference/v1
vLLM (self-hosted)http://your-host:8000/v1
LM Studiohttp://localhost:1234/v1local desktop app
LocalAIhttp://localhost:8080/v1self-hosted
Ollama /v1 compat layerhttp://localhost:11434/v1alternate path for Ollama
Your corporate LLM gatewaywhatever URL your infra team exposes

openai is accepted as a backwards-compatible alias for openai-compatible.

Option E — command (shell out to anything)

For providers Engram does not ship natively — an internal model behind a custom RPC, a raw SOAP endpoint, a local inference binary, a quick wrapper over a Python SDK, or tomorrow's new provider — use the command backend. Engram will spawn your script per extraction call, pipe a JSON request to its stdin, and read a JSON response from its stdout.

The contract. Your script reads one JSON object from stdin:

{"system": "<extraction prompt>", "user": "<conversation text>", "structured": true}

Then writes one JSON value to stdout. Either a bare value:

{"facts": [{"text": "...", "entities": [...], "confidence": 0.95, "category": "..."}]}

Or an envelope (useful for surfacing errors):

{"content": {"facts": [...]}}
{"error": "rate limited, try again"}

Exit 0 on success, non-zero (with stderr) on failure.

Example Python wrapper (~15 lines):

#!/usr/bin/env python3
# my-llm.py — wraps any Python SDK for Engram.
import json, sys
from my_llm_sdk import chat  # your SDK

req = json.loads(sys.stdin.read())
resp = chat(
    system=req["system"],
    user=req["user"],
    json_mode=req.get("structured", False),
)
sys.stdout.write(json.dumps(resp))

Point Engram at it:

docker run --rm -i \
  -e ENGRAM_LLM_PROVIDER=command \
  -e ENGRAM_LLM_COMMAND="python /scripts/my-llm.py" \
  -v $(pwd)/scripts:/scripts \
  -v engram-data:/data \
  ghcr.io/jamjet-labs/engram-server:0.3.2

Timeout is 120 seconds by default — override with ENGRAM_LLM_COMMAND_TIMEOUT=30.

Security: the command provider runs arbitrary commands as the Engram process user. Never use it in a multi-tenant deployment where untrusted users can set ENGRAM_LLM_COMMAND. It is a local and single-tenant feature.

Option F — cargo install (all providers same binary)
cargo install jamjet-engram-server
engram serve                                            # ollama (default)
ENGRAM_LLM_PROVIDER=anthropic ANTHROPIC_API_KEY=... engram serve
ENGRAM_LLM_PROVIDER=command ENGRAM_LLM_COMMAND="python /path/to/wrapper.py" engram serve
Option G — REST mode for testing
engram serve --mode rest --port 9090
curl -X POST http://localhost:9090/v1/memory \
  -H 'content-type: application/json' \
  -d '{
    "user_id": "alice",
    "messages": [
      {"role": "user", "content": "I am allergic to peanuts and I love sourdough."}
    ]
  }'

curl 'http://localhost:9090/v1/memory/recall?q=food%20allergies&user_id=alice'

No server. No config. No Python sidecar. One binary.


MCP client configuration

Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json)
{
  "mcpServers": {
    "engram": {
      "command": "docker",
      "args": [
        "run", "--rm", "-i",
        "-v", "engram-data:/data",
        "ghcr.io/jamjet-labs/engram-server:0.3.2"
      ]
    }
  }
}
Cursor / any MCP-aware IDE

Point it at the same docker run command, or at a locally-installed engram serve binary. After restart, eleven tools are available to the model (seven memory_* + four messages_*).


MCP tools

Memory tools (7)
ToolWhat it does
memory_addExtract and store facts from conversation messages (calls the LLM for extraction)
memory_recallSemantic search over stored facts, scoped by user_id / org_id
memory_contextAssemble a token-budgeted context block for an LLM prompt, with tier-aware selection
memory_searchKeyword search over facts (SQLite FTS5 / Postgres full-text)
memory_forgetSoft-delete a fact by ID with an optional reason
memory_statsAggregate counts: total facts, valid facts, entities, relationships
memory_consolidateRun a consolidation cycle — decay stale facts, promote high-value ones, dedup near-duplicates

All scoped by (org_id, user_id, session_id) — org is the coarsest, session the finest.

Message store tools (4)
ToolWhat it does
messages_saveSave chat messages for a conversation (optionally triggers fact extraction)
messages_getGet all messages for a conversation by ID
messages_listList all conversation IDs
messages_deleteDelete all messages for a conversation

REST API

Thirteen endpoints, rooted at /v1/memory. Full OpenAPI-style surface:

MethodPathHandler
GET/healthLiveness probe
POST/v1/memoryAdd messages (fact extraction)
GET/v1/memory/recall?q=…&user_id=…Semantic recall
POST/v1/memory/contextToken-budgeted context assembly
GET/v1/memory/search?q=…&user_id=…Keyword search
GET/v1/memory/statsAggregate statistics
POST/v1/memory/consolidateTrigger consolidation
DELETE/v1/memory/facts/:idForget a fact
DELETE/v1/memory/users/:idGDPR user-data delete
POST/v1/memory/messagesSave messages for a conversation
GET/v1/memory/messagesList conversation IDs
GET/v1/memory/messages/:idGet messages for a conversation
DELETE/v1/memory/messages/:idDelete a conversation

Configuration

All settings flow through CLI flags or environment variables. Env vars are the recommended way to configure the Docker image.

Core
CLI flagEnv varDefaultNotes
--dbENGRAM_DB_PATHengram.dbSQLite file path or postgres://… connection URL
--extract-on-saveENGRAM_EXTRACT_ON_SAVEtrueEnable fact extraction when saving chat messages
--modeENGRAM_MODEmcpmcp (stdio) or rest (HTTP)
--portENGRAM_PORT9090HTTP port in REST mode
--llm-providerENGRAM_LLM_PROVIDERollamaollama, openai-compatible (alias openai), anthropic, google, command, mock
--embedding-providerENGRAM_EMBEDDING_PROVIDERollamaollama or mock (cloud embedding providers are planned)
--embedding-modelENGRAM_EMBEDDING_MODELnomic-embed-textOllama embedding model
--embedding-dimsENGRAM_EMBEDDING_DIMS768Must match the embedding model's output
Ollama
CLI flagEnv varDefault
--ollama-urlENGRAM_OLLAMA_URLhttp://localhost:11434 (Docker image: http://host.docker.internal:11434)
--ollama-llm-modelENGRAM_OLLAMA_LLM_MODELllama3.2
OpenAI-compatible (OpenAI, Groq, Together, Mistral, DeepSeek, Azure, vLLM, …)
CLI flagEnv varDefault
--openai-api-keyOPENAI_API_KEY(required when provider is openai-compatible)
--openai-base-urlENGRAM_OPENAI_BASE_URLhttps://api.openai.com/v1 — change this to switch provider, see the big table above
--openai-modelENGRAM_OPENAI_MODELgpt-4o-mini
Anthropic
CLI flagEnv varDefault
--anthropic-api-keyANTHROPIC_API_KEY(required when provider is anthropic)
--anthropic-base-urlENGRAM_ANTHROPIC_BASE_URLhttps://api.anthropic.com
--anthropic-modelENGRAM_ANTHROPIC_MODELclaude-haiku-4-5-20251001
Google Gemini
CLI flagEnv varDefault
--google-api-keyGOOGLE_API_KEY(required when provider is google)
--google-base-urlENGRAM_GOOGLE_BASE_URLhttps://generativelanguage.googleapis.com/v1beta
--google-modelENGRAM_GOOGLE_MODELgemini-flash-latest
Command (shell-out)
CLI flagEnv varDefault
--llm-commandENGRAM_LLM_COMMAND(required when provider is command) — run via sh -c
--llm-command-timeoutENGRAM_LLM_COMMAND_TIMEOUT120 — seconds before the child is killed

The mock backend returns empty facts and deterministic byte-cycled vectors. It exists for tests and CI. The server prints a clear warning on startup if it detects mock mode in use. API keys and command contents are never echoed to stdout or logs — the server only describes provider model at base_url or command \<first 60 chars>``.


Database Backend

Engram supports SQLite (default) and PostgreSQL backends. The backend is selected by the --db URL:

# SQLite (default)
engram serve --mode rest --db engram.db

# PostgreSQL
engram serve --mode rest --db postgres://user:pass@localhost:5432/engram

When using PostgreSQL, tables are created automatically on first startup.


Chat Message Store

Engram can store raw chat messages alongside extracted facts. This enables Spring AI ChatMemoryRepository integration.

REST Endpoints:

MethodEndpointDescription
POST/v1/memory/messagesSave messages for a conversation
GET/v1/memory/messagesList conversation IDs
GET/v1/memory/messages/{id}Get messages for a conversation
DELETE/v1/memory/messages/{id}Delete a conversation

MCP Tools: messages_save, messages_get, messages_list, messages_delete

Fact extraction on message save is controlled by --extract-on-save (default: true).


Embedding the library

If you don't want a separate process, depend on jamjet-engram directly:

[dependencies]
jamjet-engram = "0.3.2"
use engram::{Memory, OllamaEmbeddingProvider, OllamaLlmClient, Scope, ExtractionConfig, Message};

let embedding = Box::new(OllamaEmbeddingProvider::new());
let memory = Memory::open("sqlite:engram.db?mode=rwc", embedding).await?;

let scope = Scope::user("default", "alice");
let messages = vec![Message {
    role: "user".into(),
    content: "I am allergic to peanuts.".into(),
}];

let llm = Box::new(OllamaLlmClient::new());
let fact_ids = memory
    .add_messages(&messages, scope.clone(), llm, ExtractionConfig::default())
    .await?;

// Later, recall
let facts = memory.recall(&engram::memory::RecallQuery {
    query: "food allergies".into(),
    scope: Some(scope),
    max_results: 5,
    as_of: None,
    min_score: None,
}).await?;

Other languages

Engram is part of the JamJet ecosystem. These clients speak to engram-server over REST:

LanguagePackageInstall
Pythonjamjet (includes EngramClient)pip install jamjet
Javadev.jamjet:jamjet-sdk (includes EngramClient)Maven Central
Spring Bootdev.jamjet:engram-spring-boot-starterMaven Central — zero-config @Bean EngramMemory
Rustjamjet-engram (embed directly)cargo add jamjet-engram

See java-ai-memory.dev for how Engram compares to LangChain4j ChatMemory, Spring AI ChatMemory, Koog, Embabel, Google ADK Memory Bank, the Mem0 community wrapper, and Zep — with honest notes on where Engram fits and where the alternatives are more mature.


Architecture

┌──────────────────────────────────────────────────────────┐
│           Clients: Claude Desktop, Cursor, JamJet,        │
│           Python SDK, Java SDK, Spring Boot, cURL         │
├─────────────────┬────────────────────────────────────────┤
│   MCP (stdio)   │           REST (HTTP + JSON)            │
├─────────────────┴────────────────────────────────────────┤
│                     engram-server                         │
│                 (jamjet-engram-server)                    │
├──────────────────────────────────────────────────────────┤
│                       engram (lib)                        │
│   Extraction pipeline  │  Hybrid retrieval  │  Scopes     │
│   Conflict detection   │  Consolidation     │  Context    │
├──────────────────────────────────────────────────────────┤
│    LlmClient trait        │    EmbeddingProvider trait    │
│    Ollama · Mock          │    Ollama · Mock              │
├──────────────────────────────────────────────────────────┤
│                       Storage                             │
│   SQLite or PostgreSQL (facts, entities, FTS, vectors)   │
└──────────────────────────────────────────────────────────┘

What Engram is not

  • Not just a chat-history store. Engram now includes a message store (see Chat Message Store), but its primary value is the fact extraction and knowledge graph layer on top. If all you need is the last N messages of a conversation, a framework's built-in window may be simpler.
  • Not a state checkpointer. If you need to snapshot agent execution state for resume and replay, that's what LangGraph, Koog persistence, or JamJet's own durable runtime does. Pair them with Engram — they solve different problems.
  • Not a managed service. No hosted plane, no auth layer beyond scopes, no SLA. Bring your own process manager.
  • Not benchmarked yet. LongMemEval and DMR numbers are on the roadmap. Until they exist, treat comparative claims with the skepticism they deserve.

Roadmap

StatusItem
✅Fact extraction pipeline + SQLite storage
✅Hybrid retrieval (vector + FTS5 with prefix matching)
✅Consolidation engine (decay, promote, dedup, summarize, reflect)
✅MCP stdio server (7 tools)
✅REST API (9 endpoints)
✅Multi-provider LLM backends: Ollama, OpenAI-compatible (OpenAI/Azure/Groq/Together/Mistral/vLLM/LM Studio/…), Anthropic, Google, command shell-out
✅Python, Java, Spring Boot clients
✅Docker image, MCP Registry publish
✅Postgres backend (in parallel to SQLite)
✅Chat message store + Spring AI ChatMemoryRepository integration
📋LongMemEval + DMR benchmark scores
📋Quarkus extension
📋Cloud embedding providers (OpenAI text-embedding-3, Google text-embedding-004)

License

Apache 2.0 — see LICENSE.


Part of JamJet · Built by Sunil Prakash · © 2026 JamJet Labs

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.