Integration

Long-term memory for Simon Willison's llm CLI

Simon Willison's `llm` CLI is the go-to tool for talking to language models from the shell, but its chat memory is per-conversation. `llm-engram` registers six tools. Run `llm install llm-engram` and any model under `llm` can store and recall across sessions, with semantic and knowledge-graph retrieval handled server-side.

Install

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

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.

llm-engram: Simon Willison's llm CLI plugin

Registers six tools that let any model running under llm store and recall facts across sessions. No MCP bridge; the plugin calls Engram's REST API directly. Source: github.com/lumetra-io/engram-llm.

  1. Install the plugin:
  2. Terminal
    llm install llm-engram
  3. Export your API key (and optionally a default bucket):
  4. Terminal
    export LLM_ENGRAM_API_KEY="<api-key>"
    export LLM_ENGRAM_DEFAULT_BUCKET=my-project    # optional
  5. Use in any llm invocation:
  6. Terminal
    llm -T engram_store_memory "Remember: I prefer pytest over unittest."
    llm -T engram_query_memory "What testing framework do I prefer?"
    
    # Or interactive chat with memory wired in:
    llm chat -T engram_store_memory -T engram_query_memory \
             -T engram_list_memories -T engram_list_buckets

What you can do once memory's wired in

  • `llm -T engram_store_memory "I prefer pytest over unittest"`: one shot, remembered forever
  • `llm chat -T engram_query_memory -T engram_store_memory` for interactive chat with memory available
  • Pin a default bucket per project with `LLM_ENGRAM_DEFAULT_BUCKET=my-project` so you don't have to repeat it
  • Pipe shell output into memory: `cat decisions.md | llm -T engram_store_memory "$(cat)"`

FAQ

Is this an `llm` plugin or an MCP server?

An `llm` plugin, installed via `llm install llm-engram`. No MCP bridge: the plugin calls Engram's REST API directly.

Where should I store the API key?

The idiomatic `llm` pattern is `llm keys set engram`, which stores the key encrypted in `llm`'s `keys.json` and the plugin reads it from there. Two env-var fallbacks are also accepted: `ENGRAM_API_KEY` (the canonical Engram env var, shared with every other Lumetra client) and `LLM_ENGRAM_API_KEY` (a plugin-prefixed alias for users who want to namespace plugin secrets). `llm`'s core CLI doesn't define a `LLM_*` env-var convention itself, so prefer `llm keys set` when you can.

Can I use this with any model `llm` supports?

Yes. Engram is tool-call-based, so any model that supports tool calling under `llm` can use it. That covers most modern models (OpenAI, Anthropic, local via llm-ollama, and so on).

Ship durable memory in llm (simonw) 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.