TypeScript SDK — @neo4j-labs/agent-memory
The TypeScript SDK is a thin HTTP client over the NAMS hosted service. It runs on Node 20+, Bun, Deno, Cloudflare Workers, and Vercel Edge.
Install
npm install @neo4j-labs/agent-memory
# or
pnpm add @neo4j-labs/agent-memory
bun add @neo4j-labs/agent-memory
Requires Node.js 20+.
Quick start
Get an API key from memory.neo4jlabs.com,
set MEMORY_API_KEY, then:
import { MemoryClient } from "@neo4j-labs/agent-memory";
const client = new MemoryClient();
const conv = await client.shortTerm.createConversation({ userId: "alice" });
await client.shortTerm.addMessage(conv.id, "user", "Hello!");
const entity = await client.longTerm.addEntity("Alice Johnson", "person", {
description: "Software engineer working on graph memory.",
});
const ctx = await client.shortTerm.getContext(conv.id);
console.log(ctx.recentMessages, ctx.observations, ctx.reflections);
For edge runtimes (Cloudflare Workers, Vercel Edge), pass the API key explicitly — see Edge Runtime.
Framework integrations
All five ship as subpath exports.
| Integration | Import | Guide |
|---|---|---|
Vercel AI SDK |
|
|
MCP tools |
|
|
LangChain JS |
|
|
Mastra |
|
|
AWS Strands |
|
Source and releases
-
Package:
@neo4j-labs/agent-memoryon npm -
Release tags:
typescript-v*(e.g.typescript-v0.3.0) -
Changelog: typescript/CHANGELOG.md
Looking for the Python SDK?
See Python SDK. The two SDKs share the same memory model and back onto the same NAMS service. Mixed Python + TypeScript agents can read and write the same memory.