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

# Architecture

> How the public SDK, the C++ runtime, and optional Cloud fit together.

```mermaid theme={"dark"}
flowchart LR
  app["Mobile application"] --> rn["@larkxai/react-native"]
  rn --> driver["Host driver"]
  driver --> core["C++ runtime"]
  core --> db["SQLite"]
  driver --> inference["Local model"]
  driver --> tools["Native tools"]
  driver --> remote["Remote agents"]
  remote --> http["HTTP"]
  remote --> a2a["A2A 1.0"]
  driver --> cloud["LarkX Cloud, optional"]
```

The C++ runtime owns orchestration, the SQLite record, replay, retries, operation ids, ownership, cancellation, unknown outcomes, reconciliation, and remote delegation state. The host driver performs the call the runtime asked for.

Local inference, native tools, and remote frameworks stay outside the core. Cloud does not own the local execution record.

## Public surface

React Native is the public SDK. The private workspace packages (`@larkxai/host`, `@larkxai/protocol`, `@larkxai/telemetry`, `@larkxai/cactus`, `@larkxai/node`) are how the repository is built. An application imports `@larkxai/react-native` only.

Swift and Kotlin SDKs are planned. `examples/swift-agent` is not that SDK.

## Engineering notes

Design notes stay in the git repository and are not part of this site's navigation. Read them on GitHub when you are changing the runtime:

* [Execution model](https://github.com/larkxai/larkx/blob/main/docs/architecture/execution-model.md)
* [Side effects](https://github.com/larkxai/larkx/blob/main/docs/architecture/side-effects.md)
* [Replay](https://github.com/larkxai/larkx/blob/main/docs/architecture/replay.md)
* [Remote delegation](https://github.com/larkxai/larkx/blob/main/docs/architecture/remote-delegation.md)
* [A2A](https://github.com/larkxai/larkx/blob/main/docs/architecture/a2a.md)
* [Telemetry](https://github.com/larkxai/larkx/blob/main/docs/architecture/telemetry.md)
* [Storage](https://github.com/larkxai/larkx/blob/main/docs/architecture/storage.md)
* [Mobile lifecycle](https://github.com/larkxai/larkx/blob/main/docs/architecture/mobile-lifecycle.md)

Device checklists live under `docs/validation/` in the same repository. A completed checklist is a phone run. This site does not mark that work done.


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