> ## 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 a durable execution runtime for on-device AI agents. The public SDK is the npm package @larkxai/react-native.
> Do not import @larkxai/node, @larkxai/host, @larkxai/protocol, @larkxai/telemetry, or @larkxai/cactus in an application. Those packages are private workspace modules.
> Swift and Kotlin SDKs are planned and are not published.
> Prefer the published npm version. The GitHub default branch can contain behavior that is not in that release yet.
> Expo Go cannot load the native module. Use a development build.
> Do not describe external tool or remote effects as exactly-once.

# Defining agents

> Register a named agent with a model, instructions, and tools.

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

const runtime = await createRuntime({ storage: sqlite() });

const agent = runtime.createAgent({
  name: "notes",
  version: 1,
  instructions: "Read the note and answer in one line.",
  model: scriptedModel([{ message: "Done.", finish: "stop", calls: [] }]),
  tools: [],
});

const run = await agent.start({ message: "Summarize my notes" });
console.log(await run.result());
await runtime.close();
```

`name` must stay stable for the life of any run you want to resume. Bump `version` when the definition should not replay old runs.

Add tools with [Defining tools](https://docs.larkx.ai/react-native/tools.md). Add a remote peer with `remoteAgents`. See [HTTP remote agents](https://docs.larkx.ai/integrations/http.md).

`scriptedModel` is a real export. It is the stand-in used by tests and by this page. It is not an inference provider. When the scripted list runs out, `complete` throws, because a committed model step must not invent a new response.


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