Перейти к содержанию

AI Work Flow

Trigger

Member opens Playground to work with the assistant.

Flow

sequenceDiagram
  participant U as User
  participant FE as Frontend
  participant CHAT as AI_Chat
  participant SPD as Spending
  participant DOC as Document_MCP

  U->>FE: New message
  FE->>CHAT: POST chat
  CHAT->>SPD: Check or record spend
  alt MCP tool needed
    CHAT->>DOC: tools/call
    DOC-->>CHAT: Document or screenshot
  end
  CHAT-->>FE: Assistant reply
  FE-->>U: Rendered answer

Steps

  1. User selects or creates chat session.
  2. Frontend sends message with JWT to Chat service.
  3. Chat checks rate limits and token balance (Spending / Billing entitlements).
  4. Model generates reply; optional tool calls to Document MCP (files, screenshot).
  5. Spending records token usage; balance updated.
  6. Reply shown; session persisted for later.

Outcome

Answer delivered; ledger updated; session history retained.

Plan constraints

Tokens/month, rate limits, vision calls, image generation may be tier-specific.

Failure modes

Failure User impact
Quota exhausted Chat rejected or degraded message
MCP tool error Partial answer; user notified
Model provider outage Retry or fallback provider if configured