Integration

Engram memory in TypeScript: the official client

When your agent isn't an off-the-shelf product but your own code, you want a thin client. Not a bridge, not an adapter, just `await engram.storeMemory(...)`. `@lumetra/engram` is that: zero runtime dependencies, ESM and CJS, full `.d.ts`, and it runs in Node 18+, Bun, Deno, and edge runtimes.

Install

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

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 TypeScript client

Zero runtime deps, ESM + CJS, full .d.ts. Node 18+, Bun, Deno, edge runtimes. Source: github.com/lumetra-io/engram-js · npm: @lumetra/engram.

  1. Install:
  2. Terminal
    npm install @lumetra/engram
  3. Set ENGRAM_API_KEY in your server-side env (never NEXT_PUBLIC_*) and call from a route handler:
  4. server-side TypeScript
    import { EngramClient } from '@lumetra/engram';
    
    const engram = new EngramClient({ apiKey: process.env.ENGRAM_API_KEY });
    
    await engram.storeMemory('User prefers dark mode.', 'user-123');
    
    const { answer, explanation } = await engram.query(
      "What are this user's preferences?",
      { buckets: ['user-123'] }
    );
  5. Surface includes storeMemory, storeMemories, query, listMemories, deleteMemory, clearMemories, listBuckets, createBucket, deleteBucket, getProfile, regenerateProfile. Errors throw EngramError with status + body.

What you can do once memory's wired in

  • Build a Next.js app where the API routes call Engram directly from server code
  • Wrap memory tools for the Vercel AI SDK's `tool()` adapter (see the dedicated Vercel AI SDK panel)
  • Embed memory in a Cloudflare Worker. Zero deps means it ships under the bundle limit.
  • Use as the foundation for your own framework adapter. The surface mirrors the REST API one-to-one.

FAQ

Why zero runtime dependencies?

Stability and bundle size. The client uses `fetch` (available everywhere modern) and nothing else. No supply-chain surface to audit, no edge-runtime compatibility issues.

What's the full surface area?

`storeMemory`, `storeMemories` (batch), `query`, `listMemories`, `deleteMemory`, `clearMemories`, `listBuckets`, `createBucket`, `deleteBucket`, `getProfile`, `regenerateProfile`. Mirrors the REST surface 1:1.

Does it work in browsers?

Technically yes, but you shouldn't: the API key would be visible in client-side JS. Always call from a server route, Edge function, or backend service.

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