Instructions and context
Keep the rules stable and give each task the information it actually needs.
What a call receives
| Information | When it is included |
|---|---|
| Instructions | Every operation |
| Reference texts added under Context | Every 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 passages | Only when the operation requests a search |
| Operation input | That 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.
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
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.