Lightweight TypeScript framework for AI agents using familiar Express-style middleware.
Agent-express is a minimalist middleware framework designed specifically for building AI agents in TypeScript. It applies the well-known Express.js (ctx, next) pattern to agent workflows, reducing the learning curve for backend developers who already understand middleware stacks.
The system organizes behavior through five onion-style hooks that let middleware run before and after key stages such as session start, model calls, and tool execution. Built-in options cover cost limits, validation, logging, token tracking, and context compaction without requiring separate libraries.
It targets TypeScript developers who want a simple, composable way to create reliable agents rather than learning dozens of new abstractions. The framework works with any provider supported by the AI SDK and ships with CLI tools for local development and testing.
Combine budget guards, PII redaction, and RAG search middleware to create a safe customer support bot that escalates when needed.
Use the router middleware to automatically select cheaper or more capable models based on query complexity while tracking token usage.
Write a small middleware object that records turn counts and model costs across sessions for internal reporting dashboards.
npm install agent-expressnpm install agent-expressYes, any provider supported by the AI SDK can be used by passing a provider/model string when creating the agent.
Verified reviews from the community shape this listing's rating.
Loading reviews…