DocsReact CorehooksAgentProvider
Package: @hexos/react-core

Provider component that initializes the Jotai atom store and sets up agent configuration.

Creates an isolated Jotai Provider scope so that multiple AgentProvider instances on the same page maintain independent state. Internally uses AgentConfigSetter to hydrate agentConfigAtom and conversationIdAtom from the provided config.

Wrap your chat UI or application root with this provider to enable all Hexos hooks.

Related: useAgent reads the config from atoms, AgentConfig defines connection options, ChatWindow is typically a direct child.

Example

<AgentProvider config={{
  endpoint: '/api/agent/chat',
  agents: ['main', 'code', 'research'],
  transport: 'sse',
}}>
  <ChatInterface />
</AgentProvider>
function AgentProvider(props: AgentProviderProps): React.ReactElement

Parameters

props