{"_id":"@alex-ai/agent","_rev":"5-eb5723176204f452a1c2fcd5a189e452","name":"@alex-ai/agent","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.1":{"name":"@alex-ai/agent","version":"0.0.1","_id":"@alex-ai/agent@0.0.1","maintainers":[{"name":"debugged","email":"alexbankras@gmail.com"}],"dist":{"shasum":"19d11f4b1aceaab9e57f677092d9a9ea7441099d","tarball":"https://registry.npmjs.org/@alex-ai/agent/-/agent-0.0.1.tgz","fileCount":14,"integrity":"sha512-hy1BFyq/5uljaUyUTynl+NIRnZS38vc1k2Pli1AqWHqpfvb2omX4zWF6P1Of/ttJQE/rs4qxhZv8+bLYGBQC9Q==","signatures":[{"sig":"MEUCIQCQDzZ2ChJY1d0A16iaVbYWlLLwfIwebfuONcpA9NBFuQIgT4qT1Xm8NrBh8ZYhnj5vFzp0DmxoSKe0OdkmJcoAflU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34055},"type":"module","exports":{".":{"import":"./dist/index.js","development":"./src/index.ts"}},"gitHead":"576544db6dfab51d4d7102465eb912c814c1ad2c","scripts":{"lint":"eslint 'src/**/*.ts'","build":"tsc","release":"pnpm build && npm publish --access public"},"_npmUser":{"name":"debugged","email":"alexbankras@gmail.com"},"_npmVersion":"10.9.2","description":"Part of the [alex-ai ecosystem](https://github.com/Alex-AI-Systems), `@alex-ai/agent` provides a powerful, composable agent framework for building AI-powered assistants that can reason, use tools, and interact with users or other agents. It is designed to","directories":{},"_nodeVersion":"22.17.1","dependencies":{"ai":"^4.3.19","zod":"^3.25.76","@ai-sdk/google":"^1.2.22","@ai-sdk/openai":"^1.3.23","@ai-sdk/deepseek":"^0.2.16","@ai-sdk/anthropic":"^1.2.12","ollama-ai-provider":"^1.2.0","zod-to-json-schema":"^3.24.6"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^24.0.15","@alex-ai/tsconfig":"workspace:*","@alex-ai/eslint-config":"workspace:*"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.0.1_1753799961665_0.36091292754336246","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@alex-ai/agent","version":"0.0.2","_id":"@alex-ai/agent@0.0.2","maintainers":[{"name":"debugged","email":"alexbankras@gmail.com"}],"dist":{"shasum":"92609cb2c6f60efbbce8c879f79cd59ecf2595f5","tarball":"https://registry.npmjs.org/@alex-ai/agent/-/agent-0.0.2.tgz","fileCount":14,"integrity":"sha512-2Z6NiBItEqGM3H/dO93xXnLqcD+YXngdFWI4DqYuxO3JV0dGrx2oZXXgSd32XVqhFEgJOH8UIomzmhSgIxYIZQ==","signatures":[{"sig":"MEQCIG25V+26LHgubmHFM6zO2DO7h7toZ5DGWXKBjQrX26iQAiAj/mCi/xEmXmSBVb9D75g359dnPsr8/4ZLKHaBLoLDCA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35019},"type":"module","exports":{".":{"import":"./dist/index.js","development":"./src/index.ts"}},"gitHead":"3b0b9bae104dc7d042d57b0fb98c027e3d43cdf2","scripts":{"lint":"eslint 'src/**/*.ts'","build":"tsc","release":"pnpm build && npm publish --access public"},"_npmUser":{"name":"debugged","email":"alexbankras@gmail.com"},"_npmVersion":"10.9.2","description":"Part of the [alex-ai ecosystem](https://github.com/Alex-AI-Systems), `@alex-ai/agent` provides a powerful, composable agent framework for building AI-powered assistants that can reason, use tools, and interact with users or other agents. It is designed to","directories":{},"_nodeVersion":"22.17.1","dependencies":{"ai":"^4.3.19","zod":"^3.25.76","zod-to-json-schema":"^3.24.6"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^24.0.15","@alex-ai/tsconfig":"workspace:*","@alex-ai/eslint-config":"workspace:*"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.0.2_1753867205560_0.033866532297388785","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@alex-ai/agent","version":"0.0.3","_id":"@alex-ai/agent@0.0.3","maintainers":[{"name":"debugged","email":"alexbankras@gmail.com"}],"dist":{"shasum":"b91c4020871fbd0ea4f8e87282beda44618215c7","tarball":"https://registry.npmjs.org/@alex-ai/agent/-/agent-0.0.3.tgz","fileCount":14,"integrity":"sha512-2lHoWFNl22h9/hTzj1cn+RwLN+KlpFRncU8IPrYWBs0OirWHLeah1xUPk8b/zHhIpsnB/g11fN7wjhPXeQJffA==","signatures":[{"sig":"MEUCIQDuzD6cfKysvyA7EgRpz9gw/kXxXixaircWsOHswovNiwIgWkHuzMPf9+CDG5DdQte3H77z2SO8IYC7kipBdhpmKrA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35008},"type":"module","_from":"file:alex-ai-agent-0.0.3.tgz","exports":{".":{"import":"./dist/index.js","development":"./src/index.ts"}},"scripts":{"lint":"eslint 'src/**/*.ts'","build":"tsc","release":"pnpm build && pnpm publish --access public"},"_npmUser":{"name":"debugged","email":"alexbankras@gmail.com"},"_resolved":"/private/var/folders/q0/t6mj18fj6dn22mh8v_v4mp100000gn/T/8867ef11697ce4d87657d2f22a4a5f4d/alex-ai-agent-0.0.3.tgz","_integrity":"sha512-2lHoWFNl22h9/hTzj1cn+RwLN+KlpFRncU8IPrYWBs0OirWHLeah1xUPk8b/zHhIpsnB/g11fN7wjhPXeQJffA==","_npmVersion":"10.9.2","description":"Part of the [alex-ai ecosystem](https://github.com/Alex-AI-Systems), `@alex-ai/agent` provides a powerful, composable agent framework for building AI-powered assistants that can reason, use tools, and interact with users or other agents. It is designed to","directories":{},"_nodeVersion":"22.17.1","dependencies":{"ai":"^4.3.19","zod":"^3.25.76","zod-to-json-schema":"^3.24.6"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^24.0.15","@alex-ai/tsconfig":"0.0.0","@alex-ai/eslint-config":"0.0.0"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.0.3_1753868318211_0.3859790580901794","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@alex-ai/agent","version":"0.0.4","_id":"@alex-ai/agent@0.0.4","maintainers":[{"name":"debugged","email":"alexbankras@gmail.com"}],"dist":{"shasum":"205960123a99f78774ba47379a9225c69c190f8e","tarball":"https://registry.npmjs.org/@alex-ai/agent/-/agent-0.0.4.tgz","fileCount":14,"integrity":"sha512-7f6cVPxb8kdNgBYL/pftP2FBEZuKx4mCfq2OACybtlOmZ3p9KPaPHN/jL8ts9WHbyS8EClxjval3dbvgbbdAFw==","signatures":[{"sig":"MEYCIQC4kmw+h6T2dAKGLigkwBZjAaFwkhPQdkC8+78Wl6CKvwIhAP1CqWW1vLhtv987FkbvAXw+lUkL54T0dokScgc/igpo","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35033},"type":"module","_from":"file:alex-ai-agent-0.0.4.tgz","exports":{".":{"import":"./dist/index.js","development":"./src/index.ts"}},"scripts":{"lint":"eslint 'src/**/*.ts'","build":"tsc","release":"pnpm build && pnpm publish --access public"},"_npmUser":{"name":"debugged","email":"alexbankras@gmail.com"},"_resolved":"/private/var/folders/q0/t6mj18fj6dn22mh8v_v4mp100000gn/T/7ce77e7ca7661c8a5da39e81c42484ba/alex-ai-agent-0.0.4.tgz","_integrity":"sha512-7f6cVPxb8kdNgBYL/pftP2FBEZuKx4mCfq2OACybtlOmZ3p9KPaPHN/jL8ts9WHbyS8EClxjval3dbvgbbdAFw==","_npmVersion":"10.9.2","description":"Part of the [alex-ai ecosystem](https://github.com/Alex-AI-Systems), `@alex-ai/agent` provides a powerful, composable agent framework for building AI-powered assistants that can reason, use tools, and interact with users or other agents. It is designed to","directories":{},"_nodeVersion":"22.17.1","dependencies":{"ai":"^4.3.19","zod":"^3.25.76","zod-to-json-schema":"^3.24.6"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^24.0.15","@alex-ai/tsconfig":"0.0.0","@alex-ai/eslint-config":"0.0.0"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.0.4_1753885491921_0.6690677057991241","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@alex-ai/agent","version":"0.0.5","type":"module","exports":{".":{"development":"./src/index.ts","import":"./dist/index.js"}},"dependencies":{"ai":"^4.3.19","zod":"^3.25.76","zod-to-json-schema":"^3.24.6"},"devDependencies":{"@types/node":"^24.0.15","@alex-ai/eslint-config":"0.0.0","@alex-ai/tsconfig":"0.0.0"},"scripts":{"build":"tsc","lint":"eslint 'src/**/*.ts'","release":"pnpm build && pnpm publish --access public"},"_id":"@alex-ai/agent@0.0.5","description":"Part of the [alex-ai ecosystem](https://github.com/Alex-AI-Systems), `@alex-ai/agent` provides a powerful, composable agent framework for building AI-powered assistants that can reason, use tools, and interact with users or other agents. It is designed to","_integrity":"sha512-6jTbDBX/jGvgNUdiNrRDqx7HO0QskvVRnREL7zJj62Gm7oRSXy/oDZOnWlOzpXOXP01T0fpvv2yJLC61I3IXZw==","_resolved":"/private/var/folders/q0/t6mj18fj6dn22mh8v_v4mp100000gn/T/1a597cd9128487c858a45921d9c67e13/alex-ai-agent-0.0.5.tgz","_from":"file:alex-ai-agent-0.0.5.tgz","_nodeVersion":"22.17.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-6jTbDBX/jGvgNUdiNrRDqx7HO0QskvVRnREL7zJj62Gm7oRSXy/oDZOnWlOzpXOXP01T0fpvv2yJLC61I3IXZw==","shasum":"01e6c803838eec424e5fe3d0a2c941993169854f","tarball":"https://registry.npmjs.org/@alex-ai/agent/-/agent-0.0.5.tgz","fileCount":14,"unpackedSize":35074,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD2IntGu1z7seWlYlTG74nbkOJvGUX1PpgmhyV4oY8ANAIhAOQdF3VX5DkQgqSKXbialwbOC6MLvqXXZY4supeS1LVO"}]},"_npmUser":{"name":"debugged","email":"alexbankras@gmail.com"},"directories":{},"maintainers":[{"name":"debugged","email":"alexbankras@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agent_0.0.5_1753885770814_0.6830591999038451"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-29T14:39:21.601Z","modified":"2025-07-30T14:29:31.200Z","0.0.1":"2025-07-29T14:39:21.885Z","0.0.2":"2025-07-30T09:20:05.762Z","0.0.3":"2025-07-30T09:38:38.386Z","0.0.4":"2025-07-30T14:24:52.171Z","0.0.5":"2025-07-30T14:29:30.977Z"},"description":"Part of the [alex-ai ecosystem](https://github.com/Alex-AI-Systems), `@alex-ai/agent` provides a powerful, composable agent framework for building AI-powered assistants that can reason, use tools, and interact with users or other agents. It is designed to","maintainers":[{"name":"debugged","email":"alexbankras@gmail.com"}],"readme":"# @alex-ai/agent\n\nPart of the [alex-ai ecosystem](https://github.com/Alex-AI-Systems), `@alex-ai/agent` provides a powerful, composable agent framework for building AI-powered assistants that can reason, use tools, and interact with users or other agents. It is designed to be modular, extensible, and easy to integrate with various language models and toolchains.\n\n## Features\n\n- **Composable Agents**: Create agents that can use tools, call sub-agents, or delegate tasks to fallback agents.\n- **Tool Integration**: Define tools with input/output schemas using Zod. Tools can be synchronous or stream results as agent messages.\n- **Model Agnostic**: Works with multiple LLM providers (OpenAI, Anthropic, Google Gemini, DeepSeek, Ollama) via the `ai` SDK.\n- **Memory & Context**: Agents maintain memory and conversation history for contextual reasoning.\n- **Streaming Support**: Stream agent responses and tool results in real time.\n- **Error Handling & Recovery**: Built-in mechanisms for handling tool call failures and invalid arguments.\n\n## Installation\n\n```bash\nnpm install @alex-ai/agent\n```\n\n## Basic Usage\n\n```ts\nimport { Agent } from \"@alex-ai/agent\";\nimport { z } from \"zod\";\nimport { openai } from \"ai\";\n\nconst echoTool = {\n  name: \"echo\",\n  description: \"Echoes back the input\",\n  inputSchema: z.object({ text: z.string() }),\n  execute: async ({ text }) => ({ echoedText: text }),\n};\n\nconst agent = new Agent({\n  name: \"EchoAgent\",\n  description: \"An agent that echoes your input.\",\n  model: openai(\"gpt-3.5-turbo\"),\n  tools: [echoTool],\n});\n\nfor await (const chunk of agent.runStream({ prompt: \"Say hello!\" })) {\n  // Handle streaming output here\n}\n```\n\n## Concepts\n\n### Agents\n\nAn `Agent` encapsulates:\n- A language model (LLM)\n- A set of available tools (functions)\n- Optional sub-agents or fallback agents\n- Memory/state management\n\n### Tools\n\nTools are functions described by:\n- Name & description\n- Input/output schemas (Zod)\n- An `execute` function (sync/async/generator)\n\nYou can define standard tools or streaming tools (which yield message chunks).\n\n### Sub-agents & Fallbacks\n\nAgents can delegate tasks to other agents (\"sub-agents\") or fall back to another agent if they get stuck.\n\n### Streaming API\n\nThe `.runStream()` method yields structured chunks representing messages, tool calls/results, summaries, and token usage.\n\n### FunctionTool\n\nA tool definition object. See source/types for full type signature.\n\n## Example Tool Definition\n\n```ts\nimport { z } from \"zod\";\n\nconst addNumbers = {\n  name: \"addNumbers\",\n  description: \"Adds two numbers together.\",\n  inputSchema: z.object({\n    a: z.number(),\n    b: z.number(),\n  }),\n  execute: async ({ a, b }) => ({ result: a + b }),\n};\n```\n\n\nFor more details and advanced usage patterns, see the [alex-ai ecosystem](https://github.com/Alex-AI-Systems) documentation.\n","readmeFilename":"README.md"}