> ## 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_.

# Execution traces

> A Cloud trace is metadata about a run. It is not a copy of the model's transcript.

Each exported event keeps the native `eventId`, the per-run `sequence`, and the event type. Ordering is per run. There is no global order across devices.

Delivery is at-least-once for events that are still behind the cursor. The same `eventId` may arrive again after a crash. Collectors dedupe on `batchId` and on `(installationId, runId, sequence)`.

A trace can show that a run started, recovered, called a tool, delegated, blocked, or finished. The payload is the safe envelope from the journal. Step inputs and outputs are not read for export.

`telemetryStatus()` on the device reports whether the local exporter is caught up. It is not the Cloud dashboard. `exportBehind` is true when more than 2000 eligible events are still unsent. That is a lag signal, not a count of discarded events.

The Cloud product renders those accepted events. This SDK does not embed that UI. Open [cloud.larkx.ai](https://cloud.larkx.ai) for the project that owns the ingestion key.

Batches are at most 500 events and 256 KiB. One batch is one run.


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