Integration

Engram memory in Go, the official client

Go agents and services want a client that respects Go conventions: `context.Context` on every call, errors as values, and no non-stdlib deps. `engram-go` fits that brief. It uses stdlib `net/http`, targets Go 1.21+, is safe for concurrent use, and surfaces typed errors via `*engram.Error` that work with `errors.As`.

Install

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

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-go: the official Go client

Zero runtime deps (stdlib net/http), Go 1.21+,context.Context on every method, safe for concurrent use. Source: github.com/lumetra-io/engram-go · pkg.go.dev: pkg.go.dev/.../engram-go.

  1. Install:
  2. Terminal
    go get github.com/lumetra-io/engram-go@latest
  3. Set ENGRAM_API_KEY in your environment and call from server-side code:
  4. Go
    package main
    
    import (
        "context"
        "fmt"
    
        engram "github.com/lumetra-io/engram-go"
    )
    
    func main() {
        client, err := engram.NewClient(engram.Options{}) // reads ENGRAM_API_KEY
        if err != nil { panic(err) }
    
        ctx := context.Background()
        _, _ = client.StoreMemory(ctx, "User prefers dark mode.", "user-123")
    
        res, err := client.Query(ctx, "What are this user's preferences?",
            engram.QueryOptions{Buckets: []string{"user-123"}})
        if err != nil { panic(err) }
        fmt.Println(res.Answer)
    }
  5. Surface includes StoreMemory, StoreMemories, Query, ListMemories, DeleteMemory, ClearMemories, ListBuckets, CreateBucket, DeleteBucket, GetProfile, RegenerateProfile. Errors return *engram.Error with .Status + .Body. Use errors.As to inspect.

What you can do once memory's wired in

  • Add memory to a Go service running alongside a vector DB or an existing production agent
  • Call from a Temporal workflow where deterministic, dependency-light requests matter
  • Embed in CLI tools where binary size and startup time matter (no cgo, no large deps)
  • Use inside the OpenClaw or Crush agent stacks, both of which already ship native Go integrations

FAQ

Does it support cancellation via context?

Yes. Every method takes a `context.Context` and respects cancellation and deadlines. Use `context.WithTimeout` for per-call SLAs.

How do I distinguish 4xx from 5xx errors?

Wrapped errors implement `*engram.Error` with a `.Status` field. `errors.As(err, &e)` lets you switch on `e.Status`, the same approach the AWS SDK uses.

Is the client safe to share across goroutines?

Yes. `engram.Client` is concurrent-safe; create one and reuse it. No need for sync.Pool or per-goroutine instances.

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