Appearance
Chat Interface
The chat interface orchestrates the full conversation flow — assembling context, streaming responses, executing tools, and persisting messages. Understanding this flow helps you see how all of Iris's components work together.
Every conversation happens within a thread. Threads provide isolation — conversation history, summaries, streaming, and pinned skills are all scoped to the active thread.
Request Flow
When you send a message, Iris processes it through several stages before streaming a response:
1. Context Recall
The ContextRetriever fetches relevant context using two complementary systems:
- Truths: Stable, core facts about you (pinned Truths always included, others ranked by relevance)
- Memories: Semantic search finds memories related to the current conversation
This happens first because context influences how Iris responds.
If recall fails (for example, when the embeddings provider is down or out of credits), Iris still answers. Its context says memory is unavailable for that turn, and an amber warning appears under your message. See When Recall Fails.
2. Context Assembly
Iris then gathers the rest of the context:
- Conversation history from this thread since its last summary, newest turns first until the token budget runs out
- Conversation summaries from this thread (up to 3 recent summaries,
context.recent_summaries) - Thread briefs from your other recent threads, with the newest messages written since each brief (for cross-thread awareness)
- Pinned skill content and attached prompts for this thread (if any)
- Calendar events (next 7 days,
calendar.event_horizon, if connected) - Weather (if configured)
- The current date and time
3. System Prompt Building
The SystemPromptBuilder assembles a personalized prompt by rendering each registered prompt class in order: Iris's identity and instructions, pinned skills and prompts, and summaries. Everything that changes from turn to turn (recalled memories, cross-thread context, calendar, weather, and the current time) goes in the context tail prepended to your newest message instead, so the system prompt and older history stay cacheable.
4. Process and Stream
The request is queued for asynchronous processing via Prism PHP. Response events stream to your browser via WebSockets in real-time, including text chunks and tool calls. If Iris decides to use a tool, execution happens server-side before continuing the response.
Stream events are scoped to the active thread — only clients viewing that thread receive the broadcast. This prevents messages from appearing in the wrong thread when you have multiple tabs open.
This architecture provides reliable delivery with automatic recovery from connection drops.
5. Persist and Process
After the response completes:
- The conversation is saved to the database within the active thread
- Token usage is recorded for monitoring
- Background jobs are dispatched (memory extraction, thread-scoped summarization, and the thread's brief once it goes quiet)
Agentic Behavior
Iris operates as an agent, meaning it can use tools and iterate multiple times before providing a final response. The agent.max_steps configuration (default: 60) limits how many iterations can occur.
This enables complex, multi-step tasks:
- Search and ask: Search memories, find nothing relevant, then ask a clarifying question
- Create and remember: Create a calendar event, then store a memory about why it was scheduled
- Generate and describe: Generate an image, then describe what was created
Each request to the model is a step, whether it answers in text or calls tools (several tool calls in one response still count as one step). Storing a memory and then replying takes 2 steps. A complex request might use 5-10 steps as Iris searches, creates, and confirms.
NOTE
Tool calls stream to the frontend in real-time, so users see what Iris is doing as it works.
Features
Text-to-Speech
Assistant messages include a speaker icon that reads the message aloud using ElevenLabs. A player bar appears under the chat header with play/pause, seeking, playback speed, and 15-second skips (on wider screens, or from your lock screen), and it keeps playing while you switch threads. Audio is saved after the first play, so replays are instant and free. This feature requires setup - see Text-to-Speech for configuration.
Image Support
Users can upload images for multi-modal conversations. Images are attached to messages and sent to Claude as part of the request. Common use cases include:
- Asking questions about screenshots
- Getting feedback on designs
- Extracting information from photos
Images stay visible on later turns, not only the turn they were sent in. While a message is still in the raw history (not yet folded into a summary), Iris sends its images again with each request, up to a cap of four images (images.replay.max_count) and 10 MB in total. The newest message always carries all of its images, and they count toward the cap; earlier messages fill whatever slots are left, newest first, skipping any single image over 3.75 MB. Every image that doesn't fit is replaced by a one-line text description such as [Image: a whiteboard sketch of the login flow], or plain [Image] if it has no description yet.
That description is written once, in the background, by a small vision model (claude-haiku-4-5 by default) shortly after you upload the image. It's also what the conversation summarizer sees, so summaries can mention what an image showed. Set IRIS_IMAGE_DESCRIPTIONS_ENABLED=false to turn descriptions off. For images that have no description, such as ones uploaded while descriptions were off, php artisan iris:backfill-image-descriptions queues one description job per image (--dry-run prints the count, --user= limits it to one user). See Images for the caps and the description model.
Retrying a message that had images sends the same images again.
Retry
If a provider error occurs, the failed message appears inline with a retry button. Clicking retry re-runs the full request — context assembly, LLM call, and tool execution — with the same input. It first deletes everything after your last message in the thread (the failed reply, plus any audio and recall records attached to it); your message and its attachments stay. See Error Handling for details on what information is shown and when retrying helps.
Streaming
All responses stream in real-time via WebSockets using Laravel Reverb. Streams are scoped to the active thread, so each thread's broadcasts are isolated. The stream includes:
| Event Type | Content |
|---|---|
| Text chunks | Partial response text as it's generated |
| Tool calls | When Iris invokes a tool |
| Tool results | What the tool returned |
| Provider tools | Activity from Anthropic's built-in tools |
| Artifacts | Generated content like images |
Connection Recovery
If your connection drops briefly or you switch away from the tab, you won't miss or repeat any events:
- Every event in a reply gets a sequence number (0, 1, 2, ...), and the same number goes out over the WebSocket and into a Redis replay store, where it's kept for 10 minutes after the last event
- The browser applies an event only when it's the next number in order. Anything it has already applied is dropped, and a gap means events were missed
- When it spots a gap, reconnects, or you return to a tab that was hidden for 3 seconds or more, the browser catches up from the server: it asks for every event after the last one it applied, polling once a second (for up to five minutes) until the reply finishes
- A reply that's still streaming is never replaced by the server's unfinished copy, and recovered replies keep their web search steps and generated artifacts
- When you return after 10 seconds or more, or the WebSocket reconnects, the sidebar's thread list reloads too, so threads created while you were away (a proactive message, for example) appear
Stopping Streams
Users can stop a stream mid-generation. The stop is graceful—partial responses are preserved and the conversation state remains consistent.
Request Architecture
When you send a message, Iris processes it asynchronously:
- Accept & Queue: Your message is received within the active thread and a background job is dispatched
- Process: The job builds thread-scoped context, executes the agent, and generates a response
- Broadcast: Response events stream to clients viewing this thread via WebSockets
- Persist: The conversation is saved to the thread and background jobs (extraction, summarization) are queued
This architecture enables:
- Reliable delivery: If your connection drops, events are stored and replayed when you reconnect
- Fail-fast errors: Provider errors surface immediately with no automatic retries — the error appears inline with a retry button
- Non-blocking responses: Your browser remains responsive while processing happens server-side
Error Handling
When a provider request fails, Iris does not retry automatically — the job runs once (tries = 1), and if it fails, the error surfaces immediately. Iris marks the conversation as failed and broadcasts the error to your browser.
What you see
The failed assistant message appears inline in the chat with two pieces of information:
- Human-readable message: A plain-English description of what went wrong
- Retry button: Available for every error except a refusal (see Refusals)
Error messages by type
| Error | Message shown |
|---|---|
| Prompt too long (context window exceeded) | "The conversation is too long for the model's context window. Try starting a new conversation or asking Iris to work in smaller steps." |
| Rate limited | "The AI provider is currently rate-limited. Please wait a moment and try again." |
| Provider overloaded | "The AI provider is temporarily overloaded. Please try again in a moment." |
| Model refusal | A banner offering to edit or delete your message (see Refusals) |
| Other provider errors | The provider's own message, or a generic fallback |
Retrying manually
Click the retry button below a failed message to re-run the full request with the same input. For transient errors (rate limits, provider overload), retrying immediately or after a brief wait usually resolves the issue.
Prompt too long
If Iris reports that the conversation is too long for the model's context window, retrying with the same input won't help — the problem is the accumulated context size, not a transient provider state. Your options are:
- Start a new conversation in a fresh thread with no history
- Ask Iris to work in smaller steps — break the task into pieces that each fit within the window
NOTE
Context management (compaction, pruning, and progressive truncation) keeps most conversations well within bounds during normal use. See Context Management for how Iris handles a filling context window before this limit is reached.
Refusals
Sometimes the model declines to respond. Resending the same history usually gets the same answer, so a refused turn shows a banner with Edit message and Delete message in place of the retry button:
- Edit message puts your message back in the composer. When you send the edited version, Iris deletes the refused turn first.
- Delete message removes your message and the declined reply.
Iris discards any partial output from a refused reply and never saves it to history. Your message does stay in the thread's history until you edit or delete it, so later turns still include it.
NOTE
Edit restores your message text only. Image attachments aren't restored, so attach them again before sending.
Failed conversations are preserved
Failed conversations aren't cleaned up automatically. The message stays in the chat with its error state and the retry button visible — even after navigating away and returning — until you retry it, which replaces it. Iris retains the full failed state so you always see what was attempted and what went wrong.
Frontend Integration
The frontend uses Laravel Echo for WebSocket connections. The hooks in resources/js/hooks/chat/ manage connection state, event sequencing (stream-sequence.ts), and replay polling (replay-poller.ts) on reconnection.