Queue
Queue
Queue management assistant using AI agents. Generate structured queues with messages, todos, and attachments through conversation.
Loading preview…
Problems solved
- Generate structured queues with messages, todos, and attachments
- Drive queue creation through Experimental_Agent tool calls
- Manage conversational workflow state in a chat UI
Use cases
- Support ticket intake queues
- Content review queues with attachments
- Ops todo lists built through chat
- Agent demos for structured queue outputs
Setup
Requirements, wiring steps, and what this pattern adds to your project.
Getting started
Pick how you want to pull this pattern in — then wire env vars and routes the same way.
- 1
Install from the preview toolbar

Copy the install command above and run it in your project — Pro patterns include a short-lived token.
- 2
Add environment variables to .env.local
GOOGLE_API_KEY
- 3
Point client fetches at your API routes
Replace preview `/view/.../api/...` paths with `/api/...` in the installed files.
- 4
Customize the agent and tool files
Adapt prompts, tools, and stop conditions for your product — Copy for AI in the toolbar helps seed that work.
- 5
Run your dev server and open the pattern route
Install dependencies if needed, then start the app and verify responses.
Environment variables
GOOGLE_API_KEYGet key
Capabilities
AI SDK APIs
generateObjecttoolAgentvalidateUIMessagesProviders
Files added
10 filesapp/page.tsxapp/layout.tsxapp/api/agent/route.tscomponents/queue-demo.tsxlib/queue-agent.tslib/queue-tool.tslib/types.tslib/schema.tslib/request-utils.tsREADME.md
Dependencies
8 totalnpm packages
5
Registry components
Critical files
agent/route.tsAPI route using createAgentUIStreamResponse with the Experimental_Agent pattern. Shows the new Agent API pattern from AI SDK.
lib/queue-agent.tsDefines the queue management Agent using the Experimental_Agent API from AI SDK. Uses google/gemini-3-flash with createQueue tool and stepCountIs(5) stop condition.
lib/queue-tool.tsImplements the createQueue tool that uses generateObject with a structured Zod schema to generate queue data (sections with messages, todos, attachments).
Requirements
- Complexity
- Beginner
- Setup time
- ~10 minutes
- Node
- 24+
- Memory
- 512MB









