Introduction

Better Agent is a TypeScript framework for building typed, event-driven, framework-agnostic agent apps.

Why It Exists

  1. Agent apps should be typed end-to-end, from definitions to client calls.
  2. The framework should fit into your existing stack, including your application, database, and auth.
  3. Reusable behavior should be easy to package and share as plugins.
  4. Durable conversations and resumable runs should be easy to build with first-class persistence support.

Features

01Typed Agents
Define an agent once and keep its model, tools, context, and output schema typed together.
02Type-Safe Client
Infer agent names, inputs, outputs, and hooks directly from your server app.
03Multi-Provider
Use the same app shape across supported providers instead of rewriting your runtime for each one.
04Plugins
Add guards, lifecycle hooks, middleware, and custom endpoints without rebuilding the core loop.
05Framework Agnostic
Mount Better Agent in the server stack you already use instead of adopting a fixed app framework.
06Event Driven
Listen to structured events for messages, tool calls, approvals, and streaming state as runs progress.
07Durable Runs
Add minimal persistence stores when you need resumable conversations, replayable streams, or active run tracking.
08Human in the Loop
Pause sensitive tool calls for approval and continue the run after a user decision.
09Structured Output
Validate responses against a schema and get typed data back from the run result.

Where To Go Next

  • Installation to set up the packages and first app.
  • Usage to add a typed client and UI.
  • Concepts to understand how the core pieces fit together.