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

# Mobile assistant

> An illustrative on-device assistant. The runnable piece is the scripted personal-assistant demo.

A personal assistant that reads notes on the phone, calls a couple of tools, and should still be the same run after the app is killed. That is an on-device execution problem, not a one-shot completion.

Ordinary inference returns text and forgets which tool already changed local data. LarkX stores the model decision and the tool result, then resumes from that record.

## Capabilities

Local application data, native tools, more than one step, and offline execution. Cloud is not required.

## What you can run

`examples/react-native-agent` includes `NativeAgentDemo`. It is a scripted agent named `personal-assistant`. The tool `read_notes` is `pure`. The screen starts a run, closes the runtime, opens a new runtime on the same database, and resumes. The committed tool does not run again in that second process. The scripted replies are not inference.

There is no separate published assistant app, and this page does not describe a customer deployment.

Use the same shape in your app:

```typescript theme={"dark"}
import { createRuntime, defineTool, scriptedModel, sqlite } from "@larkxai/react-native";

const runtime = await createRuntime({ storage: sqlite() });
const agent = runtime.createAgent({
  name: "personal-assistant",
  version: 1,
  instructions: "Help the user manage daily tasks.",
  model: scriptedModel([{ message: "Summary: Example note", finish: "stop", calls: [] }]),
  tools: [
    defineTool({
      name: "read_notes",
      description: "Read locally stored notes",
      effects: "pure",
      schema: { type: "object", properties: {} },
      handler: () => ({ notes: ["Example note"] }),
    }),
  ],
});
const run = await agent.start({ message: "Summarize my notes" });
console.log((await run.result()).message);
```

Replace `scriptedModel` with [Cactus](https://docs.larkx.ai/getting-started/on-device-agent.md) when the summary should come from a local model. Follow [Hello World](https://docs.larkx.ai/getting-started/hello-world.md) first if the development build is not running yet.


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