Reference

Agent chat

The streaming chat client: threads, messages, and assistant responses.
import { createAgentChatClient } from '@mindstudio-ai/interface';

An agent interface is the app's own model, with the app's methods as tools, talking to a user in a thread as that signed-in user. This namespace is the client side of that conversation: createAgentChatClient returns a stateless client, a thin wrapper over the platform's chat endpoints. The app owns the thread list, the message array, and the UI; the client only moves messages and events across the wire.

Threads are the unit of persistence: create one, list and open its history, rename or delete it. sendMessage posts a turn and streams the reply, delivering the agent's text as it arrives, its thinking, and its tool activity through named callbacks, with onEvent exposing the raw AgentChatEvent for anything lower level. Two other patterns matter here: a client tool lets the agent run an action in the browser, and claimThread keeps a thread started anonymously once the user signs in. The agent's own persona and toolset are authored on the agent interface, not here; this is only what the screen calls into.

15 entries
Methods 8
Types 7