
# `useAIState`

<Note type="warning">
  AI SDK RSC is currently experimental. We recommend using [AI SDK
  UI](/docs/ai-sdk-ui/overview) for production. For guidance on migrating from
  RSC to UI, see our [migration guide](/docs/ai-sdk-rsc/migrating-to-ui).
</Note>

It is a hook that enables you to read and update the AI state. The AI state is shared globally between all `useAIState` hooks under the same `<AI/>` provider.

The AI state is intended to contain context and information shared with the AI model, such as system messages, function responses, and other relevant data.

## Import

<Snippet text={`import { useAIState } from "@ai-sdk/rsc"`} prompt={false} />

## API Signature

### Returns

A single element array where the first element is the current AI state.


## Navigation

- [streamUI](/v5/docs/reference/ai-sdk-rsc/stream-ui)
- [createAI](/v5/docs/reference/ai-sdk-rsc/create-ai)
- [createStreamableUI](/v5/docs/reference/ai-sdk-rsc/create-streamable-ui)
- [createStreamableValue](/v5/docs/reference/ai-sdk-rsc/create-streamable-value)
- [readStreamableValue](/v5/docs/reference/ai-sdk-rsc/read-streamable-value)
- [getAIState](/v5/docs/reference/ai-sdk-rsc/get-ai-state)
- [getMutableAIState](/v5/docs/reference/ai-sdk-rsc/get-mutable-ai-state)
- [useAIState](/v5/docs/reference/ai-sdk-rsc/use-ai-state)
- [useActions](/v5/docs/reference/ai-sdk-rsc/use-actions)
- [useUIState](/v5/docs/reference/ai-sdk-rsc/use-ui-state)
- [useStreamableValue](/v5/docs/reference/ai-sdk-rsc/use-streamable-value)
- [render (Removed)](/v5/docs/reference/ai-sdk-rsc/render)


[Full Sitemap](/sitemap.md)
