Cortex · Prompt and contextRun producers (
Run producers (producers)
producers in a run’s options adds producers after the agent’s own context. An app gives every agent the same facts this way, such as who is asking and what day it is, without changing their definitions.
const asking = ['The member asking is Grace.', 'Today is Friday 2026-10-23.'];
const desk = defineAgent({ id: 'desk', instructions: '…', context: ['Doors open thirty minutes before the show.'] });
const clerk = defineAgent({ id: 'clerk', instructions: '…' });
await desk.preview('Two seats tomorrow, please.', { llm, producers: asking });
await clerk.preview('Two seats tomorrow, please.', { llm, producers: asking });{
desk: [
'system Doors open thirty minutes before the show.',
'system The member asking is Grace.',
'system Today is Friday 2026-10-23.',
'user Two seats tomorrow, please.',
],
clerk: [
'system The member asking is Grace.',
'system Today is Friday 2026-10-23.',
'user Two seats tomorrow, please.',
],
}Runs in this page on the installed package. The input and the expected output are defined by the example.