Chat
Elftia's chat system is the application's core interaction interface. It supports multi-tab parallel conversations, message branching and switching, real-time streaming responses, file attachment uploads, session organization and management, as well as rich slash commands and keyboard shortcuts.
Use Cases
- Have multi-turn conversations with AI to get suggestions, answers, or collaborate on tasks
- Open multiple tabs simultaneously and switch freely between different topics
- When unsatisfied with an AI reply, regenerate it and use branch navigation to compare different results
- Upload images, documents, and other attachments so AI can understand and analyze file content
- Use slash commands to quickly execute built-in operations
- Use the
@symbol to reference project files and give AI code context - Use
//to quickly insert preset prompt templates
Multi-Tab
Elftia supports opening multiple chat tabs at the same time. Each tab has its own independent session context and message history.
Steps
- Click the + button in the tab bar to create a new tab
- Start an independent conversation in the new tab
- Click different tabs to switch between conversations
- Right-click a tab to close or rename it
Each tab's messages, context, and state are completely independent and do not interfere with one another.
Tab Keep-alive (0.1.8)
Switching tabs does not lose state:
- Switching away and back preserves the scroll position, any unsent draft, and streaming state
- Multiple tabs can simultaneously pull from the same LLM without overwriting each other (stream buffers are isolated by sessionId)
- Background tabs' polling and animations are automatically paused to conserve CPU
The settings page, Agents page, and other non-chat pages also apply keep-alive: if you switch to settings mid-edit and come back, which tab you were on, how far you had scrolled, and which fields you changed are all preserved.
Message Branching
Message branching is one of the core features of Elftia's chat system. When you regenerate an AI reply or edit a sent message, the system automatically creates a branch that preserves all historical versions for you to view and switch between at any time.
How Branches Are Created
| Action | Result |
|---|---|
| Regenerate reply | Creates a new branch at the current AI message position, preserving the original reply |
| Edit a sent message | Creates a new branch from the edit point; subsequent conversation continues based on the modified content |
Branch Navigation
When a message has multiple branches, a branch navigation component appears next to it, showing:
- Branch icon — indicates the current message has multiple versions
- Current index / total branches — for example,
2 / 3means there are 3 branches and you are viewing the 2nd - Left/right arrows — click to switch between branches
Steps
- Hover over an AI reply and click the Regenerate button in the toolbar
- The system generates a new reply and creates a new branch
- A branch navigation component appears next to the message (e.g.,
1 / 2) - Click the left/right arrows to view different reply versions
- You can regenerate multiple times; each regeneration adds a new branch
:::tip Branches Are Never Lost All branches are persisted. Even if you close the app and reopen it, the branch history remains fully intact. :::
Streaming Responses
AI replies use streaming transmission. Message content is displayed progressively in real time in the chat interface rather than waiting for the full generation to complete before showing all at once.
Behavior
- While a reply is being generated, the message area updates in real time
- A loading indicator at the bottom of the message shows that the reply is still being generated
- You can click the Stop button at any time during generation to interrupt the reply
- Partially generated replies are preserved
- Markdown formatting (code blocks, lists, headings, etc.) is rendered immediately as content streams in
- Reasoning process: reasoning from inference models is displayed in a collapsible region above the final reply
Streaming State Contract
Each message in streaming has data-streaming and data-stream-phase markers on the root DOM element, allowing external drivers (elftia-cli) to reliably wait for a message to complete. data-streaming is "true" whenever any of reasoning / tool-call / content typing is still in progress. This means a delayed tool-call result does not cause the streaming state to incorrectly switch to "false".
Rich Content Rendering
The chat system supports inline rendering of multiple rich content types:
| Content | Rendering Behavior |
|---|---|
| Markdown | Headings, lists, code blocks (syntax highlighting + one-click copy), tables, blockquotes |
| Images / Videos | Inline preview; images can be opened in a Lightbox for a full-size view |
| Audio | Built-in player |
| Reasoning process | Collapsible region, collapsed by default |
| Tool calls | Tool name + arguments + results, collapsible |
| Inline HTML | When a complete HTML document (containing <!DOCTYPE> / <html>) is detected, it is safely rendered in an iframe (sandbox does not allow same-origin) |
| Question Form (design session only) | Survey-style messages with radio buttons, checkboxes, text fields, and direction cards; submitting converts the form into a reply to continue the conversation |
| JSON | Automatically detected and displayed in formatted form |
Attachment Uploads
Chat supports multiple methods for uploading attachments so AI can analyze file content.
Upload Methods
| Method | How |
|---|---|
| Drag and drop | Drag files from a file manager into the chat input area |
| Paste | Use Ctrl+V to paste images from the clipboard |
| File picker | Click the attachment button next to the input box and select a file from the dialog |
Supported File Types
- Images — PNG, JPG, GIF, WebP, and other common image formats
- Documents — PDF, TXT, Markdown, and other text files
- Code files — source code files in various programming languages
Uploaded attachments display as preview thumbnails above the input box; you can click to remove them before sending.
Session Management
Elftia provides comprehensive session organization and management features to help you efficiently manage large numbers of conversations.
Folders
- Create folders in the sidebar to organize related sessions into groups
- Supports multi-level nested folder structures
- Drag sessions into folders to categorize them
Tags
- Add custom tags to sessions for easy categorization
- Quickly filter related sessions by tag
Search
- Enter keywords in the search box at the top of the sidebar
- Search covers both session titles and message content
- Search results highlight matches in real time
Pinned Sessions
- Right-click a session and select Pin to keep it at the top
- Pinned sessions always appear at the top of the list and won't be pushed down by new sessions
Command Menu (/ Slash Commands)
Typing / in the input box opens the command menu, which provides a range of quick actions.
Steps
- Type
/in the chat input box - The command menu appears, showing a list of available commands
- Continue typing to filter commands
- Use the up/down arrows to select a command; press
Enterto execute - Or click a command directly to execute it
Built-in Commands
| Command | Description |
|---|---|
/clear | Clear the current session's message history |
/help | Display help information |
/model | Quickly switch the AI model in use |
/settings | Open the settings panel |
:::info Custom Commands In addition to built-in commands, the Agent system and plugins can also register custom commands. The available commands depend on the currently active Agent and installed plugins. The command palette (slash palette) supports fuzzy search; press Tab to auto-complete arguments. :::
File References (@ Symbol)
Typing @ in the input box lets you reference files in the project, appending file content to the message context.
Steps
- Type
@in the chat input box - A file selection dropdown appears, showing the current project's file list
- Type a filename keyword to filter
- Use the up/down arrows to select a file; press
Enterto confirm - The file reference is inserted as a marker in the input box
- When you send the message, the referenced file's content is sent to AI along with it
:::tip Use Case The file reference feature is especially useful in code-related conversations. You can reference source code files so AI can analyze the code logic, find bugs, or suggest optimizations. :::
Quick Prompt Insertion (// Double Slash)
Typing // in the input box lets you quickly insert a preset prompt template.
Steps
- Type
//in the chat input box - The quick prompt insertion menu appears
- The menu shows favorited prompts, recently used prompts, and prompt chains
- Select a prompt template
- If the template contains variables (e.g.,
{{language}}), a variable fill-in form pops up - After filling in the variables, the final prompt content is inserted into the input box
For detailed prompt management, see the Prompts documentation.
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Enter | Send message (default mode) |
Ctrl+Enter | Send message (Ctrl+Enter mode) or insert a line break (default mode) |
Shift+Enter | Insert a line break in the input box |
Esc | Close the command menu or file selection menu |
Up / Down | Move selection in the command menu or file menu |
Ctrl+V | Paste text or image |
Send Mode Configuration
You can toggle the keyboard shortcut for sending messages in settings:
| Mode | Enter key behavior | Ctrl+Enter key behavior |
|---|---|---|
| Enter to send (default) | Send message | Insert line break |
| Ctrl+Enter to send | Insert line break | Send message |
Switch the send mode under Settings > General.
Complete Conversation Flow
Here is the typical flow of a complete conversation:
Type message → Send → Streaming response displayed in real time
↓
Satisfied with the reply?
├── Yes → Continue the conversation
└── No → Regenerate (creates a branch)
↓
Branch navigation to compare versions
↓
Choose the preferred version and continue
FAQ
| Problem | Solution |
|---|---|
| No reply after sending a message | Check that the LLM provider has an API Key configured and that the network connection is working |
| Streaming response interrupted | Likely a network fluctuation or API timeout; try regenerating the reply |
| Attachment upload failed | Check whether the file size exceeds the limit and whether the file format is supported |
| Command menu does not appear | Ensure / is typed at the beginning of the input box or after a space |
| Branch navigation not showing | The navigation component only appears when a message has more than one branch |
@ file reference is unresponsive | A project must be open first; the file reference feature depends on project context |
Related Links
- LLM Provider Configuration — configure AI models and API Keys
- Prompts — manage and use prompt templates
- Agent — learn about the Agent system and custom commands
- Web Search — integrate real-time web search into conversations