Demonstrates agent summarization with a short trigger window so you can see summaries created during a single run.
- Node.js (v20 or newer)
- OpenAI API key (with access to
openai/gpt-5.1)
-
Install dependencies:
pnpm install
-
Create your environment file:
cp .env.example .env
-
Add your API key to
.env:OPENAI_API_KEY=your-api-key
-
Run the example:
pnpm dev
If you do not have access to openai/gpt-5.1, change the model in src/index.ts to openai/gpt-4o-mini (or another available model) and remove the OpenAI reasoning options.
- Creates a single
Agentwithsummarizationenabled. - Enables OpenAI native reasoning by using
openai/gpt-5.1withproviderOptions.openai.reasoningEffort. - Uses a low
triggerTokensvalue so summaries are created quickly. - Starts a VoltAgent server so you can chat with the agent over HTTP.
.
├── src/
│ └── index.ts # Creates and serves the agent with summarization enabled
├── package.json
├── tsconfig.json
└── README.md