AI
AI Chat / Assistant
Streaming chat architecture, MCP tool access, and what the assistant can see and do.
What it is
The assistant is a single conversational surface, backed by one shared AI agent, that is reused across several parts of the product under different agent profiles — the default assistant, the AI Content Studio, and AI Buyer Discovery all run through the same conversation engine, distinguished only by which agent profile and tools are active on a given conversation. A conversation is a ChatConversation row carrying a agent_name, a JSON context bucket, and its own message history.
How streaming works
A message posts to a single streaming endpoint, which authenticates the request, checks and consumes one AI credit for the organization, then creates (or reuses) the conversation and writes a user message plus an empty, still-streaming assistant message under a row lock — deriving the next message position from the actual rows rather than a cached counter, so two messages sent to the same conversation at once can never collide. The response streams back as a sequence of events: token chunks of the reply, tool_call / tool_result pairs whenever the assistant uses a tool, and a final save once the turn ends.
Server-Sent Events, not a socket
The stream is plain HTTP — the client opens a POST request and reads it as it arrives — rather than a persistent two-way connection. There is no "approval required" pause in this stream either: once a turn starts, it runs to completion or to an error event.- 1
Every tool call is logged
Each tool the assistant uses is recorded as its own row — the tool name, its input, its output, whether it succeeded, and how long it took — so a conversation’s full transcript (messages plus every tool call and result, correctly interleaved) can be replayed later. - 2
Internal ids are scrubbed from replies
Every chunk of the assistant’s own free-text reply is filtered before it reaches you, so a raw internal record id is never written into a chat bubble. Arguments and results inside a tool call are left untouched — they’re expected to carry real ids. - 3
Context is loaded once per turn, not per token
Pinned items and the active agent profile’s run parameters are read from the database once, at the start of the turn, and handed to the agent as in-memory context — the database is never touched again for the rest of that streaming response.
Pins, tools and what it can see
You can pin things — products, audiences, and other records — to a conversation; pins persist for the conversation’s whole life and are loaded into every turn, so the assistant does not lose track of what you’re working on between messages. The default profile’s own tools include reading and writing the posts/emails being composed in the conversation (see the AI Content Studio doc), looking up the brand’s voice and kit, and loading a named skill on demand. A conversation running under a different agent profile — Buyer Discovery, for example — gets that profile’s own tools instead, on top of the shared base set; profiles cannot see each other’s tools.
MCP tool access
Beyond its built-in tools, the assistant can reach external capabilities exposed as MCP (Model Context Protocol) servers, connected over the Streamable HTTP transport. Today that is a web-search gateway (an AWS Bedrock AgentCore Gateway, request-signed with AWS SigV4), enabled per environment — when it’s on, the assistant can search the web as part of answering a question; when it’s off, it simply doesn’t have that tool available.
Non-obvious rules
An AI credit is consumed before anything is written to the conversation or streamed back — running out of credits fails the request up front rather than mid-reply. A conversation with no messages yet (for example, one opened but never used) is not shown in your conversation history, so opening the assistant never clutters that list with empty entries. If a turn fails partway through, whatever the assistant had already said is still saved to the transcript — nothing you can see on screen is silently lost.
Related
New to the assistant? Start with the AI Assistant guide. For the mode that turns this same conversation into on-brand posts and emails, see AI Content Studio.