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

# Agent

> An agent is a named, versioned definition of instructions, a model, tools, and remote agents.

`runtime.createAgent` registers a definition. The name and version identify that definition for later recovery. A missing version does not replay a run onto a different definition.

```typescript theme={null}
const agent = runtime.createAgent({
  name: "notes",
  version: 1,
  instructions: "Read the note and answer in one line.",
  model,
  tools: [readNotes],
});
```

`name` is the workflow name stored with the run. Keep it stable. Changing the version is how you stop an old run from replaying on a new definition.

## What belongs on the agent

* `instructions` are the local system guidance for the model.
* `model` implements `complete(request, context)`. Use `scriptedModel` in tests and examples. Use [Cactus](https://docs.larkx.ai/integrations/cactus.md) for on-device inference.
* `tools` are local functions. Each tool declares an effect class. See [Tool side effects](https://docs.larkx.ai/concepts/tool-side-effects.md).
* `remoteAgents` are optional. With none, the agent stays on the device. Registering a remote agent authorizes the runtime to send that tool's arguments to that endpoint.

The agent does not own the SQLite file. The runtime does. Create the agent again after a restart, with the same name and version, before `runtime.resume`.


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