{"_id":"@azen-sh/vercel-ai","_rev":"2-c1754d0e40af1ecf45c8cd4dcfa99e43","name":"@azen-sh/vercel-ai","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@azen-sh/vercel-ai","version":"0.1.0","keywords":["azen","vercel-ai","ai-sdk","memory","llm","agent"],"license":"MIT","_id":"@azen-sh/vercel-ai@0.1.0","maintainers":[{"name":"govind-vashishat","email":"govindvashishat@gmail.com"}],"homepage":"https://github.com/azen-sh/azen-sh#readme","bugs":{"url":"https://github.com/azen-sh/azen-sh/issues"},"dist":{"shasum":"a53561112f9c156bf27e746b27108cde91e5159e","tarball":"https://registry.npmjs.org/@azen-sh/vercel-ai/-/vercel-ai-0.1.0.tgz","fileCount":3,"integrity":"sha512-V1oOsRCwNchgkE9fk/D4tgVkMvNzHVHFvMEx4feM6+lkXisqM0LXaqrEMpGOgg3KmWSS9G5yqNTyVXXiBoUE/g==","signatures":[{"sig":"MEUCIGiqb9BUyGd9047swzInLfvl/2h03HXc7yGElQ1yRbKAAiEAsrUms75quXpifJCHAp6L9m9IP00Y1TWfhoYj1SCNoUw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":682265},"type":"module","module":"./dist/index.js","exports":{".":{"import":"./dist/index.js"}},"gitHead":"5533a77d6621ad2f697cc96abb712c2a5da1bd05","scripts":{"build":"bun build src/index.ts --outdir dist --target node","typecheck":"tsc --noEmit"},"_npmUser":{"name":"govind-vashishat","email":"govindvashishat@gmail.com"},"repository":{"url":"git+https://github.com/azen-sh/azen-sh.git","type":"git","directory":"packages/integrations/vercel-ai"},"_npmVersion":"11.7.0","description":"Vercel AI SDK integration for Azen — memory tools for LLMs","directories":{},"_nodeVersion":"23.7.0","dependencies":{"zod":"^4.3.6"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^4.0.0","typescript":"^5.9.3"},"peerDependencies":{"ai":">=4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vercel-ai_0.1.0_1775823370966_0.26717594161465086","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@azen-sh/vercel-ai","version":"0.1.1","description":"Vercel AI SDK integration for Azen — memory tools for LLMs","type":"module","module":"./dist/index.js","exports":{".":{"import":"./dist/index.js"}},"scripts":{"build":"bun build src/index.ts --outdir dist --target node","typecheck":"tsc --noEmit"},"keywords":["azen","vercel-ai","ai-sdk","memory","llm","agent"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/azen-sh/azen-sh.git","directory":"packages/integrations/vercel-ai"},"dependencies":{"zod":"^4.3.6"},"peerDependencies":{"ai":">=4.0.0"},"devDependencies":{"ai":"^4.0.0","typescript":"^5.9.3"},"gitHead":"222f11af5f29ee78aae2586a32c7d9a7940e0a9e","_id":"@azen-sh/vercel-ai@0.1.1","bugs":{"url":"https://github.com/azen-sh/azen-sh/issues"},"homepage":"https://github.com/azen-sh/azen-sh#readme","_nodeVersion":"23.7.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-C2IxF4GU7qIvlnpvnWQvIqtx5xpESU2aMpbV2iVYASCPA3a+KYreom+Krz9GJP5G2uyAeW0PqD1WHJqCF/M5hg==","shasum":"ce016df3d1a52836d9ce1c55c3dc4649905ba1fd","tarball":"https://registry.npmjs.org/@azen-sh/vercel-ai/-/vercel-ai-0.1.1.tgz","fileCount":3,"unpackedSize":682053,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCiQ5JiKuvdoclI8O0VsMIKjNsadAaIuv1LCxQzfoUtUAIhAKRy+SJzkRSuAMpz/L0H2QBpL3XIIzWRRMbx78K2AG4L"}]},"_npmUser":{"name":"govind-vashishat","email":"govindvashishat@gmail.com"},"directories":{},"maintainers":[{"name":"govind-vashishat","email":"govindvashishat@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vercel-ai_0.1.1_1775826703309_0.5290184801989324"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-10T12:16:10.848Z","modified":"2026-04-10T13:11:43.608Z","0.1.0":"2026-04-10T12:16:11.104Z","0.1.1":"2026-04-10T13:11:43.479Z"},"bugs":{"url":"https://github.com/azen-sh/azen-sh/issues"},"license":"MIT","homepage":"https://github.com/azen-sh/azen-sh#readme","keywords":["azen","vercel-ai","ai-sdk","memory","llm","agent"],"repository":{"type":"git","url":"git+https://github.com/azen-sh/azen-sh.git","directory":"packages/integrations/vercel-ai"},"description":"Vercel AI SDK integration for Azen — memory tools for LLMs","maintainers":[{"name":"govind-vashishat","email":"govindvashishat@gmail.com"}],"readme":"# @azen-sh/vercel-ai\n\nVercel AI SDK integration for [Azen](https://github.com/azen-sh/azen-sh) — gives your LLM tools to store and search memories.\n\n## Install\n\n```bash\nnpm install @azen-sh/vercel-ai\n```\n\nPeer dependency: `ai` >= 4.0.0\n\n## Usage\n\nPass `azenTools()` to any `generateText` or `streamText` call. The LLM decides when to store and recall memories on its own.\n\n```ts\nimport { generateText } from \"ai\"\nimport { openai } from \"@ai-sdk/openai\"\nimport { azenTools } from \"@azen-sh/vercel-ai\"\n\nconst result = await generateText({\n  model: openai(\"gpt-4o\"),\n  system: \"You are a helpful assistant. Use your memory tools to remember and recall user preferences.\",\n  prompt: \"I'm allergic to peanuts.\",\n  tools: azenTools({\n    userId: \"user_123\",\n    apiUrl: \"http://localhost:3000\",  // your Azen instance\n  }),\n  maxSteps: 3,\n})\n\nconsole.log(result.text)\n// \"Got it, I'll remember that you're allergic to peanuts.\"\n```\n\n## Configuration\n\n```ts\nazenTools({\n  userId: \"user_123\",           // required — scopes memories to this user\n  appId: \"my-app\",              // optional — defaults to \"default\"\n  apiUrl: \"http://localhost:3000\", // optional — defaults to \"http://localhost:3000\"\n})\n```\n\n## Tools provided\n\n| Tool | What the LLM uses it for |\n|---|---|\n| `addMemory` | Store a new memory (preference, fact, context) for later recall |\n| `searchMemories` | Search stored memories by meaning to recall relevant information |\n| `listMemories` | Browse stored memories with pagination |\n| `getMemory` | Get a specific memory by its ID |\n| `updateMemory` | Update content or metadata of an existing memory |\n| `deleteMemory` | Delete a specific memory (e.g. \"forget that\") |\n| `deleteAllMemories` | Clear all memories for the user (only when explicitly asked) |\n\n## How it works\n\n1. You pass `azenTools()` as `tools` in your `generateText` / `streamText` call\n2. The LLM reads the tool descriptions and decides when to call them\n3. When the LLM calls `addMemory`, the integration sends `POST /memories` to your Azen API\n4. When the LLM calls `searchMemories`, it sends `POST /search` and gets back relevant memories with relevance scores\n5. The LLM uses the results to inform its response\n\nThe integration talks to the Azen REST API over HTTP — it doesn't import the core engine, so it works with any running Azen instance.\n\n## Requirements\n\n- An Azen API instance running and accessible (see [main README](../../../README.md) for setup)\n- `ai` >= 4.0.0 installed in your project\n","readmeFilename":"README.md"}