Skip to content

AI Module

The AI module answers questions inside the platform. It reads the knowledge base and live platform data, and replies in the language of the question, with the sources it used.

Two audiences, one service:

  • Employees — backoffice and CRM. The assistant explains how the platform works and looks up customers, accounts, trades and margin state.
  • Clients — the trading terminal. The assistant explains the same mechanics in client language and looks up only the account of the current session.

The module also turns platform events into notifications: a margin call or a verification change becomes a text that a manager approves before it reaches the client.

What an interface gets

Capability What it means for the interface
Asynchronous answers AIChatSendMessage returns a runId immediately; the answer arrives as events or is polled with AIChatGetRun
Streaming the answer arrives in fragments through module events as module:event
Sources every answer carries the knowledge documents it was built from
Actions a document may offer a navigation button; the model cannot invent one
Tool trace which platform data the assistant read for this answer
Idempotency a repeated requestId returns the existing run instead of paying for a second answer

What the module never does

It is read-only. There is no method that opens, closes or modifies a trade, moves money, or changes an account. The assistant reads and explains; every action stays with the person or with the existing platform methods.

It also does not give investment advice. That is a product decision built into the system prompt, not a limitation of the model.

Where to start

You are building Read
Chat in the terminal, backoffice or CRM Chat integration
The approval queue for generated notifications Notifications
Administration screens (agents, prompts, knowledge, spend) Administration
Anything over HTTP REST API
Anything over TCP, plus streaming events TCP API

Methods

Names in the table are the TCP command names; the REST column is the HTTP entry point of the same method.

Chat

Available to managers and to clients. A client session is limited to its own account.

Method REST Description
AIChatCreateConversation POST ai/chat/conversation Start a conversation
AIChatGetConversations GET ai/chat/conversations Conversation list of the current session
AIChatGetConversation GET ai/chat/conversation One conversation with a page of messages and the active run
AIChatUpdateConversation PUT ai/chat/conversation Rename or archive a conversation
AIChatDeleteConversation DELETE ai/chat/conversation Delete a conversation
AIChatSendMessage POST ai/chat/message Ask a question; returns a runId without waiting for the model
AIChatGetRun GET ai/chat/run State and result of a run
AIChatCancelRun POST ai/chat/run/cancel Stop a running answer
AIFeedbackAdd POST ai/chat/feedback Rate an answer
AIGetAgents GET ai/chat/agents Agents this session may talk to

Notifications

The queue of texts the assistant generated from platform events.

Method REST Description
MngGetAINotificationsByFilter GET ai/notifications Queue and journal, with the state of delivery channels
MngApproveAINotification POST ai/notification/approve Approve and deliver, optionally with an edited text
MngRejectAINotification POST ai/notification/reject Reject with a reason
MngRetryAINotification POST ai/notification/retry Deliver a notification that stayed pending

Agents and tools

Method REST Description
MngGetAIAgentsByFilter GET ai/agents Agent configurations
MngAddAIAgent POST ai/agent Create an agent
MngUpdateAIAgent PUT ai/agent Update an agent, its tools and its budgets
MngDeleteAIAgent DELETE ai/agent Soft-delete an agent
MngGetAIModels GET ai/models Models available to the provider, with prices
MngGetAITools GET ai/tools Tool catalogue and what is available on the bus right now

Prompt templates

Method REST Description
MngGetAIPromptTemplatesByFilter GET ai/prompts Templates of the brand
MngAddAIPromptTemplate POST ai/prompt Create a template
MngUpdateAIPromptTemplate PUT ai/prompt Update a template
MngDeleteAIPromptTemplate DELETE ai/prompt Soft-delete a template
MngTestAIPromptTemplate POST ai/prompt/test Preview substitution; with run also calls the model

Knowledge base

Method REST Description
MngGetAIKnowledgeStatus GET ai/knowledge/status Index state, per-brand breakdown, file errors
MngGetAIKnowledgeDocuments GET ai/knowledge/documents Loaded documents and their metadata
MngReloadAIKnowledge POST ai/knowledge/reload Rebuild the index without a restart
AIKnowledgeSearch POST ai/knowledge/search Search as the assistant sees it, with scores

Events and bindings

Method REST Description
MngGetAIWorkflowEvents GET ai/workflow/events Platform events an agent can subscribe to
MngGetAIWorkflowBindingsByFilter GET ai/workflow/bindings Event-to-agent bindings
MngAddAIWorkflowBinding POST ai/workflow/binding Bind an agent to an event
MngUpdateAIWorkflowBinding PUT ai/workflow/binding Update a binding
MngDeleteAIWorkflowBinding DELETE ai/workflow/binding Soft-delete a binding
MngTestAIWorkflowBinding POST ai/workflow/test Dry run: what would happen, and why not

Spend, audit and service

Method REST Description
MngGetAIUsageByFilter GET ai/usage Requests, tokens, cost, errors and latency
MngGetAIRunsByFilter GET ai/runs Run journal with filters
MngGetAIRunDetails GET ai/run One run with its prompt, sources and tool calls
MngGetAIFeedbackByFilter GET ai/feedback Ratings left by users
AIPing GET ai/ping Cheap liveness probe with a problem list
AIHealth GET ai/health Full state: database, knowledge, model, tools, platform commands

Entities

Entity Scope Purpose
agents brand Model, system prompt, allowed tools, daily budgets, and three independent modes: modeChat, modeClient, modeWorkflow
conversations session Chat history of one manager or one account
messages conversation Questions and answers with tokens, cost and sources
runs conversation One generation: state, tool rounds, spend, error
promptTemplates brand Text with placeholders for notifications and service prompts
workflowBindings brand Platform event to agent, with filters, cooldown and delivery channels
notifications brand Generated texts, their approval state and delivery result
toolCalls run Audit of every platform call the assistant made
usageDaily brand Daily aggregate of requests, tokens, cost and latency

The knowledge base itself is not an entity: documents are files in the module repository, reviewed like code and reloaded into memory by MngReloadAIKnowledge.

How answers are built

flowchart LR
    q["Question"] --> k["Knowledge search<br/>(language + audience)"]
    k --> p["Prompt:<br/>rules, agent, knowledge, history"]
    p --> m["Model"]
    m -->|needs data| t["Read-only platform tools"]
    t --> m
    m --> a["Answer + sources + actions"]

Three rules hold that picture together, and they explain most of what an interface sees:

  1. The model never decides access. Brand, account and session type come from __access; a tool call for another account is refused by the platform, not by the prompt.
  2. Figures come from tools, not from memory. If a tool fails, the assistant says so instead of inventing a number.
  3. Knowledge is data, not instructions. Text inside a document cannot change the assistant's behaviour.