# useKivaAgentInfo URL: /docs/native/hooks/use-kiva-agent-info Fetches a Kiva AI agent's profile, suggestions and capabilities from the agent-deployment endpoint and maps them onto the KivaAgent props. ## Installation ```bash pnpm dlx @kivacore/ui-cli add @kivacore/rn-hooks-use-kiva-agent-info ``` **Dependencies:** - [@tanstack/react-query](https://www.npmjs.com/package/@tanstack/react-query) A verbatim port of the web hook. It reads `GET /v1/ai/agent-deployments/base/{agentId}` (or `/v1/ai/agent-deployments/{deploymentId}`) and returns an `AgentProfile` (name, description, welcome message, avatar), the agent's standard suggestions, and its feature capabilities, ready to spread onto [rn-kiva-agent](/docs/native/kiva/kiva-agent). A `QueryClientProvider` must be mounted above it. ## Usage ```tsx import { KivaAgent } from '@/components/kiva-native/kiva-agent'; import { useKivaAgentInfo } from '@/hooks/kiva-native/use-kiva-agent-info'; function Assistant({ client }) { const { agent, suggestions, capabilities } = useKivaAgentInfo({ client, agentId: AGENT_ID }); if (!agent) return null; return ; } ``` ## API Reference ### UseKivaAgentInfoArgs | Option | Type | Default | Description | |--------|------|---------|-------------| | `client` | `KivaAgentInfoClient \| null \| undefined` | - | Client with a `get(url, params?)` method (e.g. `RestApiClient`) | | `agentId` | `string \| null` | `null` | Tenant AI agent ID (base deployment) | | `deploymentId` | `string \| null` | `null` | Read a specific deployment instead of the base record | | `enabled` | `boolean` | `!!client && (agentId \|\| deploymentId)` | Toggle the query | ### UseKivaAgentInfoResult | Field | Type | Description | |-------|------|-------------| | `agent` | `AgentProfile \| null` | Mapped profile, `null` until loaded | | `suggestions` | `string[]` | `standardSuggestions` of the agent | | `capabilities` | `AgentCapabilities` | `supportFiles`, `supportWebSearch`, `supportDocumentSearch` (backend `documentSearch`), `supportThinking`, `supportDeepResearch`, `supportWorkCanvas` (backend `featureWorks`), `supportMultipleModels`, `promptOptimizationChoice` | | `raw` | `KivaAgentDeploymentEnvelope \| null` | Raw deployment payload | | `isLoading` | `boolean` | Query loading flag | | `error` | `Error \| null` | Query error | | `refresh` | `() => Promise` | Refetch | Query key: `['kiva-agent', 'info', deploymentId ?? 'base:']` (same as web).