agent

Creates an AI agent from a chat model, adding conversation memory, system messages, guardrails and tool calling. Use its chat() method to send messages.

agent(config) → returns any

This function requires Adobe ColdFusion 2025.0.8 and up.  Not supported on Lucee, etc.

Argument Reference

config struct
Required

Struct with a required chatModel key (from chatModel()), and optional keys such as tools (CFCs or MCP clients the model can call) and chatMemory.

Examples
Sample code invoking the agent function

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub