Skip to content

Core Concepts

Read this after Getting Started and before Core API Flow. It explains the objects behind the operation names.

Wetel is a hosted runtime, not a library. You do not write a loop that calls a model, keeps the message history and dispatches tool calls. You configure an agent and its workflow (through the GraphQL API or the dashboard’s workflow editor, which uses the same API), and Wetel calls the model, keeps the state, runs the workflow and streams the result back as events.

Your client code (sdkStart, sdkSendMessage, the <vai-avatar> component or your own UI) only opens a session and passes messages in. None of the agent’s decisions happen there, so you can swap the frontend, or embed one agent in several products, without changing how it behaves.

A workspace is the isolation boundary; the API calls it a tenant (Tenant, tenantId). Agents, workflows, knowledge bases, sessions, users and API keys each belong to exactly one workspace, and no request can see or change another workspace’s data. Multi-Tenancy covers the rules and how to serve several customers of your own.

An agent holds a persona (personaPrompt), optional voice, avatar and model settings, and a workflowId pointing at the workflow that drives it. An agent without a workflow answers every message directly from its persona. An agent with a workflow does whatever the workflow says, and the workflow’s llm nodes carry their own prompts. See Configuring an Agent.

A workflow is a directed graph of typed nodes joined by edges. Each node does one thing: call the model, branch on a value, call a tool or your API, send a reply, wait for an answer, end the session. Edges decide which node runs next. The node types are listed in Workflows Overview, with one page per type under Nodes.

A workflow runs only after you publish it; edits go to a draft until the next publish, and every publish records a version.

A session is one conversation between someone and an agent. You start one with sdkStart (API key, for your product) or startSession (dashboard login). Channel connectors and runWorkflowTask start sessions too. A session runs the agent’s published workflow once per incoming message, with its own state.

Each message runs the workflow graph from its start, and one pass can run several nodes: classify the intent with an llm node, branch with a router, call your system with a tool, answer with a response. Because that takes seconds and may produce more than one reply, sdkSendMessage only acknowledges the message. The replies, and progress such as NodeExecutingEvent, arrive on the sessionEvents subscription; AiResponseEvent.turnComplete tells you when the turn is over. See Events and Subscriptions.

How a workflow keeps state from one message to the next (variables, await_reply, turnCount) is in How continuity between turns actually works.

flowchart TD
T[Workspace] --> A[Agent: persona and settings]
T --> W[Workflow: nodes and edges]
A -->|workflowId| W
A -->|sdkStart| S[Session: one conversation]
W -.runs once per message in.-> S
C[Client: your UI or vai-avatar] -->|sdkSendMessage| S
S -->|sessionEvents| C

A workspace owns agents and workflows; an agent points at its workflow; a session runs that workflow for each message, and the client sends messages and receives events without touching the logic.