Skip to content

Build

Instructions and context

Keep the rules stable and give each task the information it actually needs.

What a call receives

InformationWhen it is included
InstructionsEvery operation
Reference texts added under ContextEvery operation, in full
Named data from context.set()Always, or only when explicitly selected
Saved notes from memory.add()Every operation in their data scope
Knowledge passagesOnly when the operation requests a search
Operation inputThat request only

Write the job in Instructions

Use Settings in the dashboard to describe the agent’s role and how it should handle missing information. Put changing facts and policies in Context so you can manage them separately.

Instructions
Read incoming shop requests.
Extract only facts supported by the message and supplied order data.
Use null for information that is missing.

Add a short reference text

Under Context, choose Add context and write a title and text. A returns policy, product glossary or short checklist belongs here. Reference texts are included automatically and in full.

Include application data deliberately

JavaScript
await agent.context.set('shop', { currency: 'EUR' });

await agent.context.set('order', {
  id: 42,
  delivered: true
}, { inclusion: 'selected' });

const result = await agent.extract(
  'Read the order ID and currency from the supplied data.',
  { orderId: 'number', currency: 'string' },
  { contextKeys: ['order'] }
);

always is the default. A selected entry is included only when its key is in contextKeys. Use get(key), list() and delete(key) to manage values. These snippets assume you have loaded an agent.

Use JSON values and predictable keys

Saved keys start with a lowercase letter and contain up to 64 lowercase letters, digits, dots, underscores or hyphens, such as order_id. JSON null is a stored value. Delete an entry explicitly when you want to remove it.

Share common rules, override specific data

Data can belong to the Space, the agent or an application-chosen data scope. Under the same context key or reference-text name, the narrower scope replaces the broader one: Space → agent → selected scope.

JavaScript
await agent.space.set('shop', { currency: 'EUR', returnDays: 30 });
await agent.context.set('shop', { currency: 'GBP', returnDays: 14 });