Build a PlanAgent with planning, file system tools, and subagent support. This example mirrors the original PlanAgents quickstart but uses VoltAgent's PlanAgent class.
- Node.js (v20 or newer)
- OpenAI API key
- Tavily API key
-
Install dependencies:
pnpm install
-
Create your environment file:
cp .env.example .env
-
Add your API keys to
.env:OPENAI_API_KEY=your-api-key TAVILY_API_KEY=your-tavily-api-key
-
Run the example:
pnpm dev
To see PlanAgent summaries in the observability UI, you can seed a realistic conversation on startup:
PLANAGENT_DEMO=true pnpm devThis will generate a multi-step research conversation that triggers summarization and creates summary spans in the flow view.
- Creates a PlanAgent with
new PlanAgent(...), which enables planning (write_todos), file system tools, and task-based subagents by default. - Adds a Tavily-backed
internet_searchtool for research. - Starts a VoltAgent server so you can chat with the agent over HTTP.
.
├── src/
│ ├── index.ts # Creates and serves the PlanAgent
│ └── tools.ts # Tavily-powered internet search tool
├── package.json
├── tsconfig.json
└── README.md