# BoxLang AI

## BoxLang AI - v3.x

- [Introduction](https://ai.ortusbooks.com/readme.md): BoxLang AI is a comprehensive library that brings enterprise-grade artificial intelligence capabilities to the JVM ecosystem. Whether you're building chatbots, content generators, code assistants, RAG
- [Release History](https://ai.ortusbooks.com/readme/release-history.md): All the major information about BoxLang AI Releases
- [3.2.0](https://ai.ortusbooks.com/readme/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/readme/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/readme/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/readme/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/readme/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/readme/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/readme/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/readme/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/readme/release-history/1.0.0.md): March 2025
- [FAQ](https://ai.ortusbooks.com/readme/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): The easiest way to build AI-powered applications, and autonomous agents on the JVM. Connect to OpenAI, Claude, Gemini, and more with under 10 lines of code.
- [installation](https://ai.ortusbooks.com/getting-started/installation.md): Quick installation guide for BoxLang AI module.
- [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.
- [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.
- [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): Intercept, modify, log, retry, and guard agent execution at every stage using the middleware pipeline.
- [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): Middleware hooks let you intercept agent lifecycle events for logging, retry, guardrails, tool control, and human-in-the-loop patterns.
- [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.
- [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)
- [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.
- [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.
- [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)
- [Getting Started](https://ai.ortusbooks.com/model-context-protocol-mcp/server/getting-started.md)
- [Transports (HTTP & STDIO)](https://ai.ortusbooks.com/model-context-protocol-mcp/server/transports.md)
- [Server Configuration](https://ai.ortusbooks.com/model-context-protocol-mcp/server/server-configuration.md)
- [Registering Tools, Resources & Prompts](https://ai.ortusbooks.com/model-context-protocol-mcp/server/registration.md)
- [Annotation-Based Discovery](https://ai.ortusbooks.com/model-context-protocol-mcp/server/annotation-discovery.md)
- [Class-Based Servers](https://ai.ortusbooks.com/model-context-protocol-mcp/server/class-based-servers.md)
- [HTTP Endpoint & Routing](https://ai.ortusbooks.com/model-context-protocol-mcp/server/http-endpoint.md)
- [Observability & Monitoring](https://ai.ortusbooks.com/model-context-protocol-mcp/server/observability.md)
- [Pause & Resume](https://ai.ortusbooks.com/model-context-protocol-mcp/server/pause-resume.md)
- [Best Practices](https://ai.ortusbooks.com/model-context-protocol-mcp/server/best-practices.md)
- [Examples & Use Cases](https://ai.ortusbooks.com/model-context-protocol-mcp/server/_examples.md)
- [MCP Clients](https://ai.ortusbooks.com/model-context-protocol-mcp/client.md)
- [Embeddings](https://ai.ortusbooks.com/rag/embeddings.md)
- [Document Loaders](https://ai.ortusbooks.com/rag/document-loaders.md)
- [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)
- [Utility Functions](https://ai.ortusbooks.com/advanced/utilities.md)
- [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)
- [MCPServer](https://ai.ortusbooks.com/advanced/reference/built-in-functions/mcpserver.md)
- [aiAgent](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aiagent.md)
- [aiChat](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aichat.md)
- [aiChatAsync](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aichatasync.md)
- [aiChatRequest](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aichatrequest.md)
- [aiChatStream](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aichatstream.md)
- [aiChunk](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aichunk.md)
- [aiDocuments](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aidocuments.md)
- [aiEmbed](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aiembed.md)
- [aiMemory](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aimemory.md)
- [aiMessage](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aimessage.md)
- [aiModel](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aimodel.md)
- [aiParallel](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aiparallel.md)
- [aiPopulate](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aipopulate.md)
- [aiService](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aiservice.md)
- [aiTokens](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aitokens.md)
- [aiSkill](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aiskill.md)
- [aiGlobalSkills](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aiglobalskills.md)
- [aiSpeak](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aispeak.md)
- [aiImage](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aiimage.md)
- [aiTranscribe](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aitranscribe.md)
- [aiTranslate](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aitranslate.md)
- [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)
- [aiToolRegistry](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aitoolregistry.md)
- [aiTool](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aitool.md)
- [aiTransform](https://ai.ortusbooks.com/advanced/reference/built-in-functions/aitransform.md)
- [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)
- [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
If you need additional information, you can query the documentation dynamically by asking a question.
Perform an HTTP GET request on a page URL with the `ask` query parameter:
```
GET https://ai.ortusbooks.com/readme.md?ask=<question>
```
The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.
Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
