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

# Troubleshooting

> Cloud errors stay in the exporter. They do not fail the agent.

`runtime.telemetryStatus()` and the value returned by `flushTelemetry()` use `lastError`.

| `lastError` | What to do |
| - | - |
| `unauthorized` | The key was rejected or does not start with `lkx_ing_`. Fix the key, then call `flushTelemetry()`. |
| `rate_limited` | The organization is over the temporary request or event limit. Wait for the backoff. HTTP 429 is also what Cloud returns today for the permanent per-run event cap, so a 429 is not treated as a dead run. |
| `rejected` | One run was refused. Other runs can still export. On npm 0.4.0 the destination may hold until a manual flush. On the current default branch, `flushTelemetry()` retries `quota_exceeded` only. A history conflict stays rejected. |
| `offline` | The batch is still local. Execution is unaffected. |
| `redirected` | The collector returned a 3xx. The exporter does not follow it. |
| `unsupported` | The response was not one this client will treat as success or as a named run rejection. The batch is not marked delivered. |

`rejectedRuns` on the status is the count of runs the exporter is skipping, not a list of Cloud dashboard ids.

## The agent still runs

None of these statuses throw out of a tool or a model call. If a run is `BLOCKED`, that is the local runtime waiting for `reconcile` or for a remote condition. It is not a Cloud error. See [Tool side effects](https://docs.larkx.ai/concepts/tool-side-effects.md).

## Production schema

If every batch is rejected with an unrecognized payload and the key is valid, compare the deployed Cloud schema with telemetry version 1. This repository records that production on 20 November 2026 still accepted an older schema. Do not point a production app at a collector you have not tried with the installed SDK.


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