AI Agent Chat

AI Agent Chat

Example project demonstrating AI agent integration.

Features

  • AI SDK integration: Use Vercel AI SDK with OpenAI within Rivet Actors
  • Persistent conversation state: Message history automatically persisted across actor restarts
  • Real-time updates: Broadcast AI responses to connected clients using actor events
  • Tool calling: Integrate custom tools (weather lookup) that AI can invoke

Implementation

The AI agent is implemented as a Rivet Actor that maintains conversation state and integrates with OpenAI. Key implementation details:

Prerequisites

  • OpenAI API Key (set as OPENAI_API_KEY environment variable)

Resources

Read more about actions, state, and events.