Better Agent
The better way to build AI agents in TypeScript.
Last verified:
What is Better Agent?
Better Agent is a TypeScript framework for building typed, event-driven, framework-agnostic AI agent applications. It provides a composable runtime that handles tools, memory, storage, auth context, interrupts, resumable runs, plugins, and a typed client across different web frameworks. The framework is designed to fit into existing tech stacks instead of forcing developers to build around a fixed application framework.
Key features include composable agents that let you build larger systems from smaller agents and tools, multi-provider support to swap models with one line of code, plugins for adding app-level guards/hooks/middleware/endpoints, AG-UI event streaming for messages/tools/approvals/interrupts, durable runs that resume interrupted runs and replay streams, human-in-the-loop approvals before sensitive tools run, first-class auth for request identity across access rules and memory, and tools everywhere supporting server tools, client tools, MCP connections, and hosted provider tools.
Better Agent is for TypeScript developers building production-ready AI agents who need end-to-end typing, durable conversations, and human approval workflows. It works with Node.js, Bun, Deno, and Cloudflare, and integrates with frameworks like Next.js, Astro, Nuxt, Remix, Solid, and Svelte. The framework is open source under the MIT license and is currently in beta.
Better Agent pricing
Pricing model: Freemium
Better Agent is完全 free and open source under the MIT license. There are no paid plans or tiers - the entire framework is available at no cost. Developers can use it freely for personal and commercial projects. The only costs involved would be the LLM API keys from your chosen provider (OpenAI, anthropic, etc.) and your own hosting infrastructure.
Better Agent pros
- End-to-end TypeScript typing from definitions to client calls
- Composable runtime for tools, memory, storage, and auth
- Framework-agnostic - works with Next.js, Astro, Nuxt, Remix, Solid, Svelte
- Swap AI models with one line of code across providers
- AG-UI standard event streaming for messages and tools
- Durable runs resume interrupted conversations automatically
- Built-in human-in-the-loop approvals for sensitive tools
- First-class auth integrated across memory, plugins, and tools
- Plugin system for guards, hooks, middleware, and endpoints
- Supports server tools, client tools, MCP, and hosted provider tools
- Works on Node.js, Bun, Deno, and Cloudflare runtimes
- Open source MIT license with active GitHub community
- Easy to package and share reusable behavior as plugins
- Fits into existing app, database, and auth infrastructure
- Typed client across all supported frameworks
Better Agent cons
- Currently in beta - APIs may change during development
- TypeScript-only - no Python or other language support
- Requires TypeScript knowledge and setup
- Relatively new project with smaller community than LangChain
- Limited documentation compared to established frameworks
- Requires AG-UI knowledge for full event streaming features
- MCP integration requires additional setup
- No built-in hosted platform - self-hosted only
Frequently asked questions about Better Agent
What is Better Agent?
Better Agent is a TypeScript framework for building typed, event-driven, framework-agnostic AI agent applications. It provides a composable runtime for tools, memory, storage, auth context, interrupts, resumable runs, plugins, and a typed client across frameworks.
Is Better Agent free to use?
Yes, Better Agent is completely free and open source under the MIT license. There are no paid plans or subscription fees. You only pay for your own LLM API usage and hosting infrastructure.
What programming languages does Better Agent support?
Better Agent is TypeScript-only. It is designed specifically for TypeScript developers and requires TypeScript knowledge to use effectively.
What frameworks does Better Agent work with?
Better Agent is framework-agnostic and works with Next.js, Astro, Nuxt, Preact, Remix, Solid, and Svelte. It also supports Node.js, Bun, Deno, and Cloudflare runtimes.
How does human-in-the-loop work in Better Agent?
Better Agent built-in human-in-the-loop allows you to pause before sensitive tools run. The framework emits an event that pauses execution, then waits for the client to approve, reject, or resume the action before proceeding.
What is AG-UI event streaming?
AG-UI is a standard for event streaming in AI agents. Better Agent streams standard AG-UI events for messages, tools, approvals, interrupts, and final results, enabling consistent client-server communication.
Can I swap models in Better Agent?
Yes, Better Agent supports multi-provider models. You can swap models with one line of code using the same API across all supported providers, making it easy to experiment with different LLMs.
How do durable runs work?
Durable runs allow you to resume interrupted runs, replay streams, and continue threads across requests. If a client disconnects from an SSE stream, the framework can continue the run on the server and resume when the client reconnects.
Is Better Agent production-ready?
Better Agent is currently in beta, which means APIs may change as development continues. It is suitable for production use but expect potential breaking changes. The team encourages opening issues for bugs and feedback.