ReactAgent is a production-ready ReAct (Reasoning + Acting) agent that combines language models with tools and middleware.
The agent is parameterized by a single type bag Types that encapsulates all
type information:
interface ReactAgent// Using the type bag pattern
type MyTypes = AgentTypeConfig<
{ name: string }, // Response
typeof myState, // State
typeof myContext, // Context
typeof middleware, // Middleware
typeof tools // Tools
>;
const agent: ReactAgent<MyTypes> = createAgent({ ... });The options to use for the tool output.
Draw the graph as a Mermaid string.
Visualize the graph as a PNG image.
Invokes the tool with the provided input and configuration.
Stream output in chunks.
Bind config to a Runnable, returning a new Runnable.