useAgent

AI that takes action.
You stay in control.

Orchestrate AI-powered execution with streaming responses, tool visibility, and multi-mode support.

Try Demo

One prompt.
Complete automation.

Send a prompt, watch the AI execute commands, and get streaming results with full visibility into tool calls.

Agent.tsx
Loading code...
AI Agent

Deploy to staging environment

I'll deploy to staging now.

git pull origin main
npm run build
kubectl apply -f deploy/

Deployed successfully!

Multiple modes.
One hook.

Choose the right execution mode for your task.

chat

Conversational AI with tool access

terminal

Direct shell command execution

router

Multi-agent task routing

planner

Task planning and execution

Full visibility.

Know exactly what your AI is doing.

Streaming Responses

See AI thinking in real-time as tokens stream in.

Tool Visibility

Watch every tool call with status, arguments, and results.

Cancel & Control

Stop execution anytime and reset the agent state.

API Reference

Options

sessionIdrequired
string

Agent session ID

onToken
(text: string) => void

Token stream callback

onToolCall
(call: ToolCall) => void

Tool execution callback

onDone
(result: AgentResult) => void

Completion callback

Returns

run(prompt, options?) => Promise

Execute a prompt

isRunningboolean

Execution status

streamingTextstring

Current streaming text

toolCallsToolCall[]

Active tool calls

cancel() => void

Cancel execution

reset() => void

Reset state