|
| 1 | +# AN SDK |
| 2 | + |
| 3 | +The open-source SDK for building, deploying, and embedding AI coding agents. |
| 4 | + |
| 5 | +**AN** is the "Vercel for agents" — a framework + hosting platform for AI agents. Define agents in code, deploy with one command, embed anywhere. |
| 6 | + |
| 7 | +## Packages |
| 8 | + |
| 9 | +| Package | Description | npm | |
| 10 | +|---|---|---| |
| 11 | +| [`@an-sdk/agent`](./packages/agent) | Define agents with full type safety | [](https://www.npmjs.com/package/@an-sdk/agent) | |
| 12 | +| [`@an-sdk/react`](./packages/react) | Drop-in React chat UI for agents | [](https://www.npmjs.com/package/@an-sdk/react) | |
| 13 | +| [`@an-sdk/node`](./packages/node) | Node.js client for the AN API | [](https://www.npmjs.com/package/@an-sdk/node) | |
| 14 | +| [`@an-sdk/nextjs`](./packages/nextjs) | Next.js integration (server + client) | [](https://www.npmjs.com/package/@an-sdk/nextjs) | |
| 15 | +| [`@an-sdk/cli`](./packages/cli) | CLI for deploying agents | [](https://www.npmjs.com/package/@an-sdk/cli) | |
| 16 | + |
| 17 | +## Quickstart |
| 18 | + |
| 19 | +### 1. Define an agent |
| 20 | + |
| 21 | +```ts |
| 22 | +// agents/my-agent.ts |
| 23 | +import { agent, tool } from "@an-sdk/agent" |
| 24 | +import { z } from "zod" |
| 25 | + |
| 26 | +export default agent({ |
| 27 | + model: "claude-sonnet-4-6", |
| 28 | + systemPrompt: "You are a helpful coding assistant.", |
| 29 | + tools: { |
| 30 | + greet: tool({ |
| 31 | + description: "Greet the user", |
| 32 | + inputSchema: z.object({ name: z.string() }), |
| 33 | + execute: async ({ name }) => ({ |
| 34 | + content: [{ type: "text", text: `Hello, ${name}!` }], |
| 35 | + }), |
| 36 | + }), |
| 37 | + }, |
| 38 | +}) |
| 39 | +``` |
| 40 | + |
| 41 | +### 2. Deploy |
| 42 | + |
| 43 | +```bash |
| 44 | +npx @an-sdk/cli login |
| 45 | +npx @an-sdk/cli deploy |
| 46 | +``` |
| 47 | + |
| 48 | +### 3. Embed in your app |
| 49 | + |
| 50 | +```tsx |
| 51 | +import { AnAgentChat } from "@an-sdk/react" |
| 52 | + |
| 53 | +export default function Page() { |
| 54 | + return <AnAgentChat agent="your-agent-slug" /> |
| 55 | +} |
| 56 | +``` |
| 57 | + |
| 58 | +## Architecture |
| 59 | + |
| 60 | +``` |
| 61 | +Developer → CLI → AN Platform → E2B Sandbox (agent runs here) |
| 62 | + ↕ |
| 63 | +Client → @an-sdk/react → AN Relay → SSE Streaming |
| 64 | +``` |
| 65 | + |
| 66 | +- **SDK packages** (this repo): Open-source. Define agents, build UIs, deploy. |
| 67 | +- **AN Platform**: Managed infrastructure. Runs agents in sandboxes, handles billing, auth, scaling. |
| 68 | + |
| 69 | +Same model as Next.js (open-source) + Vercel (managed platform). |
| 70 | + |
| 71 | +## Documentation |
| 72 | + |
| 73 | +See the [`docs/`](./packages/docs) directory or visit [an.dev/docs](https://an.dev/docs). |
| 74 | + |
| 75 | +## Examples |
| 76 | + |
| 77 | +- [`examples/basic-agent`](./examples/basic-agent) — Minimal agent with a custom tool |
| 78 | + |
| 79 | +## Contributing |
| 80 | + |
| 81 | +See [CONTRIBUTING.md](./CONTRIBUTING.md). |
| 82 | + |
| 83 | +## License |
| 84 | + |
| 85 | +MIT — see [LICENSE](./LICENSE). |
0 commit comments