{"_id":"@agentmem/claude-agent","_rev":"4-e2acafdddd23418744df6ed353d4bb28","name":"@agentmem/claude-agent","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@agentmem/claude-agent","version":"0.1.0","keywords":["anthropic","claude","claude-agent-sdk","ai","agents","memory","mcp"],"author":{"name":"rooney011","email":"bvsa2020@gmail.com"},"license":"Apache-2.0","_id":"@agentmem/claude-agent@0.1.0","maintainers":[{"name":"aneesh011","email":"bvsa2020@gmail.com"}],"homepage":"https://agentmem.dev","bugs":{"url":"https://github.com/rooney011/agentmem-sdk/issues"},"dist":{"shasum":"de802322324cf76377a606ddafde376b7c72996c","tarball":"https://registry.npmjs.org/@agentmem/claude-agent/-/claude-agent-0.1.0.tgz","fileCount":6,"integrity":"sha512-Tj5omvFPAHgn79l2BXHeKrAr9i/Pi+gPwQmkQ8RJfioXvCXW4ZQclqd3e3lH5qy9p45f6RaStNJld6aXoz4G1Q==","signatures":[{"sig":"MEYCIQD8nuYJzuotXy/Um5nzgbFWe5nspqyl9J0aX6KnfAKzUAIhAPq/Si0o+1fqz11D2cDey9coNQOFF+rLNmYHWV4jJYyJ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27148},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"09f74a9ca8eba6b0f810903a8b43d215627c3a64","scripts":{"dev":"tsup --watch","test":"node --test --import=tsx test/*.test.ts","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"aneesh011","email":"bvsa2020@gmail.com"},"repository":{"url":"git+https://github.com/rooney011/agentmem-sdk.git","type":"git","directory":"claude-agent"},"_npmVersion":"11.6.2","description":"AgentMem integration for the Claude Agent SDK — in-process MCP server + auto-recall hook","directories":{},"_nodeVersion":"24.11.0","dependencies":{"@agentmem/sdk":"^0.7.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","zod":"^4.0.0","tsup":"8.3.5","typescript":"5.8.3","@types/node":"^20.0.0","@anthropic-ai/claude-agent-sdk":"^0.3.144"},"peerDependencies":{"zod":"^4.0.0","@anthropic-ai/claude-agent-sdk":">=0.3.0 <0.4.0"},"_npmOperationalInternal":{"tmp":"tmp/claude-agent_0.1.0_1779179773183_0.009635375448168615","host":"s3://npm-registry-packages-npm-production"},"deprecated":"AgentMem is now DinoMem — install @dinomem/claude-agent"},"0.1.1":{"name":"@agentmem/claude-agent","version":"0.1.1","keywords":["anthropic","claude","claude-agent-sdk","ai","agents","memory","mcp"],"author":{"name":"rooney011","email":"bvsa2020@gmail.com"},"license":"Apache-2.0","_id":"@agentmem/claude-agent@0.1.1","maintainers":[{"name":"aneesh011","email":"bvsa2020@gmail.com"}],"homepage":"https://agentmem-dashboard.vercel.app","bugs":{"url":"https://github.com/rooney011/agentmem-sdk/issues"},"dist":{"shasum":"7427910fd6386461d0d43d672013111bd95eca38","tarball":"https://registry.npmjs.org/@agentmem/claude-agent/-/claude-agent-0.1.1.tgz","fileCount":6,"integrity":"sha512-f8eRJdtDQc862xEzFYD1WP+VWQwtdT0Vz+hbhQZ4EDO3I1YbBQ+C+OUEjh2Pmy8qyz4RBBA7NF+ITM+SbGtoiA==","signatures":[{"sig":"MEYCIQDGGfERNGpKWvL33AsCIhCq6bwgurG8PhYxExO0Bu/5TQIhAIQBmLqVjytMj4JVJNEZ1x9mv7Dmq8Z0CcFCfK0UJpKL","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27181},"main":"./dist/index.cjs","type":"module","_from":"file:agentmem-claude-agent-0.1.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","test":"node --test --import=tsx test/*.test.ts","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"aneesh011","email":"bvsa2020@gmail.com"},"_resolved":"C:\\Users\\admin\\AppData\\Local\\Temp\\15275760827164c5149a59e5f533d72a\\agentmem-claude-agent-0.1.1.tgz","_integrity":"sha512-f8eRJdtDQc862xEzFYD1WP+VWQwtdT0Vz+hbhQZ4EDO3I1YbBQ+C+OUEjh2Pmy8qyz4RBBA7NF+ITM+SbGtoiA==","repository":{"url":"git+https://github.com/rooney011/agentmem-sdk.git","type":"git","directory":"claude-agent"},"_npmVersion":"11.6.2","description":"AgentMem integration for the Claude Agent SDK — in-process MCP server + auto-recall hook","directories":{},"_nodeVersion":"24.11.0","dependencies":{"@agentmem/sdk":"^0.7.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","zod":"^4.0.0","tsup":"8.3.5","typescript":"5.8.3","@types/node":"^20.0.0","@anthropic-ai/claude-agent-sdk":"^0.3.144"},"peerDependencies":{"zod":"^4.0.0","@anthropic-ai/claude-agent-sdk":">=0.3.0 <0.4.0"},"_npmOperationalInternal":{"tmp":"tmp/claude-agent_0.1.1_1779362504343_0.014120800975668368","host":"s3://npm-registry-packages-npm-production"},"deprecated":"AgentMem is now DinoMem — install @dinomem/claude-agent"},"0.1.2":{"name":"@agentmem/claude-agent","version":"0.1.2","keywords":["anthropic","claude","claude-agent-sdk","ai","agents","memory","mcp"],"author":{"name":"rooney011","email":"bvsa2020@gmail.com"},"license":"Apache-2.0","_id":"@agentmem/claude-agent@0.1.2","maintainers":[{"name":"aneesh011","email":"bvsa2020@gmail.com"}],"homepage":"https://agentmem-dashboard.vercel.app","bugs":{"url":"https://github.com/rooney011/agentmem-sdk/issues"},"dist":{"shasum":"b77793c82cde613eeba075bbe137e264c3a4887e","tarball":"https://registry.npmjs.org/@agentmem/claude-agent/-/claude-agent-0.1.2.tgz","fileCount":6,"integrity":"sha512-Ytm5NrTXNmrcRqHLyQurGsZj3brx0FDvxcSJKjJ6M6roirOZTQ52nxm4C/lCiviwHg4pwArb76WQsZbt1fML8g==","signatures":[{"sig":"MEUCIEDDYZfqeS1JGp3CgTrbLw8EMWGAVowG4wGdNtHPyr0TAiEAuA0yUUUODs6PpHKyAlgj6P/AQ9Y0DOeuAluw8pKlyoE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27496},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"f31fc9e875004109181350fc0acdc81f0e4f1fc2","scripts":{"dev":"tsup --watch","test":"node --test --import=tsx test/*.test.ts","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"aneesh011","email":"bvsa2020@gmail.com"},"repository":{"url":"git+https://github.com/rooney011/agentmem-sdk.git","type":"git","directory":"claude-agent"},"_npmVersion":"11.6.2","description":"AgentMem integration for the Claude Agent SDK — in-process MCP server + auto-recall hook","directories":{},"_nodeVersion":"24.11.0","dependencies":{"@agentmem/sdk":"^0.8.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.0.0","zod":"^4.0.0","tsup":"8.3.5","typescript":"5.8.3","@types/node":"^20.0.0","@anthropic-ai/claude-agent-sdk":"^0.3.144"},"peerDependencies":{"zod":"^4.0.0","@anthropic-ai/claude-agent-sdk":">=0.3.0 <0.4.0"},"_npmOperationalInternal":{"tmp":"tmp/claude-agent_0.1.2_1779966739965_0.03752374051765539","host":"s3://npm-registry-packages-npm-production"},"deprecated":"AgentMem is now DinoMem — install @dinomem/claude-agent"}},"time":{"created":"2026-05-19T08:36:12.996Z","modified":"2026-07-16T15:43:55.441Z","0.1.0":"2026-05-19T08:36:13.335Z","0.1.1":"2026-05-21T11:21:44.503Z","0.1.2":"2026-05-28T11:12:20.131Z"},"bugs":{"url":"https://github.com/rooney011/agentmem-sdk/issues"},"author":{"name":"rooney011","email":"bvsa2020@gmail.com"},"license":"Apache-2.0","homepage":"https://agentmem-dashboard.vercel.app","keywords":["anthropic","claude","claude-agent-sdk","ai","agents","memory","mcp"],"repository":{"url":"git+https://github.com/rooney011/agentmem-sdk.git","type":"git","directory":"claude-agent"},"description":"AgentMem integration for the Claude Agent SDK — in-process MCP server + auto-recall hook","maintainers":[{"name":"aneesh011","email":"bvsa2020@gmail.com"}],"readme":"# @agentmem/claude-agent\n\n[AgentMem](https://agentmem-dashboard.vercel.app) integration for the [Claude Agent SDK](https://github.com/anthropics/claude-agent-sdk-typescript). Drops in two ways:\n\n1. **In-process MCP server** — gives the agent 8 memory tools (`memory_write`, `memory_search`, etc.) without spawning a separate process.\n2. **`UserPromptSubmit` hook** — auto-recalls relevant memories on every user turn so the agent has context *without ever calling a tool*.\n\n```bash\nnpm install @agentmem/claude-agent @anthropic-ai/claude-agent-sdk zod\n```\n\n## Quick start\n\n```ts\nimport { query } from '@anthropic-ai/claude-agent-sdk'\nimport { agentmemMcpServer, agentmemRecallHook } from '@agentmem/claude-agent'\n\nconst config = {\n  apiKey:  process.env.AGENTMEM_API_KEY!,\n  agentId: 'support-bot',\n}\n\nconst result = query({\n  prompt: 'help me debug this',\n  options: {\n    mcpServers: {\n      agentmem: agentmemMcpServer(config),\n    },\n    hooks: {\n      UserPromptSubmit: [{ hooks: [agentmemRecallHook(config)] }],\n    },\n  },\n})\n\nfor await (const msg of result) {\n  // ...\n}\n```\n\n## What each piece does\n\n### `agentmemMcpServer(config)`\n\nReturns an `McpSdkServerConfigWithInstance` from `createSdkMcpServer`. The agent gets these tools:\n\n| Tool | Purpose |\n|---|---|\n| `memory_write` | Persist a fact to long-term memory. |\n| `memory_search` | Hybrid retrieval (semantic + keyword + graph). |\n| `memory_get` | Fetch a memory by id. |\n| `memory_delete` | Soft-delete a memory. |\n| `memory_check_conflicts` | Detect contradictions before a write. |\n| `scratch_set` | Store transient working memory with optional TTL. |\n| `scratch_get` | Read a scratchpad key. |\n| `workflow_summarize` | Generate a Markdown brief over a workflow's memories. |\n\nTool descriptions are model-facing — Claude picks the right one without prompting hints.\n\n### `agentmemRecallHook(config)`\n\nA `UserPromptSubmit` hook that, on every user turn:\n\n1. Searches AgentMem with the user's prompt as the query.\n2. Returns the top hits as `additionalContext`, which the SDK splices into the model's prompt.\n\nThe agent never has to decide to call a tool — memories just *appear* in context. If search fails for any reason (network, auth), the hook logs to stderr and returns `{}`, so the turn proceeds normally.\n\nConfig:\n\n| Option | Default | Purpose |\n|---|---|---|\n| `apiKey` | — | Required. |\n| `agentId` | — | Required. |\n| `baseUrl` | hosted | Self-host override. |\n| `workflowId` | — | Limit to a workflow. |\n| `scope` | all | Limit to private/team/global. |\n| `topK` | 5 | Number of hits per turn. |\n| `rerank` | false | Re-score with Gemini (+0.5-1.5s). |\n| `minScore` | 0 | Minimum score to inject. With `rerank: true`, compared against `relevance_score` (0–1). Hits where `relevance_score` is `null` (rerank failed, e.g. Gemini rate-limit) are always dropped, never compared against the raw `score`. |\n| `prefix` | default preamble | Custom text before the memory list. |\n\n## Choosing between tools and the hook\n\n- **Tools only**: agent decides when to recall/write. Lower latency on simple turns; agent might miss memories it doesn't think to look for.\n- **Hook only**: every turn gets fresh context, no agent code needed. Adds one API call per turn.\n- **Both**: hook gives passive context, tools let the agent dig deeper or write durable facts. Recommended for most apps.\n\n## Comparison to `@agentmem/mcp`\n\n`@agentmem/mcp` is a standalone stdio MCP server intended for **client apps** (Claude Desktop, Cursor) that spawn MCP processes. `@agentmem/claude-agent` is intended for **your own Node code** that calls `query()` directly — no separate process, plus the recall hook.\n\n## License\n\n[Apache-2.0](../LICENSE)\n","readmeFilename":"README.md"}