Integration

Engram memory in Python: the official client

Python agents have a lot of memory options, most of them heavy. `lumetra-engram` is the opposite: pure stdlib (`urllib`), Python 3.9+, fully typed via `TypedDict`, and shipped with `py.typed`. Install it next to FastAPI, LangChain, or anything else. There's no dependency conflict because there's no dependency.

Install

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

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.

lumetra-engram: the official Python client

Zero runtime deps (stdlib urllib), Python 3.9+, fully typed via TypedDict + py.typed. Source: github.com/lumetra-io/engram-py · PyPI: lumetra-engram.

  1. Install:
  2. Terminal
    pip install lumetra-engram
  3. Set ENGRAM_API_KEY in your environment and call from server-side code (never ship the key to the browser):
  4. Python
    from lumetra_engram import EngramClient
    
    engram = EngramClient()  # reads ENGRAM_API_KEY from env
    
    engram.store_memory("User prefers dark mode.", "user-123")
    
    result = engram.query(
        "What are this user's preferences?",
        buckets=["user-123"],
    )
    print(result["answer"])
  5. Surface includes store_memory, store_memories, query, list_memories, delete_memory, clear_memories, list_buckets, create_bucket, delete_bucket, get_profile, regenerate_profile. Errors raise EngramError with .status + .body.

What you can do once memory's wired in

  • Power a FastAPI service where memory calls happen alongside DB queries in the request path
  • Add to existing LangChain / LlamaIndex / CrewAI projects without re-doing the dependency tree
  • Run inside Lambda or Cloud Functions: pure-stdlib means cold-start friendly, no compiled wheels
  • Use as the foundation for your own Python framework adapter (we did this for LangChain, LangGraph, etc.)

FAQ

Why `urllib` instead of `requests` or `httpx`?

To stay dependency-free. `urllib` is in the stdlib, so the wheel is tiny, the cold-start is fast, and there's no transitive-dep surprise. If you want `httpx` for async, wrap the client; it's stateless and thread-safe.

Is the client thread-safe?

It's stateless in practice: every call opens its own `urllib` request and doesn't share mutable state, so reusing one client across threads and instantiating per-request both work.

How do errors surface?

`EngramError` exception with `.status` (HTTP code) and `.body` (decoded JSON or raw text). Catch and inspect; error messages from the server come through verbatim.

Ship durable memory in Python 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.