Integration

Long-term memory for LibreChat

LibreChat is the self-hosted ChatGPT: multi-tenant, multi-model, running on your hardware. Its built-in memory is per-conversation. Add Engram via `librechat.yaml` and every LibreChat user gets durable memory scoped to their own Engram account via OAuth, with no shared API key and no per-user-var gymnastics.

Install

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

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-librechat: self-hosted ChatGPT alternative

Engram's MCP server advertises OAuth, so each LibreChat user authenticates from inside the app, no shared key in librechat.yaml, no per-user-var dance. Source: github.com/lumetra-io/engram-librechat.

  1. Add the engram entry under mcpServers in librechat.yaml:
  2. librechat.yaml
    mcpServers:
      engram:
        type: sse
        url: https://mcp.lumetra.io/mcp/sse
        timeout: 30000
        serverInstructions: true
  3. Restart LibreChat (docker compose down && docker compose up -d or a plain process restart). Switch to Agents mode → New Agent. The Engram tools appear under available MCP tools. Each user goes through the OAuth flow once when they first invoke a tool.
or

Alternative: shared bearer-token (single-user / personal deploys)

Skip the OAuth flow and use one shared Engram key. Fine for personal LibreChat instances; not recommended for multi-tenant.

  1. Add ENGRAM_API_KEY to your LibreChat .env:
  2. .env
    ENGRAM_API_KEY=<api-key>
  3. Use this librechat.yaml entry instead (note the headers block):
  4. librechat.yaml
    mcpServers:
      engram:
        type: sse
        url: https://mcp.lumetra.io/mcp/sse
        headers:
          Authorization: "Bearer ${ENGRAM_API_KEY}"
        timeout: 30000
        serverInstructions: true

What you can do once memory's wired in

  • Give each LibreChat user a private bucket they control, isolated from every other user on the deployment
  • Remember user-specific preferences across sessions without leaking them between accounts
  • Recall conversation history across LibreChat upgrades, container restarts, and even hardware migrations
  • Set up one shared bucket for a team workspace and separate buckets per user for personal context

FAQ

Does each user need their own Engram account?

Yes, in OAuth mode. That's the point: each user signs in to Lumetra on first use, and their LibreChat session gets a token bound to their tenant. Buckets and billing are per-user.

What if I'm running LibreChat single-user and don't want the OAuth dance?

Use the alternative `headers: Authorization: Bearer ${ENGRAM_API_KEY}` config and set `ENGRAM_API_KEY=eng_live_...` in `.env`. Fine for personal deploys, not recommended for shared instances.

Where do the memory tools show up in LibreChat?

Both surfaces by default: in regular chat mode (the tools dropdown below the message input, when you're on a tool-capable endpoint like OpenAI / Anthropic / Google / Bedrock) and in Agent Builder under available MCP tools. Admins can restrict any server to Agent-only via `chatMenu: false` on the `mcpServers` entry if they prefer.

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