Skip to content

AI Chat Assistant

The AI Chat Assistant is a context-aware conversation panel embedded on every page. It can perceive the content of the page you're currently browsing and provide instant intelligent assistance.

Difference from Ask

DimensionAI Chat AssistantAsk (/ask)
Entry PointFloating panel on all pagesDedicated page /ask
ContextAware of current page contentIndependent Q&A session
Answer DestinationCurrent session onlyMay be archived as knowledge assets
Session ManagementLocal storage, max 10 sessionsServer-managed
QuotaLimited usageBased on plan
Use CaseQuick queries, page assistanceFormal knowledge exploration

Page Structure

Chat Panel (AiChatPanel)

SectionDescription
Message ListConversation history (AiChatMessage component)
Input BoxText input and send
Quota DisplayRemaining conversation count
Source CitationsKnowledge sources cited in responses

Message Format

Each message (AiChatMessage) contains:

FieldDescription
roleRole (user / assistant)
contentMessage content (Markdown rendered)
sourcesCited knowledge sources (if any)

Context Awareness

collectPageContext() in chatContext.js automatically collects current page information:

ContextDescription
pageUrlCurrent page URL
pageTitlePage title
languageCurrent language
pageDescriptionPage description

This information is sent along with conversation requests, letting the AI "see" what you're browsing.


Quota Management

FieldDescription
remainingCurrent remaining conversation count
limitTotal quota limit
resetsAtQuota reset time
unlimitedWhether unlimited (Ultra users)

Quota is managed through two layers:

  1. Local rate limiting (chatRateLimit.js): evomap_ai_chat_quota in localStorage
  2. Server-side rate limiting: GET /api/hub/ai-chat/quota syncs real quota

Data Storage

StorageContentLimit
localStorage:evomap_ai_chatSessions and messagesMax 10 sessions, 50 messages per session
ServerQuota and usage recordsBased on plan

Conversation content is not uploaded to the server — stored in browser local storage only.


API Reference

APIPurposeMethod
POST /api/hub/ai-chatSend conversation requestSSE (Server-Sent Events) streaming
GET /api/hub/ai-chat/quotaQuery quotaJSON

AI Chat uses SSE protocol for streaming token responses, supporting real-time typing effects. Responses include tokens (text), sources (source citations), and quota (updated quota).


FAQ

Will conversation history sync to other devices?

No. Conversation history is stored in browser localStorage, only valid on the current device and browser. Clearing browser data will delete all conversation history.

What if my quota runs out?

Quota automatically resets after a fixed cycle (check resetsAt time). Upgrading to a higher plan gives more quota; Ultra users have no limits.

Released under the MIT License.