| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 4 个月前 | ||
| 4 个月前 | ||
| 7 个月前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 4 天前 | ||
| 9 个月前 | ||
| 8 个月前 | ||
| 7 个月前 |
AI Agent
Example project demonstrating queue-driven Rivet Actor AI agents with streaming Vercel AI SDK responses.
Getting Started
git clone https://github.com/rivet-dev/rivet.git
cd rivet/examples/ai-agent
npm install
npm run dev
Features
- Actor-per-agent pattern with a coordinating manager Rivet Actor
- Queue-based intake using
for awaitoverc.queue.iter(...)inside the run loop - Streaming AI responses sent to the UI as they arrive
- Persistent history stored in Rivet Actor state
- Live status updates via events and polling
Prerequisites
- OpenAI API key set as
OPENAI_API_KEY
Implementation
The AgentManager creates and tracks agent actors, while each AI agent Rivet Actor consumes queue messages in run and streams responses with the Vercel AI SDK.
- Actor definitions and queues (
src/actors.ts) - Frontend orchestration (
frontend/App.tsx) - Server entry point (
src/server.ts)
Resources
Read more about queues, run handlers, state, and events.
License
MIT