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

# Durable recovery

> A multi-step run whose committed tool calls survive a new process.

A multi-step agent is wrong if a crash runs a completed tool again, and also wrong if a tool that might have changed the world is silently retried. LarkX records the difference.

A model call that already committed is not sent again. A `pure` or `idempotent` tool that was in flight may retry. A `non-idempotent` tool that was in flight becomes an unknown outcome, and the run stays `BLOCKED` until the application reconciles it. External effects are not exactly-once.

## What you can run

The complete reopen snippet is [Crash recovery](https://docs.larkx.ai/concepts/crash-recovery.md). It uses the public `createRuntime`, `createAgent`, `listRuns`, and `resume` calls. The second runtime is a new `createRuntime` on the same `sqlite()` file. Node tests in this repository kill a process with `SIGKILL` and reopen the database. That is not a phone force-quit.

Use `effects: "non-idempotent"` for a tool that must not be guessed. The application then calls `run.reconcile` with `resolution: "retry"`, `"complete"`, or `"fail"`. The API is [Tools](https://docs.larkx.ai/api/tools.md) and [Run](https://docs.larkx.ai/api/run.md).

There is no separate recovery product and no customer deployment behind this page.


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