Documentation

AI Chat

Chat with a loaded model, or ask a multimodal model about images. You can also connect a knowledge base for text chat.

Hover over the corresponding conversation entry in the main menu to view its conversation list. Selecting a conversation opens it. Use Runtime Settings at the top right to adjust the current conversation.

Select the page title to rename the current conversation in place. The hover list only switches conversations. To rename or delete from the list, pin the submenu, then select the conversation title or its trash button.

Table of Contents


Environment Requirements

Chat and multimodal models that use llama.cpp need no additional environment. HF Transformers chat models require a CPU or GPU environment installed in Settings.

You only need to:

  1. Download and load a chat model or multimodal model in the Model Library.
  2. Start chatting once the model is successfully loaded.

Prerequisites

Before using the chat feature, you need to load a model in the Model Library page:

  • Text Chat: Load a "Chat Model".
  • Image-Text Chat: Load a "Multimodal Model".

When no model is loaded, the chat page will prompt you to "Go to Model Library to load <Chat Model>".


Interface Layout

Open the conversation list from the main menu. Pin the submenu to keep the list on the left; the main area shows the current conversation.

Left - Session List

  • New Conversation button: Located at the top.
  • Session List: Grouped by time (Today/Yesterday/Within 7 Days/Within 30 Days/Older). Lists longer than 100 sessions still load. You can search by title.
  • Date groups: The folded or expanded state of a date group is kept the next time you open the list.
  • Pin submenu: The pin control in the window chrome pins the submenu. It does not pin a session.
  • Session Operations: Select the conversation title to rename it or use the trash button to delete it. The hover list is only for selecting conversations.

Right - Chat Area

  • Message List: Shows the current conversation.
  • History navigation: The main page moves backward and forward through pages already opened.
  • Input Box: Located at the bottom, containing the following features:
    • Thinking switch: Enables the display of AI thinking processes.
    • Retrieval switch: Enables RAG knowledge base retrieval.
    • Attachment button (displayed only for multimodal models).
    • Prompt Generation button (Magic Wand icon).
    • Send button.

Conversation Management

New Chat

Click New Conversation at the top of the conversation list, or the plus button at the top of the page. The system will:

  1. Automatically generate a temporary title (e.g., "New Chat 10:30").
  2. Automatically generate a formal title after the first message is sent.

Switch Chat

Click directly on any conversation in the session list on the left.

Rename Chat

  1. Pin the submenu to show the conversation list on the left.
  2. Select the conversation title.
  3. Enter the new title and confirm.

Delete Chat

  1. Pin the submenu to show the conversation list on the left.
  2. Click the trash button beside the conversation.
  3. Confirm the operation (this action cannot be undone).

Sending Messages

Text Chat

  1. Enter your question in the input box.
  2. Click Send or use the shortcut selected in Settings → General → Editor. Shift + Enter inserts a new line.

Image-Text Chat (Multimodal)

Prerequisite: A multimodal model must be loaded.

  1. Click the Attachment Button (Link icon) on the left side of the input box.
  2. Upload an image:
    • Click the "Add Attachment" button to select a file.
    • Or drag and drop the image directly into the attachment area.
  3. Supported Formats: JPG, PNG.
  4. Enter a related question.
  5. Click Send.

Note:

  • The image will be sent to the model along with the text.
  • When no image is added, the multimodal model will work in text mode.

Feature Switches

There are two important switches above the input box:

Thinking Switch

  • Function: When enabled, the AI will display its thinking process.
  • Display: Collapsible panel "💭 AI Thinking Process".
  • Usage: To understand the AI's reasoning logic.
  • Thinking off: The model does not produce a thinking trace.
  • Thinking on: The thinking trace stays in the reply.

Retrieval Switch

  • Function: Enables RAG knowledge base retrieval.
  • Prerequisite: A knowledge base must be selected first (see the next section).
  • Effect: The AI will answer questions based on the content of your knowledge base.

RAG Retrieval Augmented Generation

RAG allows the AI to answer questions based on your own database.

Preparation

Before use, you need to create a RAG dataset (knowledge base) in the Data Module.

Usage Steps

  1. Click Runtime Settings (gear icon) at the top right.
  2. Expand the "RAG Model Configuration" collapsible panel.
  3. Select Knowledge Base: Select a created dataset from the dropdown menu.
  4. Configure Parameters (Optional):
    • Retrieval Method: Hybrid (Recommended) / Vector / Vector + Rerank / Text.
    • TopK: Number of retrieved documents (default is 5).
    • Score Threshold: Similarity filter (0-1, default is 0.3).
    • Max Context Length: Maximum number of characters for a single retrieval.
    • RAG Search Prompt: Custom retrieval behavior instructions.
  5. Close the Drawer.
  6. Turn on the "Retrieval" switch above the input box.
  7. Send messages normally.

Managing Knowledge Bases

  • View list: All available collections are shown in the parameter drawer
  • Delete collection: Click the delete button next to a collection to remove it from chat
  • Delete note: Deleting a collection here only removes its configuration and does not delete stored vector files
  • Shared with the agent: The same knowledge base can be attached from chat and from the agent. Each side keeps its own retrieval settings.

Re-import

You can re-import a deleted collection as long as the vector data files still exist. You need to select the corresponding import file (rag_dataset_***_meta.json) to import.

The program directory contains a sample knowledge base generated from the official manual. You can use Re-import to import this knowledge base and try the RAG features.
Import file path: <InstallationDrive>/ModxAI Studio/ModxAI-Backend/_internal/server/resources/example/rag_manual/rag_dataset_reimport_meta.json

Delete Knowledge Base

In the knowledge base dropdown of the inference parameter drawer, there is a delete button on the right side of each knowledge base.


Inference Parameter Settings

Click Runtime Settings (gear icon) at the top right to open the parameter panel.

Basic Parameters

Temperature

  • Range: 0-1
  • Default: 0.7
  • Function:
    • Low Temperature (<0.5): Answers are more stable and conservative.
    • High Temperature (>0.8): Answers are more creative and random.
  • Adjustment: Slider or direct numerical input.
  • Reset: Click the reset button on the right to restore the default value.

Max Tokens

  • Range: 1-8192
  • Default: 1024
  • Function: Limits the maximum length of a single reply.
  • Note: Too small a value may cause the answer to be truncated.

System Prompt

  • Function: Sets the role or task background for the AI.
  • Save Template: Frequently used prompts can be saved as templates.
  • Delete Template: Select a template and click the delete button.

Thinking Depth

Set thinking depth in the inference settings. A higher level is slower. The highest level is Max. The thinking switch turns thinking on or off. Depth sets how far the model thinks.

KV Cache and MTP

These are advanced inference settings. Keep the defaults when starting out. Before changing them, read the option descriptions, change one setting at a time, and check response quality and resource use. For the corresponding agent settings, see Role Configuration.

RAG Parameters (Collapsible Panel)

See the RAG Retrieval Augmented Generation section above.


Message Operations

User Messages (Sent by You)

There is a floating button group to the right of each user message:

  • Edit: Modify the message content and save.
  • Copy: Copy to clipboard.
  • Delete: Delete the message.
  • Resubmit: Delete the message and all subsequent conversations, then resend.

Resubmit Explanation:

  • Will delete all content after this message.
  • Suitable for correcting input errors and re-asking.
  • Operation cannot be undone, please use with caution.

AI Replies

There is a floating button group to the right of each AI reply:

  • Collect (Thumbs up icon): Add to the collection dataset.
  • Dislike (Thumbs down icon): Mark as unsatisfactory (remove from added collections).
  • Copy: Copy the reply content.
  • Delete: Delete the reply.

View Thinking Process:

  • If the "Thinking" switch is enabled.
  • A collapsible panel "💭 AI Thinking Process" will be displayed above the AI reply.
  • Click to expand and view the reasoning steps.

Notes

Model Requirements

  • Text Chat: Must load a chat model.
  • Image-Text Chat: Must load a multimodal model.
  • Feature switches will be automatically enabled or disabled based on the current model.

RAG Usage Restrictions

  • Must create a RAG dataset first.
  • Must select a knowledge base after turning on the retrieval switch.
  • An error will be prompted if no knowledge base is selected.

Image Format Restrictions

  • Supported: JPG, PNG.
  • Not Supported: GIF, BMP, WebP, and other formats.
  • Uploading unsupported formats will be rejected.

Empty Reply Handling

In rare cases, the AI may fail to generate a valid reply, and the following will be displayed:

  • "The model did not return a valid reply."

Suggestions:

  • Rephrase the question.
  • Check if the model is loaded correctly.
  • Check if the inference parameters are reasonable.

Context Management

Click the Context Usage ring at the top of the page to view usage and use Compress Context if needed. The ring is disabled when no context data is available. Compression can omit details, so restate important requirements.

  • Each conversation maintains its context independently.
  • The backend automatically manages the context window length.
  • For very long conversations, it is recommended to start a new session to avoid context confusion.

Performance Suggestions

  • High temperature and long replies will increase inference time.
  • Pay attention to resource consumption when deploying locally.
  • Appropriately control the number of concurrent conversations.

After completing this chapter, you can continue to learn about: