AI Chat
The TM AI Chat feature provides an interactive conversational AI interface that allows users to engage with AI agents for various tasks. It supports role-based access control, contextual conversations, and optional integration with Vector Database for knowledge-enhanced responses.
Overview
TM AI Chat enables users to:
- Interact with configured AI agents through a conversational interface
- Maintain chat history and context across sessions
- Add document data as context for more informed responses
- Leverage Vector Database knowledge when available
- Control access to data by configuring up-front the TM AI Chat Agent
Accessing AI Chat
Navigate to the AI Chat interface through:
- Go to the AI Workspace
- Click on Go to AI Chat under the AI Chat section
- Or directly access via the page route:
/app/tm-ai-chat
Creating a TM AI Chat Agent
AI Chat Agents define the behavior, context, and constraints for conversational AI interactions.
Agent Configuration Fields
| Field | Description |
|---|---|
| Name | Unique identifier for the chat agent (e.g., "Customer Support Assistant", "HR Helper"). |
| AI Model | The LLM model that powers this chat agent. Only models with type "LLM" are compatible. |
| Application | The application scope this agent belongs to. Required field that cannot be changed after creation. |
| Active | Toggle to enable/disable the agent. Inactive agents won't appear in the chat interface. |
Chat Configuration Fields
| Field | Description |
|---|---|
| Instructions | System prompt that defines the agent's personality, behavior, and capabilities. This is the primary way to control how the agent responds. |
| Context | Multi-select field to attach reusable context sets from TM AI Context. These provide additional background information to the agent. |
| Allowed Roles | Specify which user roles can access this chat agent. If empty, all Desk users can use it. |
| Max Chat Length | Limits the number of user messages per chat session (default: 100). When reached, users must start a new conversation. |
Search Knowledge Fields (if Vector DB enabled)
| Field | Description |
|---|---|
| Use Vector DB | Enable to allow the agent to search and retrieve information from the Vector Database. |
| Search Scope | Optional link to a VectorDB Search Scope that defines search parameters and filters. If not specified, searches the entire knowledge base. |
Using the Chat Interface
Starting a Conversation
- Select an Agent: Use the autocomplete field or browse available agents
- Send Messages: Type your message and press Enter or click Send
- View Responses: AI responses stream in real-time
Chat Features
Adding Document Context
During a conversation, you can add document data as context:
- Click the Add Context button (+ icon)
- Select the DocType you want to reference
- Choose specific documents to include
- The selected data becomes part of the conversation context
Chat History
- Recent conversations appear in the sidebar (last 5 chats)
- Click on any previous chat to continue the conversation
- Completed chats are read-only but can be viewed
- Access full history through the "See all history" link
Session Management
- Each chat maintains its own context and message history
- Chats have three states:
- Active: Ongoing conversation
- Completed: Reached max length or manually ended
- Archived: Old conversations for reference
- Use the New Chat button to start fresh with any agent
Real-time Streaming
- Responses stream character by character for immediate feedback
- Loading indicators show when the AI is processing
TM AI Chat History
The system automatically maintains conversation history for each user.
History Fields
| Field | Description |
|---|---|
| Chat Agent | The agent used for this conversation |
| User | The user who initiated the chat |
| Status | Current state (Active/Completed/Archived) |
| Messages | JSON array containing the full conversation |
| Last Message Time | Timestamp of the most recent interaction |
Managing History
- History records are created automatically when starting new chats
- Users can only view their own chat history
- Administrators with TM AI Chat Admin role can view all histories
- Old conversations can be archived for long-term storage
TM AI Chat Settings
Global settings control the availability of the chat feature.
| Field | Description |
|---|---|
| Enabled | Master toggle to enable/disable the entire chat feature system-wide |
Permissions and Roles
The chat system uses two primary roles:
TM AI Chat Admin
- Full access to create, edit, and delete chat agents
- Can view all chat histories across users
- Manages global chat settings
- Can delete chat history records
TM AI Chat User
- Can view available chat agents (read-only)
- Access their own chat history
- Cannot modify agent configurations
- Cannot access other users' conversations
Best Practices
Agent Design
- Clear Instructions: Write specific, detailed instructions that clearly define the agent's role and boundaries
- Contextual Knowledge: Use TM AI Context to provide domain-specific information without repeating it in instructions
- Role Specificity: Name agents by their function (e.g., "Legal Advisor", "Code Reviewer") for clarity
- Access Control: Use role restrictions for sensitive or specialized agents
Conversation Management
- Session Length: Set appropriate max chat lengths based on use case (shorter for Q&A, longer for analysis)
- Context Usage: Add document context only when relevant to avoid information overload
- History Review: Periodically review chat histories to understand usage patterns and improve agents
Performance Optimization
- Vector DB Integration: Enable for agents that need to search large knowledge bases
- Search Scopes: Use specific search scopes to improve relevance and control data access
- Context Limits: Balance between comprehensive context and response time
Integration with Vector DB
When Vector DB is enabled:
- Chat agents can search the knowledge base for relevant information
- Search results are automatically included as context
- Multi-turn conversations can use query rewriting for better results
- Search scopes allow fine-tuned control over what information is accessible
Troubleshooting
Common Issues
Agent not appearing in chat interface
- Verify the agent is marked as Active
- Check role permissions match your user roles
Chat reaches maximum length unexpectedly
- Review the Max Chat Length setting on the agent
- Note that only user messages count toward the limit
- Start a new chat to continue conversations
Slow response times
- Check if Vector DB search is enabled unnecessarily
- Review the amount of context being included
- Verify the AI Model's performance characteristics
Context not being recognized
- Ensure TM AI Context records are active and relevant
- Verify context is properly linked to the agent
- Check that referenced documents exist and are accessible