{"_id":"@neo4j-labs/agent-memory","_rev":"3-296d387f49d8774c4c42aff830e5fe0f","name":"@neo4j-labs/agent-memory","dist-tags":{"latest":"0.4.1"},"versions":{"0.3.0":{"name":"@neo4j-labs/agent-memory","version":"0.3.0","author":{"name":"Neo4j Labs"},"license":"Apache-2.0","_id":"@neo4j-labs/agent-memory@0.3.0","maintainers":[{"name":"adamcowley","email":"npmjs@adamcowley.co.uk"},{"name":"keesv","email":"kees@neo4j.com"},{"name":"antonio.neo","email":"antonio.barcelos@neo4j.com"},{"name":"oskarhane","email":"oh@oskarhane.com"},{"name":"johnymontana","email":"lyonwj@gmail.com"},{"name":"neo4j-drivers","email":"drivers@neotechnology.com"}],"homepage":"https://neo4j.com/labs/agent-memory/sdks/typescript","bugs":{"url":"https://github.com/neo4j-labs/agent-memory/issues"},"dist":{"shasum":"430f2d1a71adc9409351add2f39f86fd403d1438","tarball":"https://registry.npmjs.org/@neo4j-labs/agent-memory/-/agent-memory-0.3.0.tgz","fileCount":31,"integrity":"sha512-42a74A9QXYPpXdXqkCGOnNgm5uH3Ffu/XK8kPbkMTbFeUiIMmRMINp/jzEXzoAaupT6mLCQ4dNRQjbXk7/33pw==","signatures":[{"sig":"MEQCIFEV9yx0tYkIrfTtxx1Jx92FVHeF8rdhECtlZQ5kQAe5AiAQKIx0+e+xRWQqTzrBFS0YB9k+zp4T93q3SFA54sn86w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":353062},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./mcp":{"types":"./dist/mcp/index.d.ts","import":"./dist/mcp/index.js"},"./testing":{"types":"./dist/testing.d.ts","import":"./dist/testing.js"},"./integrations/mastra":{"types":"./dist/integrations/mastra.d.ts","import":"./dist/integrations/mastra.js"},"./integrations/strands":{"types":"./dist/integrations/strands.d.ts","import":"./dist/integrations/strands.js"},"./middleware/vercel-ai":{"types":"./dist/middleware/vercel-ai.d.ts","import":"./dist/middleware/vercel-ai.js"},"./integrations/langchain":{"types":"./dist/integrations/langchain.d.ts","import":"./dist/integrations/langchain.js"}},"gitHead":"828c088001c943836bdeadab04a5d09652459ebb","scripts":{"dev":"tsup --watch","lint":"tsc --noEmit","test":"vitest run test/unit test/integration","build":"npm run check:version && tsup","docs:api":"typedoc","test:all":"vitest run","test:e2e":"vitest run test/e2e","test:tck":"RUN_TCK_BRIDGE=1 vitest run test/tck","test:unit":"vitest run test/unit","tck:bronze":"RUN_TCK_BRIDGE=1 vitest run test/tck --grep Bronze","test:watch":"vitest","check:version":"node ./scripts/check-version-sync.mjs","prepublishOnly":"npm run build","test:integration":"vitest run test/integration","conformance:server":"tsx conformance/server.ts"},"_npmUser":{"name":"johnymontana","email":"lyonwj@gmail.com"},"repository":{"url":"git+https://github.com/neo4j-labs/agent-memory.git","type":"git","directory":"typescript"},"_npmVersion":"11.6.2","description":"Neo4j Labs: TypeScript client for the Neo4j Agent Memory Service (NAMS)","directories":{},"_nodeVersion":"25.0.0","_hasShrinkwrap":false,"devDependencies":{"msw":"^2.14.3","tsx":"^4.0.0","tsup":"^8.0.0","dotenv":"^17.4.2","vitest":"^2.0.0","typedoc":"^0.26.0","typescript":"^5.5.0","@types/node":"^20.0.0","@ai-sdk/provider":"^3.0.10","@opentelemetry/api":"^1.9.1","@strands-agents/sdk":"^1.2.0","@modelcontextprotocol/sdk":"^1.29.0"},"_npmOperationalInternal":{"tmp":"tmp/agent-memory_0.3.0_1779442543548_0.5095706764392121","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@neo4j-labs/agent-memory","version":"0.4.0","author":{"name":"Neo4j Labs"},"license":"Apache-2.0","_id":"@neo4j-labs/agent-memory@0.4.0","maintainers":[{"name":"adamcowley","email":"npmjs@adamcowley.co.uk"},{"name":"keesv","email":"kees@neo4j.com"},{"name":"antonio.neo","email":"antonio.barcelos@neo4j.com"},{"name":"oskarhane","email":"oh@oskarhane.com"},{"name":"johnymontana","email":"lyonwj@gmail.com"},{"name":"neo4j-drivers","email":"drivers@neotechnology.com"}],"homepage":"https://neo4j.com/labs/agent-memory/sdks/typescript","bugs":{"url":"https://github.com/neo4j-labs/agent-memory/issues"},"dist":{"shasum":"e1c278824ba17c833d35b1721a7a03524e97ec76","tarball":"https://registry.npmjs.org/@neo4j-labs/agent-memory/-/agent-memory-0.4.0.tgz","fileCount":31,"integrity":"sha512-iKUi+STQm0DQqDUDx0cR486RTMCHlPfmmHBqjyN/gaVXSBlaTzYaLp63D5O/qP5tDc4E4iqiMfMITLUabllTaw==","signatures":[{"sig":"MEUCIQCNKIpyg1p9PN8L+KncSjUSJezIHxWg/gdhuBr9ejD60AIgeS3w5GEyPTubm7lRu0MOVZ7+HuZ2e/Ha4PXel9i92WI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":396232},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./mcp":{"types":"./dist/mcp/index.d.ts","import":"./dist/mcp/index.js"},"./testing":{"types":"./dist/testing.d.ts","import":"./dist/testing.js"},"./integrations/mastra":{"types":"./dist/integrations/mastra.d.ts","import":"./dist/integrations/mastra.js"},"./integrations/strands":{"types":"./dist/integrations/strands.d.ts","import":"./dist/integrations/strands.js"},"./middleware/vercel-ai":{"types":"./dist/middleware/vercel-ai.d.ts","import":"./dist/middleware/vercel-ai.js"},"./integrations/langchain":{"types":"./dist/integrations/langchain.d.ts","import":"./dist/integrations/langchain.js"}},"gitHead":"8bd50eff9debbe7211a46b2d66ac74c94422f625","scripts":{"dev":"tsup --watch","lint":"tsc --noEmit","test":"vitest run test/unit test/integration","build":"npm run check:version && tsup","docs:api":"typedoc","test:all":"vitest run","test:e2e":"vitest run test/e2e","test:tck":"RUN_TCK_BRIDGE=1 vitest run test/tck","test:unit":"vitest run test/unit","tck:bronze":"RUN_TCK_BRIDGE=1 vitest run test/tck --grep Bronze","test:watch":"vitest","check:version":"node ./scripts/check-version-sync.mjs","prepublishOnly":"npm run build","test:integration":"vitest run test/integration","conformance:server":"tsx conformance/server.ts"},"_npmUser":{"name":"johnymontana","email":"lyonwj@gmail.com"},"repository":{"url":"git+https://github.com/neo4j-labs/agent-memory.git","type":"git","directory":"typescript"},"_npmVersion":"11.6.2","description":"Neo4j Labs: TypeScript client for the Neo4j Agent Memory Service (NAMS)","directories":{},"_nodeVersion":"25.0.0","_hasShrinkwrap":false,"devDependencies":{"msw":"^2.14.3","tsx":"^4.0.0","tsup":"^8.0.0","dotenv":"^17.4.2","vitest":"^2.0.0","typedoc":"^0.26.0","typescript":"^5.5.0","@types/node":"^20.0.0","@ai-sdk/provider":"^3.0.10","@opentelemetry/api":"^1.9.1","@strands-agents/sdk":"^1.2.0","@modelcontextprotocol/sdk":"^1.29.0"},"_npmOperationalInternal":{"tmp":"tmp/agent-memory_0.4.0_1780183540417_0.9259066835362655","host":"s3://npm-registry-packages-npm-production"}},"0.4.1":{"name":"@neo4j-labs/agent-memory","version":"0.4.1","description":"Neo4j Labs: TypeScript client for the Neo4j Agent Memory Service (NAMS)","type":"module","license":"Apache-2.0","author":{"name":"Neo4j Labs"},"repository":{"type":"git","url":"git+https://github.com/neo4j-labs/agent-memory.git","directory":"typescript"},"exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"},"./middleware/vercel-ai":{"import":"./dist/middleware/vercel-ai.js","types":"./dist/middleware/vercel-ai.d.ts"},"./mcp":{"import":"./dist/mcp/index.js","types":"./dist/mcp/index.d.ts"},"./integrations/langchain":{"import":"./dist/integrations/langchain.js","types":"./dist/integrations/langchain.d.ts"},"./integrations/mastra":{"import":"./dist/integrations/mastra.js","types":"./dist/integrations/mastra.d.ts"},"./integrations/strands":{"import":"./dist/integrations/strands.js","types":"./dist/integrations/strands.d.ts"},"./testing":{"import":"./dist/testing.js","types":"./dist/testing.d.ts"}},"homepage":"https://neo4j.com/labs/agent-memory/sdks/typescript","main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"npm run check:version && tsup","check:version":"node ./scripts/check-version-sync.mjs","dev":"tsup --watch","test":"vitest run test/unit test/integration","test:unit":"vitest run test/unit","test:integration":"vitest run test/integration","test:e2e":"vitest run test/e2e","test:all":"vitest run","test:watch":"vitest","test:tck":"RUN_TCK_BRIDGE=1 vitest run test/tck","tck:bronze":"RUN_TCK_BRIDGE=1 vitest run test/tck --grep Bronze","lint":"tsc --noEmit","docs:api":"typedoc","conformance:server":"tsx conformance/server.ts","prepublishOnly":"npm run build"},"devDependencies":{"@ai-sdk/provider":"^3.0.10","@modelcontextprotocol/sdk":"^1.29.0","@opentelemetry/api":"^1.9.1","@strands-agents/sdk":"^1.2.0","@types/node":"^20.0.0","dotenv":"^17.4.2","msw":"^2.14.3","tsup":"^8.0.0","tsx":"^4.0.0","typedoc":"^0.26.0","typescript":"^5.5.0","vitest":"^2.0.0"},"engines":{"node":">=20.0.0"},"gitHead":"b017db4449d592a982944986c2e3c18652bb36ad","_id":"@neo4j-labs/agent-memory@0.4.1","bugs":{"url":"https://github.com/neo4j-labs/agent-memory/issues"},"_nodeVersion":"25.0.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-93e47GTUyQ/HxzwXM1h+iZtZtaUyUX1Bcd7yBpUm0SYqC/qE1MB5QO0/jP0pnPNtBwYq+nZac23Hsht5NpCMQA==","shasum":"a3961f988d2dac58e7f9e1a100e3a6ab2d5d16b6","tarball":"https://registry.npmjs.org/@neo4j-labs/agent-memory/-/agent-memory-0.4.1.tgz","fileCount":31,"unpackedSize":415944,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD3VJItex0XCZpV0E6N4JhJAGc9luIGx8jE2MvDGXWFjQIgKjSZgsc0eudoBD224uo7vLV3mg8FwI+mtHUSedaTi1Q="}]},"_npmUser":{"name":"johnymontana","email":"lyonwj@gmail.com"},"directories":{},"maintainers":[{"name":"adamcowley","email":"npmjs@adamcowley.co.uk"},{"name":"keesv","email":"kees@neo4j.com"},{"name":"antonio.neo","email":"antonio.barcelos@neo4j.com"},{"name":"oskarhane","email":"oh@oskarhane.com"},{"name":"johnymontana","email":"lyonwj@gmail.com"},{"name":"neo4j-drivers","email":"drivers@neotechnology.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agent-memory_0.4.1_1784743159154_0.07149855749388645"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-22T09:35:43.389Z","modified":"2026-07-22T17:59:19.466Z","0.3.0":"2026-05-22T09:35:43.713Z","0.4.0":"2026-05-30T23:25:40.602Z","0.4.1":"2026-07-22T17:59:19.287Z"},"bugs":{"url":"https://github.com/neo4j-labs/agent-memory/issues"},"author":{"name":"Neo4j Labs"},"license":"Apache-2.0","homepage":"https://neo4j.com/labs/agent-memory/sdks/typescript","repository":{"type":"git","url":"git+https://github.com/neo4j-labs/agent-memory.git","directory":"typescript"},"description":"Neo4j Labs: TypeScript client for the Neo4j Agent Memory Service (NAMS)","maintainers":[{"name":"adamcowley","email":"npmjs@adamcowley.co.uk"},{"name":"keesv","email":"kees@neo4j.com"},{"name":"antonio.neo","email":"antonio.barcelos@neo4j.com"},{"name":"oskarhane","email":"oh@oskarhane.com"},{"name":"johnymontana","email":"lyonwj@gmail.com"},{"name":"neo4j-drivers","email":"drivers@neotechnology.com"}],"readme":"# @neo4j-labs/agent-memory\n\n![Neo4j Labs](https://img.shields.io/badge/Neo4j-Labs-6366F1?logo=neo4j)\n![Status: Beta](https://img.shields.io/badge/Status-Beta-6366F1)\n![Community Supported](https://img.shields.io/badge/Support-Community-6B7280)\n\n> **Now on npm.** Install with `npm install @neo4j-labs/agent-memory`\n> ([package page](https://www.npmjs.com/package/@neo4j-labs/agent-memory)).\n> Source lives alongside the Python SDK at\n> [`neo4j-labs/agent-memory`](https://github.com/neo4j-labs/agent-memory)\n> (relocated from `neo4j-labs/agent-memory-tck`).\n\n> TypeScript client for the Neo4j Agent Memory Service — short-term,\n> long-term, and reasoning memory for AI agents, backed by Neo4j.\n\n> ⚠️ **Neo4j Labs Project**\n>\n> This project is part of Neo4j Labs and is actively maintained, but not\n> officially supported. There are no SLAs or guarantees around backwards\n> compatibility and deprecation. For questions and support, please use\n> the [Neo4j Community Forum](https://community.neo4j.com).\n\n## ✨ Features\n\n- Three memory subclients in one client: **short-term** (conversations,\n  messages, three-tier context), **long-term** (entities, search,\n  relationships, graph view), and **reasoning** (steps, traces,\n  provenance, tool calls).\n- Zero-config construction — reads `MEMORY_API_KEY` from the\n  environment and defaults to the hosted service.\n- Works in Node 20+, Bun, Deno, Cloudflare Workers, and Vercel Edge.\n- Five framework integrations: Vercel AI SDK middleware, MCP tools,\n  LangChain JS, Mastra, and AWS Strands Agents.\n- Built-in request logging, request-id correlation, and edge-friendly\n  `fetch`-only transports.\n- TCK Bronze conformance verified by the\n  [agent-memory-tck](https://github.com/neo4j-labs/agent-memory-tck)\n  cross-language test suite.\n\n## 📦 Installation\n\n```bash\nnpm install @neo4j-labs/agent-memory\n```\n\nRequires Node.js 20+.\n\n## 🚀 Quick start\n\nGet an API key from [memory.neo4jlabs.com](https://memory.neo4jlabs.com),\nexport it as `MEMORY_API_KEY`, then:\n\n```ts\nimport { MemoryClient } from \"@neo4j-labs/agent-memory\";\n\nconst client = new MemoryClient();\n\nconst conv = await client.shortTerm.createConversation({ userId: \"alice\" });\nawait client.shortTerm.addMessage(conv.id, \"user\", \"Hello!\");\n\nconst entity = await client.longTerm.addEntity(\"Alice Johnson\", \"person\", {\n  description: \"Software engineer working on graph memory.\",\n});\n\nconst ctx = await client.shortTerm.getContext(conv.id);\nconsole.log(ctx.recentMessages, ctx.observations, ctx.reflections);\n```\n\n### On the edge\n\nEdge runtimes (Cloudflare Workers, Vercel Edge) expose environment\nvariables via the request handler scope, not `process.env`. Pass the key\nexplicitly:\n\n```ts\nexport default {\n  async fetch(req: Request, env: { MEMORY_API_KEY: string }) {\n    const client = new MemoryClient({ apiKey: env.MEMORY_API_KEY });\n    // ...\n  },\n};\n```\n\n## 🧩 Integrations\n\nAll four ship as subpath exports. See each integration's\n[example](./examples) and how-to guide for a runnable walkthrough.\n\n| Integration | Import | Example |\n|---|---|---|\n| **Vercel AI SDK** | `@neo4j-labs/agent-memory/middleware/vercel-ai` | [`examples/vercel-ai`](./examples/vercel-ai) |\n| **MCP tools** | `@neo4j-labs/agent-memory/mcp` | [`examples/mcp`](./examples/mcp) |\n| **LangChain JS** | `@neo4j-labs/agent-memory/integrations/langchain` | [`examples/langchain`](./examples/langchain) |\n| **Mastra** | `@neo4j-labs/agent-memory/integrations/mastra` | [`examples/mastra`](./examples/mastra) |\n| **AWS Strands** | `@neo4j-labs/agent-memory/integrations/strands` | [`examples/strands`](./examples/strands) |\n\n## 📖 Documentation\n\n- [TypeScript SDK landing page](https://neo4j.com/labs/agent-memory/sdks/typescript)\n- [Tutorial: First Agent Memory (TypeScript)](https://neo4j.com/labs/agent-memory/tutorials/first-agent-memory-typescript)\n- [How-to guides](https://neo4j.com/labs/agent-memory/how-to/typescript) — authentication,\n  edge deployment, error handling, observability, framework integrations\n- [Concept: short-term vs long-term vs reasoning memory](https://neo4j.com/labs/agent-memory/explanation/memory-types)\n- [Architecture overview](https://neo4j.com/labs/agent-memory/explanation/graph-architecture)\n- [Troubleshooting](https://neo4j.com/labs/agent-memory/how-to/typescript/troubleshooting)\n\nFull API reference (TypeDoc) is published at\n[neo4j-labs.github.io/agent-memory/typescript/](https://neo4j-labs.github.io/agent-memory/typescript/).\n\n## 🔧 Configuration\n\nThe client accepts a small options bag:\n\n```ts\nnew MemoryClient({\n  endpoint: \"https://memory.neo4jlabs.com/v1\",  // default\n  apiKey: \"nams_...\",                            // falls back to MEMORY_API_KEY env\n  timeout: 30_000,                               // ms; default 30s\n  headers: { \"X-My-Trace\": \"...\" },              // additional request headers\n  logger: (event) => console.log(event),         // request/response/error events\n});\n```\n\n`connect()` is optional — the first request acts as the implicit auth\ncheck. Call it explicitly if you prefer fail-fast at startup.\n\n## 🤝 Contributing\n\nWe welcome contributions. See the repo-root\n[CONTRIBUTING.md](https://github.com/neo4j-labs/agent-memory/blob/main/CONTRIBUTING.md)\nfor the development setup, test commands, and PR conventions — there is a\ndedicated \"TypeScript contributions\" section covering Node setup, vitest,\nlinting, and the TCK bridge.\n\nThis package lives alongside the Python SDK\n([`neo4j-agent-memory`](https://pypi.org/project/neo4j-agent-memory/)) in\n[`neo4j-labs/agent-memory`](https://github.com/neo4j-labs/agent-memory).\nThe two SDKs implement the same memory model and share the same backend\n(NAMS). The cross-language behavioral contract is defined and certified\nby the [`agent-memory-tck`](https://github.com/neo4j-labs/agent-memory-tck)\nspec repo, which consumes this package from npm.\n\n## 💬 Support\n\n- [Neo4j Community Forum](https://community.neo4j.com) — questions and\n  discussion (primary)\n- [GitHub Issues](https://github.com/neo4j-labs/agent-memory/issues) —\n  bug reports and feature requests\n- Security vulnerabilities: see\n  [SECURITY.md](https://github.com/neo4j-labs/agent-memory/blob/main/SECURITY.md)\n\n## 📝 License\n\nApache-2.0 — see [LICENSE](./LICENSE).\n","readmeFilename":"README.md"}