Integration

Long-term memory for LangGraph

LangGraph's `InMemoryStore` is what it sounds like: one Python process, one memory. The moment your worker recycles, the graph's cross-thread store is gone. `EngramStore` is a `BaseStore` implementation that maps LangGraph's tuple-namespaces onto Engram buckets, with hybrid retrieval and persistence across processes.

Install

Three steps: sign up for an Engram API key, paste a BYOK LLM-provider key on /models, then drop the snippet below into LangGraph.

Three steps to memory in your agent

  1. Sign up. Free, no card. You'll land on a Getting Started page that walks the next two steps.
  2. Add your LLM key. Engram is BYOK. Paste an OpenAI / Anthropic / Groq / Together / Fireworks key and we'll route every extraction and query call through your provider. You pay your provider directly. We never see your inference.
  3. Paste the snippet below into your agent and restart it. Use Authorization: Bearer <api-key>with the API key from your portal.

engram-langgraph: durable BaseStore

Drop-in replacement for LangGraph's InMemoryStore with hybrid retrieval and cross-thread / cross-process persistence. Tuple namespaces map to Engram buckets. Source: github.com/lumetra-io/engram-langgraph.

  1. Install:
  2. Terminal
    pip install lumetra-engram langgraph
  3. Vendor engram_langgraph.py (~100 LOC) and export your API key:
  4. Terminal
    curl -fsSL https://raw.githubusercontent.com/lumetra-io/engram-langgraph/main/engram_langgraph.py -o engram_langgraph.py
    export ENGRAM_API_KEY="<api-key>"
  5. Pass an EngramStore to .compile():
  6. Python
    from langgraph.graph import StateGraph
    from engram_langgraph import EngramStore
    
    store = EngramStore(bucket_prefix="my-app")
    
    graph = (
        StateGraph(MyState)
        .add_node("step", my_node)
        .compile(store=store)
    )

What you can do once memory's wired in

  • Swap `InMemoryStore()` for `EngramStore()` in `.compile(store=...)` with zero other changes
  • Use `store.search(ns, query=...)` for hybrid retrieval, not just exact key lookup
  • Scope per-user state via `ns = ('user', user_id)`, since LangGraph's tuple namespaces map cleanly to bucket names
  • Persist graph checkpoints alongside user memory by combining `EngramStore` with LangGraph's checkpointer

FAQ

How do tuple namespaces become bucket names?

`EngramStore(bucket_prefix='my-app')` plus `ns=('user', 'jacob')` becomes bucket `my-app-user-jacob`. Predictable, slugified, no name collisions with other tenants.

Is `search(ns, query=...)` hybrid retrieval?

Yes. Passing a `query` argument routes the call to Engram's hybrid (BM25 + vector + KG) retrieval. Without a query, `search` does a list-then-filter inside the bucket.

What about `delete()` and `list()` performance on large buckets?

Per the README, `delete()` does a list-then-scan-then-delete and is fine for typical agent state, slow for thousands-of-items buckets. Profile if you're at that scale and ping the team. A batched API is on the roadmap.

Ship durable memory in LangGraph today

Free tier: 10K memories and 50K retrievals per month. No credit card. Same Engram backend powers all 41 integrations, so memories you write from one client are immediately queryable from the rest.