# Main Components

- [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 configuration.
- [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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ai.ortusbooks.com/main-components.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.
