> ## Documentation Index
> Fetch the complete documentation index at: https://docs.larkx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> LarkX is open-source execution infrastructure for on-device AI agents. It is not an inference engine, an LLM wrapper, a cloud-only agent framework, or a replacement for LangGraph or Cactus.
> Install the public SDK with npm install @larkxai/react-native. The published version is the sdkVersion variable on the Installation page. Import createRuntime, defineTool, scriptedModel, sqlite, remoteAgent, and larkxCloud from @larkxai/react-native. Import cactusModel from @larkxai/react-native/cactus only when the app uses local inference.
> Do not import @larkxai/node, @larkxai/host, @larkxai/protocol, @larkxai/telemetry, or @larkxai/cactus. Those packages are private. Swift and Kotlin SDKs are not published.
> Hello World uses scriptedModel and does not download a model or need Cloud. A Cactus agent needs cactus-react-native 1.13.1, react-native-nitro-modules 0.33.9 or newer, download(), and init() before start. Expo Go cannot load the native module.
> Recovery opens a new createRuntime on the same SQLite file, registers the same agent name and version, then calls resume. Do not call resume on a runtime that has already been closed. Do not describe external effects as exactly-once. A killed process does not keep running.
> Cloud telemetry is optional. Pass larkxCloud({ projectId, apiKey }) only after a local run already works. The key must start with lkx_ing_.

# Remote agents

> remoteAgent for HTTP and A2A transports.

```typescript theme={"dark"}
import { remoteAgent, A2A_PROTOCOL_VERSION, A2A_REMOTE_CAPABILITIES } from "@larkxai/react-native";
```

`A2A_PROTOCOL_VERSION` is the only A2A version the client accepts. `A2A_REMOTE_CAPABILITIES` is the capability set A2A uses. It does not enable HTTP dedupe or lookup.

## `remoteAgent`

| Field | Required | Meaning |
| - | - | - |
| `name` | Yes | `^[a-z][a-z0-9-]{0,63}$` |
| `description` | Yes | Non-empty. |
| `schema` | No | Object schema for the delegated input. Defaults to an open object. |
| `transport` | Yes | `http` or `a2a`. |

### HTTP transport

| Field | Meaning |
| - | - |
| `type` | `"http"` |
| `endpoint` | `http` or `https` URL. No userinfo, query, or fragment. |
| `capabilities` | Declare only what the peer implements. |
| `headers` | `(endpoint) => headers`. The result is not written to the execution database. |
| `timeoutMs` | 1 to 120000. Default 15000. |
| `pollIntervalMs` | Omit for 1000 ms. 50 to 60000 chooses an interval. `0` selects the default. |

HTTP capabilities are `dedupe`, `lookup`, `taskId`, `poll`, `cancel`, and `persistent`.

### A2A transport

| Field | Meaning |
| - | - |
| `type` | `"a2a"` |
| `endpoint` | The authorized JSON-RPC endpoint. An agent card cannot replace it. |
| `protocolVersion` | Optional. Must equal `A2A_PROTOCOL_VERSION` when set. |
| `headers` | `(endpoint) => headers`, for authentication. Not `provideInput`. |
| `discover` | When true, fetch the agent card before the first submission. Its JSON-RPC interface must be this endpoint. |
| `timeoutMs` | Same bounds as HTTP. |
| `pollIntervalMs` | Same bounds as HTTP. |

Register the returned object on `createAgent({ remoteAgents })`. The default with an empty list is device-only.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.