Skip to content

Three agent patterns ​

Start with these runnable examples in the repository. Each includes exact commands, expected output, and troubleshooting.

PatternWhat you learnProvider key
Prompt chainRequired inputs, intermediate variables, structured final outputOptional in demo mode
Tool agentTool lifecycle events, classified read failure, model-directed retryOptional in demo mode
ApprovalDurable suspension and resume in a fresh processNone

From a source checkout:

sh
npm ci
npm run build
node examples/patterns/prompt-chain.mjs --demo
node examples/patterns/tool-agent.mjs --demo
node examples/patterns/approval.mjs
node examples/patterns/approval.mjs --approve

The demos substitute model responses while using the real runtime, tools, and stores. To run the prompt chain or tool agent against OpenAI, set OPENAI_API_KEY and omit --demo.

Next, use embedding to customize the host or the quickstart to write your own YAML agent.