Skip to content
open source · mit · self-hostable

Memory for every model.

Give stateless LLMs a memory you can read, review and run on your own machine.

$ npx engramd
ask the brain →

pick a question, or click any neuron

    drag to rotate · hover to inspect · click to fire
    how it works

    Three quiet steps around every request.

    Engram sits between your app and the model. It recalls before the request, steps aside while the model answers, and learns after the reply.

    example trace · "what backend should I use?"0 ms
    recall
    embed the querybge-small-en-v1.5 · local
    4 ms
    ·
    score approved memoriesone SQL query
    5 ms
    answer
    inject 2 memoriesinto the system prompt
    1 ms
    ·
    forward to your providergpt-4o-mini
    810 ms
    learn
    extract durable factsbackground job
    1400 ms
    ·
    reconcile and queue2 pending · 1 skipped
    500 ms

    ↑ response returned at 820 msEverything to the right of that line runs in the background. Your user is already reading the answer.

    retrieval

    Only what matters reaches the model.

    Each memory is scored against the new message. Anything weak stays out, and every retrieval is logged so you can see why a fact was used.

    prefers fastapiinjected
    0.93
    uses postgres + pgvectorinjected
    0.85
    typescript on the frontendoutside the window
    0.59
    building sentineloutside the window
    0.47
    lives in berlinbelow threshold
    0.15
    meaningkeywordsrecencythresholdinjected window

    golden set · recall@5 0.969 · precision 0.745 · 1.8 injected per query

    learn

    It remembers what lasts, and asks first.

    After the reply, Engram pulls durable facts out of the conversation, rewrites relative dates as absolute ones, and checks them against what it already knows.

    "i always build python apis with fastapi"nearest memory · cosine 0.31below 0.60.6 or aboveone model call decidesaddpending reviewupdateas a revisionconflictyou pickskipredundant

    three ways in

    One memory, three ways in.

    Proxy

    Point any OpenAI-compatible client at Engram. Same request body, now with memory.

    POST /v1/chat
    curl localhost:8000/v1/chat \
      -H "X-Engram-Key: ek_…" \
      -H "X-Engram-Provider: openai" \
      -d '{"model": "gpt-4o-mini",
           "messages": […]}'

    REST API

    Add, search, edit and forget memories directly. Search returns the exact block the proxy would inject.

    PATCH /memories/{id}
    curl -X PATCH \
      localhost:8000/memories/mem_8f2c \
      -H "X-Engram-Key: ek_…" \
      -d '{"status": "approved"}'

    MCP

    Seven memory tools for Claude, Codex and any MCP client, scoped to one project at a time.

    npx engramd
    # tools
    search_memories   add_memory
    list_memories     update_memory
    delete_memory     capture_conversation
    get_retrieval_log
    self-host

    Yours to run.

    Four services in one Docker Compose file. Bring your own provider key; Engram encrypts it and never falls back to one of its own.

    terminal
    # 1. configure
    cp .env.example .env
    
    # 2. start the stack
    docker compose up -d
    
    # 3. create a user (the key is shown once)
    curl -X POST localhost:8000/users \
      -H "Content-Type: application/json" \
      -d '{"external_id": "me"}'
    your appany OpenAI-style clientClaude · Codexvia mcp · engramd :3000you, reviewingdashboard · Next.js :3001api · FastAPI:8000proxy /v1/chatREST /memorieslogs /logsembeddings run herebge-small-en-v1.5local · 384-dpostgres 16+ pgvector · :5432your provider key, encryptedopenaianthropicgeminiollamaone docker compose file · MIT