Skip to content

Chat Interface

The chat interface orchestrates the full conversation flow - assembling context, streaming responses, executing tools, and persisting messages.

Request Flow

When you send a message:

  1. Memory Recall - Retrieve important and relevant memories
  2. Context Assembly - Gather summaries, calendar, tasks
  3. System Prompt - Build personalized prompt with context
  4. Stream Response - Real-time response with tool execution
  5. Persist - Save response and trigger background jobs

Agentic Behavior

Iris can use tools and iterate multiple times before responding (up to 30 steps). This enables complex tasks like:

  • Searching memories, finding nothing, then asking a clarifying question
  • Creating a calendar event, then storing a memory about it
  • Generating an image, then describing what was created

Features

Image Support - Upload images for multi-modal conversations

Retry - If a response fails, retry the last message

Streaming - Real-time text, tool calls, and artifacts delivered to the frontend

Frontend Integration

Uses Vercel AI SDK compatible streaming:

typescript
const { messages, input, handleSubmit } = useChat({
  api: '/api/chat',
  streamProtocol: 'data',
});