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

# Native setup

> Load the C++ runtime in a React Native development build.

```bash theme={"dark"}
npm install @larkxai/react-native expo-file-system
```

`expo-file-system` is a peer. `sqlite()` uses it to place `larkx.db` under the application documents directory.

The native module name is `LarkXNativeCore`. Expo autolinking, the podspec, and the Android package register it. After installing, create a new development build. Expo Go cannot load this module, and there is no JavaScript fallback.

If `createRuntime` throws `LarkXNativeCore is not installed`, the binary that is running was built without the native module. Rebuild the development client. Do not catch that error and substitute a JavaScript engine.

## iOS and Android

The published package contains the iOS project, the podspec, and the Android project. A normal Expo or React Native prebuild picks them up. You do not add a second copy of the C++ sources to the app.

The runtime rejects a SQLite file whose `application_id` is not `LXRT`. Create a new file for this SDK. Do not point it at a database from the removed TypeScript engine.

## Optional native pieces

Install `expo-crypto` only with [Cloud telemetry](https://docs.larkx.ai/cloud/connecting.md). Install `cactus-react-native@1.13.1` and `react-native-nitro-modules@0.33.9` or newer only with [Cactus](https://docs.larkx.ai/integrations/cactus.md).

Neither optional stack is loaded by the root import.


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