# BoxLang AI

## BoxLang AI - v3.x

- [Introduction](https://ai.ortusbooks.com/introduction.md): BoxLang AI is the module for building AI into your applications with one fluent API for chat, agents, tools, memory, RAG, MCP, and enterprise governance.
- [Release History](https://ai.ortusbooks.com/introduction/release-history.md): All the major information about BoxLang AI Releases
- [3.8.0](https://ai.ortusbooks.com/introduction/release-history/3.8.0.md): BoxLang AI Module 3.8.0 (unreleased). OAuth sign in for MCP servers, one account or one per person, and gateway turns keyed by user and conversation.
- [3.7.0](https://ai.ortusbooks.com/introduction/release-history/3.7.0.md): BoxLang AI Module 3.7.0 (unreleased). Named configuration profiles, embeddings defaults, and a Mistral speech fix.
- [3.6.0](https://ai.ortusbooks.com/introduction/release-history/3.6.0.md): BoxLang AI Module 3.6.0. Cartesia provider, streaming text-to-speech with aiSpeakStream(), Cloudflare Workers AI provider, MariaDB vector memory, an MCP client for servers that run as a child process
- [3.5.0](https://ai.ortusbooks.com/introduction/release-history/3.5.0.md): BoxLang AI Module 3.5.0. A transport-agnostic gateway processing API, webhook verification handshakes, and a new minimum BoxLang runtime of 1.14.0.
- [3.4.0](https://ai.ortusbooks.com/introduction/release-history/3.4.0.md): BoxLang AI Module 3.4.0 — normalized reasoning, Gateway Sessions, agent run control, full AWS Bedrock parity, Gateway SPI, extracted HITL subsystem with durable approval grants, batched tool-call appr
- [3.3.2](https://ai.ortusbooks.com/introduction/release-history/3.3.2.md): BoxLang AI Module 3.3.2 — Fix for Claude structured output via a synthetic tool-forcing workaround.
- [3.3.1](https://ai.ortusbooks.com/introduction/release-history/3.3.1.md): BoxLang AI Module 3.3.1 — Fix for @AITool annotation scanning generating incorrect parameter schemas.
- [3.3.0](https://ai.ortusbooks.com/introduction/release-history/3.3.0.md): BoxLang AI Module 3.3.0 — Bedrock tool-use support for Claude models, MCP CORS fix, and housekeeping.
- [3.2.0](https://ai.ortusbooks.com/introduction/release-history/3.2.0.md): BoxLang AI Module 3.2.0 — Image Generation, Web Search, Fluent Audio Builders, Agent Registry, MCP Observability & more.
- [3.1.0](https://ai.ortusbooks.com/introduction/release-history/3.1.0.md): BoxLang AI Module 3.1.0 — Audio, Async, Parallel Pipelines, and more.
- [3.0.0](https://ai.ortusbooks.com/introduction/release-history/3.0.0.md): BoxLang AI Module v3.0.0 — a major update introducing the new AI Skills system, MCP server seeding, tool registry, provider capability system, agent hierarchy, middleware support, and more.
- [2.4.0](https://ai.ortusbooks.com/introduction/release-history/2.4.0.md): BoxLang AI Module v2.4.0 Release Notes - MiniMax AI Provider, Configuration Security, and Stability Fixes
- [2.3.0](https://ai.ortusbooks.com/introduction/release-history/2.3.0.md): BoxLang AI Module v2.3.0 Release Notes - Pipeline System Variables, Enhanced Transformers, and Tool Calling Improvements
- [2.2.0](https://ai.ortusbooks.com/introduction/release-history/2.2.0.md): BoxLang AI Module v2.2.0 Release Notes - Enhanced Performance Monitoring, Configuration Consolidation, and Bug Fixes
- [2.1.0](https://ai.ortusbooks.com/introduction/release-history/2.1.0.md): BoxLang AI Module v2.1.0 Release Notes - Multi-Tenant Tracking, OpenSearch Vector Memory, Bedrock Streaming, and Provider Configuration
- [2.0.0](https://ai.ortusbooks.com/introduction/release-history/2.0.0.md): BoxLang AI Module v2.0.0 Release Notes - Document Loaders, MCP Security, Multiple Provider Support, and Embeddings
- [1.0.0](https://ai.ortusbooks.com/introduction/release-history/1.0.0.md): March 2025
- [FAQ](https://ai.ortusbooks.com/introduction/faq.md): Frequently asked questions about BoxLang AI - answers to common questions about costs, providers, performance, and usage.
- [Overview](https://ai.ortusbooks.com/getting-started/getting-started.md): Build AI-powered applications and autonomous agents on the JVM with one unified API for OpenAI, Claude, Gemini, Ollama, and more.
- [installation](https://ai.ortusbooks.com/getting-started/installation.md): Install the BoxLang AI module and make your first call.
- [Provider Setup & Configuration](https://ai.ortusbooks.com/getting-started/installation/provider-setup.md): Comprehensive guide to configuring AI providers in BoxLang AI - from API keys to local deployment with Ollama.
- [Configuration](https://ai.ortusbooks.com/getting-started/configuration.md): The bx-ai settings you will actually use, on one page.
- [Quick Start Guide](https://ai.ortusbooks.com/getting-started/quickstart.md): Complete quick start guide for BoxLang AI - from basic chatting to advanced agents, RAG, and pipelines.
- [Key Concepts](https://ai.ortusbooks.com/getting-started/concepts.md): Essential concepts and terminology for understanding BoxLang AI - your guide to AI, embeddings, RAG, and more.
- [Overview](https://ai.ortusbooks.com/main-components/main-components.md): Core building blocks for AI agents and pipelines in BoxLang - your guide to mastering AI development
- [Chatting](https://ai.ortusbooks.com/main-components/chatting.md): Learn how to use the productive BoxLang AI chatting features for building conversational AI applications with ease.
- [Basic Chatting](https://ai.ortusbooks.com/main-components/chatting/basic-chatting.md): Learn the fundamentals of interacting with AI using simple, straightforward chat requests.
- [Advanced Chatting](https://ai.ortusbooks.com/main-components/chatting/advanced-chatting.md): Master advanced AI interaction techniques including multi-turn conversations, AI tools, async operations, and streaming responses.
- [Service-Level Chatting](https://ai.ortusbooks.com/main-components/chatting/service-chatting.md): Take full control of AI interactions with service-level chatting in BoxLang, ideal for advanced use cases requiring custom configurations and multiple providers.
- [Structured Output](https://ai.ortusbooks.com/main-components/chatting/structured-output.md): Get type-safe, validated responses from AI using BoxLang classes, struct templates, or JSON schemas. Eliminate manual parsing with automatic data extraction.
- [Profiles](https://ai.ortusbooks.com/main-components/profiles.md): Name a provider, model, params and key once, then select it by name.
- [AI Skills](https://ai.ortusbooks.com/main-components/skills.md): Skills are reusable markdown instruction files that can be injected into agent context automatically or loaded on demand.
- [AI Tools](https://ai.ortusbooks.com/main-components/tools.md): Create AI tools that enable function calling, letting AI models access real-time data, perform calculations, and interact with your systems.
- [Tool Registry](https://ai.ortusbooks.com/main-components/tool-registry.md): A centralized registry for discovering, registering, and resolving AI tools across modules and classes.
- [Middleware](https://ai.ortusbooks.com/main-components/middleware.md): Middleware overview and navigation hub for all built-in middleware classes
- [LoggingMiddleware](https://ai.ortusbooks.com/main-components/middleware/logging.md): Audit lifecycle events with configurable file and console logging
- [RetryMiddleware](https://ai.ortusbooks.com/main-components/middleware/retry.md): Retry failed LLM and tool calls with exponential backoff controls
- [GuardrailMiddleware](https://ai.ortusbooks.com/main-components/middleware/guardrail.md): Block or reject tool invocations by tool name and argument regex policies
- [MaxToolCallsMiddleware](https://ai.ortusbooks.com/main-components/middleware/max-tool-calls.md): Enforce a strict per-run cap on tool calls to prevent runaway loops
- [HumanInTheLoopMiddleware](https://ai.ortusbooks.com/main-components/middleware/human-in-the-loop.md): Approve, reject, edit, defer, and suspend tool calls with policy- and gateway-driven human approval
- [FlightRecorderMiddleware](https://ai.ortusbooks.com/main-components/middleware/flight-recorder.md): Record and replay LLM and tool interactions to deterministic JSON fixtures
- [InputSanitizerMiddleware](https://ai.ortusbooks.com/main-components/middleware/input-sanitizer.md): Heuristic prompt-injection scanning and unicode hygiene for inbound content and tool results
- [OutputGuardMiddleware](https://ai.ortusbooks.com/main-components/middleware/output-guard.md): Redact secrets and strip exfiltration channels from model outputs and reasoning
- [LLMGuardMiddleware](https://ai.ortusbooks.com/main-components/middleware/llm-guard.md): Use a second model as a security classifier for injection and harmful content
- [RunControlMiddleware (Internal)](https://ai.ortusbooks.com/main-components/middleware/run-control.md): Internal middleware used by AiAgent cancel and steer operations per thread
- [Human-in-the-Loop](https://ai.ortusbooks.com/main-components/human-in-the-loop.md): Require a human to approve sensitive tool calls before they run — with pluggable approval policies, durable grants, and batched approvals.
- [Gateways](https://ai.ortusbooks.com/main-components/gateways.md): Gateways are bidirectional adapters that present agent interactions — especially human approvals — on CLI, HTTP, or any external platform.
- [Gateway Sessions](https://ai.ortusbooks.com/main-components/gateway-sessions.md): Wire an AiAgent to one or more gateways for inbound message handling with aiGatewaySession() — dispatch policies, queueing, and lifecycle.
- [Reasoning](https://ai.ortusbooks.com/main-components/reasoning.md): Enable and read model reasoning (extended thinking) with a single normalized envelope — message.reasoning / delta.reasoning — across every provider that supports it.
- [AI Agents](https://ai.ortusbooks.com/main-components/agents.md): AI Agents are autonomous entities that reason, use tools, and maintain conversation memory to handle complex AI workflows.
- [Getting Started](https://ai.ortusbooks.com/main-components/agents/getting-started.md): How to create and configure AI agents — from simple assistants to full-featured agents with custom models, tools, and v3.0 skills.
- [Class-Based Agents](https://ai.ortusbooks.com/main-components/agents/class-based-agents.md): Build reusable, encapsulated agents by extending the AiAgent class instead of configuring everything inline with the aiAgent() BIF.
- [Memory Management](https://ai.ortusbooks.com/main-components/agents/memory.md): Agent memory management — from simple window memory to vector-backed RAG, per-call identity routing, multi-tenant tracking, and suspend/resume.
- [Tools & MCP](https://ai.ortusbooks.com/main-components/agents/tools-and-mcp.md): Tools, the Global Tool Registry, MCP server seeding, and the ClosureTool pattern for building AI agents with real-world capabilities.
- [Skills](https://ai.ortusbooks.com/main-components/agents/skills.md): Skills inject reusable domain knowledge into an agent's system context — either always-on or lazily loaded on demand.
- [Middleware](https://ai.ortusbooks.com/main-components/agents/middleware.md): Attaching middleware to an agent and the agent-specific lifecycle it participates in — full hook/result/built-in reference lives on the main Middleware page.
- [Sub-Agents & Hierarchy](https://ai.ortusbooks.com/main-components/agents/hierarchy.md): Sub-agents allow parent agents to delegate tasks to specialized child agents, enabling complex multi-agent orchestration patterns.
- [Streaming](https://ai.ortusbooks.com/main-components/agents/streaming.md): Stream agent responses in real-time using callback-based chunk delivery.
- [Run Control](https://ai.ortusbooks.com/main-components/agents/run-control.md): Cancel or steer an AiAgent run already in flight with cancelRun() and steerRun(), addressed purely by threadId — no token to construct or wire up.
- [RAG & Document Loading](https://ai.ortusbooks.com/main-components/agents/rag.md): Using document loaders and vector memory with agents to provide grounded, factual responses from your knowledge base.
- [Transformers](https://ai.ortusbooks.com/main-components/agents/transformers.md): Using transformers with agents to process inputs and outputs, enabling structured extraction and multi-stage pipelines.
- [Advanced Patterns](https://ai.ortusbooks.com/main-components/agents/advanced.md): Advanced agent patterns: pipeline integration, dynamic tools, introspection, event interception, and best practices.
- [Message Templates](https://ai.ortusbooks.com/main-components/messages.md): Build reusable, dynamic prompts with placeholders that get filled in at runtime. Message templates are the foundation of flexible AI pipelines.
- [Message Context](https://ai.ortusbooks.com/main-components/messages/message-context.md): Inject security information, RAG data, and other contextual information into your AI messages.
- [Transformers & Return Formats](https://ai.ortusbooks.com/main-components/transformers.md): The guide to data transformation between AI pipeline steps using built-in return formats and custom transformers.
- [Memory Systems](https://ai.ortusbooks.com/main-components/memory.md): Comprehensive guide on using standard memory systems in BoxLang AI for conversation history and context retention.
- [Multi-Tenant Memory Guide](https://ai.ortusbooks.com/main-components/memory/multi-tenant-memory.md): Enterprise guide to implementing multi-tenant memory isolation in BoxLang AI applications
- [Vector Memory Systems](https://ai.ortusbooks.com/main-components/memory/vector-memory.md): Comprehensive guide to vector memory systems for semantic search and retrieval in BoxLang AI applications.
- [Audio/Speech & Transcription](https://ai.ortusbooks.com/main-components/audio.md): Convert text to speech, transcribe audio to text, and translate spoken audio to English — all through a unified BIF interface across multiple AI providers.
- [Text-to-Speech](https://ai.ortusbooks.com/main-components/audio/text-to-speech.md): Convert any text to natural-sounding audio using AI providers. aiSpeak() returns binary audio data wrapped in an AiSpeechResponse with helpers for saving, encoding, and streaming.
- [Streaming Text-to-Speech](https://ai.ortusbooks.com/main-components/audio/streaming-speech.md): Stream synthesized speech to a callback as it is generated, so you can restream it to a customer. Works with Cartesia, ElevenLabs, OpenAI, Mistral and Gemini.
- [Speech-to-Text](https://ai.ortusbooks.com/main-components/audio/speech-to-text.md): Transcribe audio files, URLs, or binary data into text using AI providers. aiTranscribe() auto-detects the input type and optionally returns rich metadata including word-level timestamps, segments, an
- [Audio Translation](https://ai.ortusbooks.com/main-components/audio/audio-translation.md): Translate spoken audio from any language directly into English text using AI providers. aiTranslate() is distinct from text translation — it converts speech to English in a single transcription step.
- [Audio Editing Tools (bx-audio)](https://ai.ortusbooks.com/main-components/audio/bx-audio-tools.md): Give agents audio editing, mastering, analysis and local speech tools by installing the bx-audio module next to BoxLang AI.
- [Image Generation](https://ai.ortusbooks.com/main-components/image-generation.md): Generate images from text prompts using AI providers. aiImage() supports OpenAI, Gemini, Grok, and OpenRouter with consistent parameters and fluent response handling.
- [Generating Images](https://ai.ortusbooks.com/main-components/image-generation/generating.md): Generate images from text prompts using aiImage(). Learn about parameters, options, provider-specific settings, and the fluent builder API.
- [Image Response & Formats](https://ai.ortusbooks.com/main-components/image-generation/response-formats.md): The AiImageResponse object wraps generated images with methods for saving, encoding, embedding, and inspecting metadata.
- [Image Agent Tools](https://ai.ortusbooks.com/main-components/image-generation/agent-tools.md): The generateImage@bxai built-in agent tool enables AI agents to generate images from text prompts and return file paths.
- [Web Search](https://ai.ortusbooks.com/main-components/web-search.md): Web search integration for AI agents - 5 providers, real-time internet access, RAG enhancement
- [Getting Started](https://ai.ortusbooks.com/main-components/web-search/getting-started.md): Getting started with web search - basic usage, async patterns, agent integration
- [Providers](https://ai.ortusbooks.com/main-components/web-search/providers.md): Complete provider reference for Web Search in BoxLang AI
- [Agent Tools](https://ai.ortusbooks.com/main-components/web-search/agent-tools.md): Using web search as an AI agent tool with auto-registration and multi-tool workflows
- [Pipelines](https://ai.ortusbooks.com/main-components/pipelines.md): Build composable AI workflows with runnable pipelines - chain models, messages, and transformers for powerful data processing.
- [Building Pipelines](https://ai.ortusbooks.com/main-components/pipelines/building.md): Three ways to build pipelines, how data flows through steps, and how to configure parameters and options.
- [Transform Pipelines](https://ai.ortusbooks.com/main-components/pipelines/transforms.md): Using transformations to clean, reshape, and enrich data as it flows through a pipeline — before, after, and around AI calls.
- [Multi-Model & Multi-Step](https://ai.ortusbooks.com/main-components/pipelines/multi-model.md): Multi-step workflows, leveraging different models' strengths, and building reusable pipeline templates.
- [Structured Output](https://ai.ortusbooks.com/main-components/pipelines/structured-output.md): Use structured output with AI pipelines for type-safe, composable workflows. Combine the power of runnables with guaranteed data structures for robust AI applications.
- [Streaming](https://ai.ortusbooks.com/main-components/pipelines/streaming.md): Stream data through AI pipelines in real-time for responsive applications.
- [Advanced Patterns](https://ai.ortusbooks.com/main-components/pipelines/advanced.md): Pipeline events, debugging tools, performance optimization, error handling, and best practices for production use.
- [MCP Servers](https://ai.ortusbooks.com/model-context-protocol-mcp/server.md): Expose your application's tools, resources, and prompts to AI clients through a complete MCP server implementation.
- [Getting Started](https://ai.ortusbooks.com/model-context-protocol-mcp/server/getting-started.md): Get your first MCP server running in 5 minutes.
- [Transports (HTTP & STDIO)](https://ai.ortusbooks.com/model-context-protocol-mcp/server/transports.md): Choose between HTTP and STDIO transport mechanisms for your MCP server based on deployment scenario.
- [Server Configuration](https://ai.ortusbooks.com/model-context-protocol-mcp/server/server-configuration.md): Configure authentication, CORS, request limits, and other security settings for your MCP server.
- [Registering Tools, Resources & Prompts](https://ai.ortusbooks.com/model-context-protocol-mcp/server/registration.md): Register the tools, resources, and prompts your MCP server exposes to clients.
- [Annotation-Based Discovery](https://ai.ortusbooks.com/model-context-protocol-mcp/server/annotation-discovery.md): Automatically discover and register tools, resources, and prompts from annotated methods.
- [Class-Based Servers](https://ai.ortusbooks.com/model-context-protocol-mcp/server/class-based-servers.md): Encapsulate your entire MCP server in a dedicated class that extends MCPServer for better organization and testability.
- [HTTP Endpoint & Routing](https://ai.ortusbooks.com/model-context-protocol-mcp/server/http-endpoint.md): Set up and customize HTTP endpoints and routing for your MCP server.
- [Observability & Monitoring](https://ai.ortusbooks.com/model-context-protocol-mcp/server/observability.md): Track performance, monitor requests, and respond to MCP server events in real-time.
- [Rate Limiting](https://ai.ortusbooks.com/model-context-protocol-mcp/server/rate-limiting.md): Limit how often one client can call your MCP server, by IP, API key, or your own key.
- [Pause & Resume](https://ai.ortusbooks.com/model-context-protocol-mcp/server/pause-resume.md): Temporarily halt an MCP server without destroying its configuration.
- [Best Practices](https://ai.ortusbooks.com/model-context-protocol-mcp/server/best-practices.md): Guidelines for production MCP servers — security, monitoring, performance, and deployment.
- [Examples & Use Cases](https://ai.ortusbooks.com/model-context-protocol-mcp/server/_examples.md): Complete working examples for common MCP server scenarios.
- [MCP Clients](https://ai.ortusbooks.com/model-context-protocol-mcp/client.md): Connect to external MCP servers to consume tools, resources, and prompts from other AI applications.
- [Stdio Servers (Child Process)](https://ai.ortusbooks.com/model-context-protocol-mcp/client/stdio.md): Use an MCP server that runs as a child process, over stdin and stdout, with MCP( { command: \[ ... ] } ).
- [OAuth Sign In](https://ai.ortusbooks.com/model-context-protocol-mcp/client/oauth.md): Sign in to an MCP server that is protected with OAuth, for one account or for every person who talks to your agent
- [Embeddings](https://ai.ortusbooks.com/rag/embeddings.md): Generate numerical vector representations of text that power semantic search, recommendations, and clustering.
- [Document Loaders](https://ai.ortusbooks.com/rag/document-loaders.md): Import content from files, directories, URLs, and databases into a standardized Document format for AI workflows and RAG.
- [RAG (Retrieval-Augmented Generation)](https://ai.ortusbooks.com/rag/rag.md): Complete guide to implementing Retrieval-Augmented Generation (RAG) workflows in BoxLang AI.
- [Working with Models](https://ai.ortusbooks.com/advanced/models.md): The comprehensive guide to working with AI models in BoxLang, covering creation, configuration, pipeline integration, parameters, options, and advanced usage.
- [Event System](https://ai.ortusbooks.com/advanced/events.md): Intercept, monitor, and customize AI operations at every stage with the module's 71 interception points.
- [Utility Functions](https://ai.ortusbooks.com/advanced/utilities.md): Utility functions for text processing, token management, and working with AI models.
- [Reference](https://ai.ortusbooks.com/advanced/reference.md): Reference documentation for BoxLang AI module
- [Built-In Functions Reference](https://ai.ortusbooks.com/advanced/reference/built-in-functions.md): Reference documentation for built-in functions in BoxLang AI module
- [MCP](https://ai.ortusbooks.com/advanced/reference/built-in-functions/mcp.md): Create a fluent MCP (Model Context Protocol) client for consuming external MCP servers over HTTP or as a child process over stdio.
- [MCPServer](https://ai.ortusbooks.com/advanced/reference/built-in-functions/mcpserver.md): Get or create an MCP (Model Context Protocol) server instance for registering and managing tools, resources, and prompts.
- [aiAgent](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aiagent.md): Create an autonomous AI Agent that can reason, use tools, maintain memory, and execute multi-step tasks.
- [aiChat](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aichat.md): Initiate an AI chat conversation against the default or custom AI Provider with a simple, synchronous interface.
- [aiChatAsync](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aichatasync.md): Asynchronous version of aiChat() that returns a BoxLang Future for non-blocking AI requests.
- [aiChatRequest](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aichatrequest.md): Create a reusable AI Chat Request object for building requests programmatically, managing conversations, or testing AI workflows.
- [aiChatStream](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aichatstream.md): Stream AI responses in real-time with a callback function, ideal for UI updates and long responses.
- [aiChunk](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aichunk.md): Chunk text into smaller, manageable segments for AI processing, embeddings, or semantic search.
- [aiDocuments](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aidocuments.md): Main entry point for document loading in AI workflows — a fluent document loader for flexible configuration and execution.
- [aiEmbed](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aiembed.md): Generate vector embeddings for text using AI providers, enabling semantic search, similarity comparison, and clustering.
- [aiFence](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aifence.md): Wraps untrusted content in tamper-resistant boundary markers so the model treats it as data, never instructions.
- [aiGateway](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aigateway.md): Resolves an IGateway instance by name — a gateway bx-ai ships in core, or one registered by an external gateway module.
- [aiDecisionStore](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aidecisionstore.md): Creates an IDecisionStore — the backing store for durable human-approval grants used by Human-in-the-Loop.
- [aiGatewayRegistry](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aigatewayregistry.md): Returns the singleton GatewayRegistry — the extension point external gateway modules use to make their gateway resolvable by aiGateway().
- [aiGatewaySession](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aigatewaysession.md): Wires one AiAgent to one-or-more IGateway instances for inbound message handling, with a configurable dispatch policy for messages arriving on a busy thread.
- [aiMemory](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aimemory.md): Create AI memory instances for storing conversation history, context, or knowledge bases.
- [aiMessage](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aimessage.md): Build AI message structures fluently using a chainable API, with template interpolation and pipeline integration.
- [aiModel](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aimodel.md): Create an AI Model runnable that wraps a service provider for use in pipelines — the pipeline-friendly version of aiService().
- [aiParallel](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aiparallel.md): Create a parallel runnable that fans-out a single input to multiple named runnables concurrently and collects results into a named struct.
- [aiProfile](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aiprofile.md): Describe one profile. Never returns an API key.
- [aiProfiles](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aiprofiles.md): List the configured profiles. Never returns an API key.
- [aiProviders](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aiproviders.md): List the providers you can select. Never returns an API key.
- [aiPopulate](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aipopulate.md): Populate a class instance, struct, or array from JSON data or a struct — useful for structured AI output and deserialization.
- [aiService](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aiservice.md): Get a reference to a registered AI service provider — the direct invocation interface for AI providers.
- [aiTokens](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aitokens.md): Estimate token count for AI processing — useful for staying within model limits and estimating costs.
- [aiSkill](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aiskill.md): Discover and load AI skills from a directory tree, a single file, or an inline skill definition.
- [aiGlobalSkills](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aiglobalskills.md): Access the globally shared pool of AI skills that are automatically injected into every agent's system context.
- [aiSpeak](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aispeak.md): Convert text to natural-sounding speech audio using an AI provider.
- [aiSpeakStream](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aispeakstream.md): aiSpeakStream() streams synthesized speech to a callback as it is generated.
- [aiImage](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aiimage.md): Generate images from prompts using supported AI providers.
- [aiTranscribe](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aitranscribe.md): Transcribe audio from a file path, URL, or binary data into text using an AI provider.
- [aiTranslate](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aitranslate.md): Translate audio from any language directly into English text using an AI provider.
- [aiWebSearch](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aiwebsearch.md): BoxLang AI aiWebSearch() built-in function reference
- [aiWebSearchAsync](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aiwebsearchasync.md): BoxLang AI aiWebSearchAsync() built-in function reference
- [aiAgentRegistry](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aiagentregistry.md): Get the singleton global AIAgentRegistry instance for registering, resolving, and observing agents.
- [aiToolRegistry](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aitoolregistry.md): Returns the singleton AIToolRegistry instance for registering, discovering, and resolving AI tools globally.
- [aiTool](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aitool.md): Create callable function tools that AI agents can use to gather information or take actions.
- [aiTransform](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aitransform.md): Create an AI Transform Runnable that applies transformation functions to data flowing through AI pipelines.
- [Production Deployment](https://ai.ortusbooks.com/advanced/production.md): Production deployment guide for BoxLang AI - monitoring, error handling, performance optimization, and best practices.
- [Security Guide](https://ai.ortusbooks.com/advanced/security.md): Security best practices for BoxLang AI - API key management, prompt injection prevention, data privacy, and compliance guidance.
- [Building AI Providers](https://ai.ortusbooks.com/extending-boxlang-ai/custom-providers.md): Learn how to build custom AI provider integrations to connect any LLM service with BoxLang AI.
- [Building Transformers](https://ai.ortusbooks.com/extending-boxlang-ai/custom-transformer.md): Learn how to build custom transformers to process and shape data in BoxLang AI pipelines.
- [Building Memory](https://ai.ortusbooks.com/extending-boxlang-ai/custom-memory.md): Learn how to build custom memory implementations by extending BaseMemory for specialized storage and retrieval requirements.
- [Building Vector Memory](https://ai.ortusbooks.com/extending-boxlang-ai/custom-vector-memory.md): Create custom vector memory implementations by extending BaseVectorMemory and implementing the IVectorMemory interface.
- [Building Document Loaders](https://ai.ortusbooks.com/extending-boxlang-ai/custom-loader.md): Learn how to build custom document loaders to integrate any data source into BoxLang AI workflows.
- [Building Tools](https://ai.ortusbooks.com/extending-boxlang-ai/custom-tools.md): Build reusable, annotated, and class-based tools that your AI agents can call during conversations.
- [Building Web Search Providers](https://ai.ortusbooks.com/extending-boxlang-ai/custom-web-search-providers.md): Build custom web search providers by extending BaseSearch and implementing provider-specific search logic


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
This site has an agentic ask interface you may use to query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://ai.ortusbooks.com/index.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.
