Skip to main content

AI Chat Assistant

Overview

Evatar's AI chat assistant is an LLM-based Agent system with Tool Calling capability. It can search the user's screenshot knowledge base, fetch recent screenshots, search the internet, and leverage the memory system to provide personalized answers.

Available Tools

ToolFunction
search_knowledgeSingle keyword search in screenshot knowledge base
search_multiMulti-keyword simultaneous search, merge and dedup
get_recentGet recent N screenshot analyses (no search term needed)
web_searchSearch the internet

Agent Loop

The Agent follows a loop pattern (max 3 rounds):

  1. Build history messages (last 20) and inject user memories
  2. Call LLM with messages and tools
  3. If LLM returns tool_calls, execute tools and continue loop
  4. If LLM returns plain text, return final reply
  5. Async extract memories after conversation ends

Key Features

  • Memory Injection: First round auto-loads user memories as context
  • Skill System: Inject additional System Prompt instructions for specific tasks
  • File Attachments: Support multimodal dialogue with image and file uploads
  • RAG Retrieval: FTS5 full-text search with keyword LIKE fallback
  • Error Handling: LLM config check, timeout protection, user-friendly error messages

Conversation Management

OperationAPIDescription
Create/continue conversationPOST /api/chat/sendconversation_id optional, auto-generates 16-char hex
With attachmentsPOST /api/chat/send-with-fileSupports images and other files
List conversationsGET /api/chat/conversationsSorted by update time, with message count
Get conversation detailsGET /api/chat/conversations/{id}Complete message history
Delete conversationDELETE /api/chat/conversations/{id}Cascade deletes all messages