AI Agents
AI Agents are autonomous entities that reason, use tools, and maintain conversation memory to handle complex AI workflows.
Last updated
// Minimal agent
agent = aiAgent(
name: "Assistant",
description: "A helpful AI assistant",
instructions: "Be concise and friendly"
)
response = agent.run( "What is BoxLang?" )
println( response )// Full-featured agent (v3.0)
agent = aiAgent(
name : "SupportBot",
description : "Customer support specialist",
instructions : "Help customers with product questions",
model : aiModel( "openai" ),
tools : [ searchTool, ticketTool ],
memory : aiMemory( "cache" ),
skills : aiSkill( ".ai/skills" ),
availableSkills: aiSkill( ".ai/advanced-skills" ),
middleware : [ new LoggingMiddleware(), new RetryMiddleware() ],
mcpServers : [ { url: "http://tools-server/mcp", toolNames: ["search"] } ]
)
response = agent.run( "My order hasn't arrived" )