AI answers and agents
Connecting a language model, the AI action in reactions, and the grounded AI agent that answers customers on its own.
On this page
GetMyBot uses language models in two ways. The AI action generates or parses text inside a reaction you designed. The AI agent answers customers on its own, grounded in the knowledge sources you approve, and hands the conversation to an operator when it should not answer.
Both share one AI integration.
Connecting a model
Add an integration of type AI (in the Integrations section) and fill in:
- Base URL: the address of an OpenAI-compatible API (defaults to
https://api.openai.com/v1). Works with OpenAI, OpenRouter, local servers, and other compatible providers. - Model: for example,
gpt-4o-mini. - System prompt: a general instruction for the model.
- API key: the provider key (stored encrypted; can be moved to credentials).
The same integration also produces the embeddings used to index knowledge sources, so without it neither the agent nor knowledge search can run.
The AI action
Add an AI action to a reaction and configure:
- AI integration: which connected model to use.
- Prompt: the task for the model; supports substitutions
(
{{text}},{{param.key}},{{ctx.key}}). - Save response to parameter and/or Save response to ctx (key): where to store the result.
- JSON extraction schema: if set, the model returns structured JSON matching the schema (useful for parsing requests, extracting fields, classification). The result can be iterated with a list loop.
- Send response to user: immediately send the generated text to the chat.
AI block in a message
The message builder includes an AI block with its own prompt: it generates part of the response on the fly (see Messages and buttons).
Example use cases
- Free-form assistant dialog: prompt + "send response to user".
- Request parsing: a JSON schema extracts topic, contact, and urgency into
ctx, then writes to a collection and notifies an operator. - Classification: the model's response is saved to a parameter and checked by a "With parameters" condition.
The AI agent
The AI section of the left menu holds agents, the calendar, and analytics. An agent answers incoming messages by itself: it retrieves excerpts from the sources you allowed, composes an answer, may collect facts or book a meeting, and hands over to a human when its own rules say so. A draft agent never joins a conversation.
Lifecycle and versions
An agent is Draft, Active, Paused, or Archived. A draft can be activated or archived, an active agent can be paused or archived, a paused agent can be activated or archived. Archiving is final.
Activation stores a complete snapshot of the settings as a version. Editing an active agent creates the next version, while conversations already under way keep the version they started with. Each inbound channel belongs to at most one active agent: activating a second agent on the same channel is refused.
Configuration
Basics and behaviour:
- Channels and surfaces: where the agent answers. An active agent runs on Telegram, VK, WhatsApp, and the website.
- Answer languages: one to twenty language codes, for example
en, ru, pt-br. An answer in another language is rejected before sending. - Agent instruction: up to 12 000 characters describing the job, the limits, and what the agent must never do.
- Tone of voice: up to 160 characters.
- Maximum answer length: between 200 and 12 000 characters.
- Wording freedom and Confidence threshold: both 0 to 100%. Below the confidence threshold the agent does not answer on its own.
- Outside working hours: answer as usual, prepare a draft for an operator, or hand over. The behaviour needs an enabled support schedule.
- Draft mode: the answer is offered to an operator instead of being sent.
Qualification:
- Qualification goal: what the agent should find out.
- Required facts: up to 30 entries, each with a profile key (lowercase letters, digits, underscore) and the question to ask.
- After qualification is complete: continue the conversation or hand over.
- Stop phrases: up to 20 phrases of up to 160 characters. A phrase matches only when the customer's whole message equals it, ignoring case and extra spaces.
Knowledge and tools:
- Available sources: one to 200 knowledge sources. Operator-only and disabled sources cannot be selected.
- Allowed tools: at most eight. An active agent may use the calendar tools only; see Meetings and Google Calendar. Tools with side effects ask for confirmation by default.
Handoff and failures:
- Hand conversations to an operator with a target operator group and a message shown before a human joins.
- When the agent cannot help: hand over, send a fallback message, or fall back to the regular bot flow.
How one answer is produced
A turn moves through fixed states: accepted, searching knowledge, generating, optionally waiting for a tool, and then completed, fallback, handed over, or failed. Tool rounds are bounded (at most four), the same inbound message is processed once, and a long provider call keeps renewing its lease so a stalled worker cannot answer twice.
The context handed to the model is assembled by the server: the customer profile and approved properties, verified channels, a bounded window of recent messages and events, the current support and schedule state, and the retrieved excerpts. It is truncated and redacted before it leaves the platform.
Grounding is strict. Retrieval is limited to the sources selected for that
agent and returns at most 12 excerpts. If an agent has sources, no tools, and
nothing was retrieved, it does not improvise: it hands over or falls back with
the reason no_source. An answer that cites a source which was not retrieved
is rejected before sending.
The prompt-injection boundary
Text from customers and from indexed sources is data, never instructions:
- System policy and tool schemas are separate parts of the request; source and customer text can never replace them.
- The model never chooses a bot, a customer, a source, a URL, an SQL statement, a credential, or a raw HTTP parameter. Those come from the server context, and authority-looking fields in model output are stripped.
- A tool call is accepted only if the tool is registered, allowed by that agent's configuration, and its arguments match a closed schema that forbids unknown fields.
- Every effect gets an idempotency key derived from the turn and the position of the call, a 15-second deadline, and an audit record whose arguments and results are stored redacted.
- Before sending, the answer is checked for length, language, citations, and unsafe patterns, and unsupported markup is removed.
Facts and provenance
The agent may only write profile facts whose keys you listed under Required facts. Each stored fact keeps the message and the turn it came from and is recorded as proposed, applied, or rejected: so a value written by the agent can always be traced back to what the customer actually said.
Handoff and resume
A handoff opens or updates the ordinary support dialog, sets the target operator group, and appends a structured, redacted summary with the reason, the collected facts, the cited sources, and anything left unfinished. Reasons include a stop phrase, low confidence, no usable source, completed qualification, being outside working hours, and provider or tool failures.
While a conversation is handed over the agent stays silent. It only resumes
after an explicit request from the dialog
(POST /api/bots/{botID}/subscribers/{subscriberID}/ai/resume).
Checking before you launch
Agent check validates the configuration and runs a safe simulation: it does not call the model, does not send messages, and does not run tools or create bookings. It reports which actions were suppressed. Use Test retrieval to inspect the excerpts themselves.
The launch check refuses to activate an agent when the settings are invalid, when a channel is taken by another active agent or has no connection, when a selected source or the operator group is missing, when there is no AI integration, or when calendar tools have no enabled meeting type.
Analytics and quality review
AI → Analytics reports conversations, answers sent, fallbacks, handoffs, failures, operator drafts, reviewed and unsafe answers, latency, input and output tokens, cost per currency, source and tool usage, calendar actions, and business outcomes such as containment, goal completion, CSAT, reopens, and escalations. Filters cover the period, agent and version, channel, language, segment, source, and outcome, with day or hour buckets.
AI → Answer quality lists agent conversations. A conversation shows its state and the technical metrics of each answer: confidence, latency, tokens, cost: but not the message text; the bodies stay in the support dialog, which is one click away. Reviewers rate an answer Correct, Incorrect, or Unsafe with a reason code and an optional comment, and the evaluations can be exported. Both the review screen and the export are redacted.
Every turn records its input and output tokens and, where the provider reports it, its cost, so model spending is attributable per agent and per period.
Related pages
- Knowledge sources: what the agent may answer from.
- Meetings and Google Calendar: booking tools.
- Public help center: the same articles for self-service.
- Chats and Operators: where handoffs land.
- Actions: other reaction actions.
- Substitutions and formulas: variables in prompts.