Skip to Content
AgentMem is in active development. Star us on GitHub.
Getting started

Getting started

This walks you from “never heard of AgentMem” to “memory working in an agent” in about three minutes.

1. Sign up and get an API key

  1. Open the dashboard: agentmem-dashboard.vercel.app 
  2. Click “No account? Sign up” — enter your email, a password, and (optionally) an organization name. An org is created for you automatically.
  3. Confirm the email Supabase sends you (or sign in directly if email confirmation is off for the project).
  4. You’ll land on the API Keys tab. Click Create key, give it a name, copy the sk-... shown once — the dashboard won’t show it again.

Keys are scoped to your org. To bring in a teammate, go to the Members tab → invite by email → share the generated link. They sign up via that link and land in your org instead of getting a new one.

2. Install the SDK

The fastest path is the init CLI — it detects your project, installs the SDK, drops an env placeholder, and writes a demo script:

npx @agentmem/cli init

Or install the SDK manually:

npm install @agentmem/sdk # or pnpm add @agentmem/sdk

3. Write your first memory

import { MemoryStore } from '@agentmem/sdk' const mem = new MemoryStore({ apiKey: process.env.AGENTMEM_API_KEY! }) const { writeId } = await mem.write({ content: 'Customer prefers email over phone. Escalation threshold is $500.', agentId: 'support-bot', scope: 'team', // private | team | global — see Concepts role: 'executor', // optional — used by conflict policies workflowId: 'wf-123', // optional — groups related memories }) console.log({ writeId })

The call returns as soon as the memory is written and indexed. Entity extraction (for graph search) happens asynchronously in the background.

const hits = await mem.search({ query: 'how do we handle customer escalations?', agentId: 'support-bot', topK: 5, }) for (const hit of hits) { console.log(hit.score, hit.content) }

Under the hood, AgentMem runs three retrieval strategies in parallel — semantic similarity (pgvector), keyword (BM25), and entity-graph traversal — and merges them with Reciprocal Rank Fusion. The returned score is the fused score.

For higher precision (at the cost of ~500–1500ms of latency), pass rerank: true and AgentMem will re-score the top candidates with Gemini. See Re-ranking.

  • Core concepts — what scopes, roles, and workflows mean, and how they interact. Don’t skip this; the model is opinionated and easier to use once you understand it.
  • MCP server — give Claude Desktop, Claude Code, or Cursor shared memory with one config block.
  • Conflict policies — what happens when two agents write contradictory facts.
  • Webhooks — subscribe to events from your backend.

REST equivalent

Every SDK call is a thin wrapper over the REST API. The above two calls in curl:

curl -X POST https://lwbwcuuzoituanwhekyo.supabase.co/functions/v1/api/v1/memory/write \ -H "Authorization: Bearer $AGENTMEM_API_KEY" \ -H "Content-Type: application/json" \ -d '{"content":"Customer prefers email","agentId":"support-bot","scope":"team"}' curl -X POST https://lwbwcuuzoituanwhekyo.supabase.co/functions/v1/api/v1/memory/search \ -H "Authorization: Bearer $AGENTMEM_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query":"customer escalations","agentId":"support-bot","topK":5}'
Last updated on