useKivaAgentInfo
Fetches a Kiva AI agent's profile, suggestions and capabilities from the agent-deployment endpoint and maps them onto the KivaAgent props.
Installation
pnpm dlx @kivacore/ui-cli add @kivacore/rn-hooks-use-kiva-agent-infopnpm add @tanstack/react-queryA 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 KivaAgent. A QueryClientProvider must be mounted above it.
Usage
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 <KivaAgent agent={agent} suggestions={suggestions} capabilities={capabilities} />;
}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<void> | Refetch |
Query key: ['kiva-agent', 'info', deploymentId ?? 'base:<agentId>'] (same as web).
useKivaAgentChat
The complete streaming chat runtime for a Kiva AI agent — AI SDK transport, threads, attachment uploads and client-side tool execution — ready to drive KivaAgent.
useKivaAgentMemories
Backend glue for the KivaAgent memory manager — list, create, update and delete /v1/ai/memories with optimistic local state.