Overview

API reference for primitives, runtime hooks, and context providers.

Cloud

Runtime API

AI SDK

Data Stream

assistant-stream (Framework-Agnostic)

LangGraph

Local Runtime

External Store Runtime

Thread List Runtime

Runtime Adapters

Attachment

Feedback

Speech

Highest Level Context Providers

Assistant Context

The context available to components inside <AssistantRuntimeProvider />. You usually wrap your entire application in this context.

AssistantRuntime

Programmatically access the assistant's state and actions via useAui().

Instructions

Add system prompt instructions

Tool UI

Register tool UIs

Programmatically access the list of registered tool UIs via useAuiState((s) => s.tools) and useAui().tools().

ThreadListPrimitive

Shows a list of threads and allows the user to switch between them.

Thread Context

The context for a single thread. Currently always corresponds to the runtime's main thread.

ThreadRuntime

Programmatically access the thread's state and actions.

  • State: useAuiState((s) => s.thread)
  • Actions: useAui().thread()
  • Composer: useAuiState((s) => s.composer)

ModelContext

  • useAui().thread().getModelContext()

ThreadViewportStore

ThreadPrimitive

A conversation thread.

AssistantModalPrimitive

A floating modal that usually appears in the lower right corner of the screen. Common for support use cases.

MessagePart Context

Manages the state and actions for message parts within messages

MessagePartRuntime

  • State: useAuiState((s) => s.part)
  • Actions: useAui().part()

MessagePartPrimitive

MarkdownText

Attachment Context

Manages the state and actions for attachments in messages and composer

AttachmentRuntime

  • State: useAuiState((s) => s.attachment)
  • Actions: useAui().attachment()

AttachmentPrimitive

Utilities