Skip to main content

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

  1. Click the + button in the tab bar to create a new tab
  2. Start an independent conversation in the new tab
  3. Click different tabs to switch between conversations
  4. 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

ActionResult
Regenerate replyCreates a new branch at the current AI message position, preserving the original reply
Edit a sent messageCreates 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 / 3 means there are 3 branches and you are viewing the 2nd
  • Left/right arrows — click to switch between branches

Steps

  1. Hover over an AI reply and click the Regenerate button in the toolbar
  2. The system generates a new reply and creates a new branch
  3. A branch navigation component appears next to the message (e.g., 1 / 2)
  4. Click the left/right arrows to view different reply versions
  5. 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:

ContentRendering Behavior
MarkdownHeadings, lists, code blocks (syntax highlighting + one-click copy), tables, blockquotes
Images / VideosInline preview; images can be opened in a Lightbox for a full-size view
AudioBuilt-in player
Reasoning processCollapsible region, collapsed by default
Tool callsTool name + arguments + results, collapsible
Inline HTMLWhen 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
JSONAutomatically detected and displayed in formatted form

Attachment Uploads

Chat supports multiple methods for uploading attachments so AI can analyze file content.

Upload Methods

MethodHow
Drag and dropDrag files from a file manager into the chat input area
PasteUse Ctrl+V to paste images from the clipboard
File pickerClick 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
  • 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

  1. Type / in the chat input box
  2. The command menu appears, showing a list of available commands
  3. Continue typing to filter commands
  4. Use the up/down arrows to select a command; press Enter to execute
  5. Or click a command directly to execute it

Built-in Commands

CommandDescription
/clearClear the current session's message history
/helpDisplay help information
/modelQuickly switch the AI model in use
/settingsOpen 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

  1. Type @ in the chat input box
  2. A file selection dropdown appears, showing the current project's file list
  3. Type a filename keyword to filter
  4. Use the up/down arrows to select a file; press Enter to confirm
  5. The file reference is inserted as a marker in the input box
  6. 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

  1. Type // in the chat input box
  2. The quick prompt insertion menu appears
  3. The menu shows favorited prompts, recently used prompts, and prompt chains
  4. Select a prompt template
  5. If the template contains variables (e.g., {{language}}), a variable fill-in form pops up
  6. 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

ShortcutAction
EnterSend message (default mode)
Ctrl+EnterSend message (Ctrl+Enter mode) or insert a line break (default mode)
Shift+EnterInsert a line break in the input box
EscClose the command menu or file selection menu
Up / DownMove selection in the command menu or file menu
Ctrl+VPaste text or image

Send Mode Configuration

You can toggle the keyboard shortcut for sending messages in settings:

ModeEnter key behaviorCtrl+Enter key behavior
Enter to send (default)Send messageInsert line break
Ctrl+Enter to sendInsert line breakSend 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

ProblemSolution
No reply after sending a messageCheck that the LLM provider has an API Key configured and that the network connection is working
Streaming response interruptedLikely a network fluctuation or API timeout; try regenerating the reply
Attachment upload failedCheck whether the file size exceeds the limit and whether the file format is supported
Command menu does not appearEnsure / is typed at the beginning of the input box or after a space
Branch navigation not showingThe navigation component only appears when a message has more than one branch
@ file reference is unresponsiveA project must be open first; the file reference feature depends on project context