# AssistantRuntime URL: /docs/api-reference/runtimes/assistant-runtime Root runtime for managing threads, tool UIs, and assistant state. The `AssistantRuntime` is the root runtime of the application. `useAui` \[#useaui] Access the assistant runtime via `useAui`: ```tsx import { useAui } from "@assistant-ui/react"; const aui = useAui(); // Thread management aui.threads().switchToNewThread(); aui.threads().switchToThread(threadId); // Thread actions aui.thread().cancelRun(); aui.thread().append(message); ``` Tool UI Registry \[#tool-ui-registry] The tool UI registry is part of the assistant runtime. It allows you to display custom UI for tool calls, enabling generative UI.