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

# When to use LarkX

> Use LarkX when an on-device agent has several steps that must survive interruption.

LarkX is execution infrastructure for an agent that already has a model and tools. It decides the next model call, tool call, or remote delegation, and it stores that progress on the device.

## Use LarkX when

* The agent makes more than one model or tool call.
* The application has to keep working when connectivity is unreliable.
* The agent reads or writes data that already lives on the device.
* Closing or killing the app must not run a completed operation again.
* One agent on the device coordinates local tools and a remote specialist.
* You want a trace of that behavior across devices, after the local run already works.

## You can skip it when

* The task is one text generation and the answer is not stored as a resumable run.
* You only need to call a local or hosted model, with no durable tool sequence.
* The whole workload runs on a server and never executes on a device.

A server framework such as LangGraph can still be the remote specialist. Cactus, or another model you adapt, can still be the local inference engine. LarkX does not replace either one. It keeps the on-device run.

> [card] [Hello World](https://docs.larkx.ai/getting-started/hello-world.md)
>
> Prove the runtime with a scripted model.

> [card] [On-device agent](https://docs.larkx.ai/getting-started/on-device-agent.md)
>
> Run the supported local model and a real tool.


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