The agent file

Identity, instructions, model, profile image, and canvas on a Lunnoa agent JSON file.

An agent you want to edit in the UI and in git lives in lunnoa/agents/<slug>.json. The prompt lives beside it in <slug>.instructions.md. pull writes both. push sends them and rewrites the JSON to the definition Lunnoa stored.

A TypeScript defineAgent is a smaller surface: slug, name, description, model, instructions, AI connection, app connections, and tools. It does not write the fields on this page. Use the JSON file for those. See Agents for deploy and chat, and Sync with the UI for pull and push.

The schema is node_modules/@lunnoa/client/schemas/agent.schema.json. Required keys are kind (agent), slug, name, and instructions.

Identity

FieldRules
slugLowercase letters, digits, and hyphens. Unique in the workspace. This is the upsert key. Max 100 characters.
nameLabel people see. Max 100 characters.
descriptionOptional. Max 1000 characters. Leaving it out of a later push clears it.
kindAlways agent.
lunnoa/agents/support-triage.json
{
  "$schema": "../../node_modules/@lunnoa/client/schemas/agent.schema.json",
  "kind": "agent",
  "slug": "support-triage",
  "name": "Support triage",
  "description": "Sorts inbound support mail.",
  "model": "deepseek-ai/DeepSeek-V4-Pro",
  "instructions": { "file": "support-triage.instructions.md" }
}

Instructions

instructions is a string, or { "file": "<slug>.instructions.md" }. pull always writes the markdown file and the file pointer. The CLI reads the markdown on push. App code that calls defineAgent on the JSON leaves { "file" } as that object. It does not read the markdown.

Model

model is a models[].id from npx @lunnoa/client ai-connections list --json.

aiConnection is { "id": "<uuid>" } for the connection that accepts that model. Leaving it out stores no connection. Do not copy a connection id into another deployment.

Leaving model out of a later push clears it, and the agent cannot chat. Credentials for the connection stay in Lunnoa.

Profile image

profileImageUrl is a public URL, at most 255 characters.

In the fileWhat push does
A URLSets the image.
nullClears it on an agent that already exists. A new agent still gets a default face.
Key omittedLeaves the stored image.

pull writes the URL when one is set, and omits the key when it is not.

Canvas

canvas is the agent builder layout: { "<node id>": { "x": 0, "y": 0 } }. At most 250 nodes. Each id is at most 128 characters.

In the fileWhat push does
An objectReplaces the saved positions.
nullClears them.
Key omittedLeaves the saved positions.

pull writes canvas when positions exist, and omits it when they do not. Workflow node positions are separate. A workflow push keeps the position of a step it matches by key. See Sync with the UI.

What stays out of this file

These are real parts of an agent, and they have a home. That home is not a copy of a secret or of the sync hash inside agents/<slug>.json.

You want to setWhere it is written
Connection secrets, API keys, tokensThe connection record in Lunnoa. The file holds the connection id.
A password on a public linkLunnoa. The file can say passwordProtected: true. false clears the password. The password string is never written.
The public link tokenMinted on the server when publicShare is created. Read it in the UI. pull does not write it. null removes the link.
codeSourceSet by the command. push sets synced. agents deploy on a TypeScript file sets generated.
Sync revisionlunnoa/lunnoa.lock.json, per deployment. It is a hash of the definition. Putting it inside the definition would change the hash.
A schedule, webhook, or app eventA workflow file. Agents have no trigger.
Memory factsLunnoa. The policy (memoryEnabled, scope, retention) is in Runtime settings.

A trigger belongs on a workflow

Create a workflow whose trigger is the schedule, webhook, or app event, and add a Message Agent step (agents_action_message-agent) that points at this agent's id. pull and push already round-trip that workflow file. See Define locally and Triggers.

Revision and code source belong in the lock

lunnoa.lock.json stores id, revision, and fileHash for this deployment. pull and push update it. Commit it with the JSON. Do not add codeSource or revision to the agent file.

Related