> For the complete documentation index, see [llms.txt](https://docs.umbraco.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.umbraco.com/ai-in-umbraco/extending/extending.md).

# Overview

Extend Umbraco.AI with custom providers, middleware, and tools.

Umbraco.AI is designed to be extensible. You can add support for new AI providers, customize the request pipeline with middleware, and create custom tools for AI agents.

## Extension Points

<table data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>Custom Providers</strong></td><td>Add support for AI services not included out of the box</td></tr><tr><td><strong>Middleware</strong></td><td>Add logging, caching, rate limiting, and custom behavior</td></tr><tr><td><strong>Custom Tools</strong></td><td>Create tools that AI agents can use to perform actions</td></tr><tr><td><strong>Agent Workflows</strong></td><td>Create multi-agent orchestration workflows for orchestrated agents</td></tr><tr><td><strong>Custom Guardrail Evaluators</strong></td><td>Create evaluators for domain-specific safety and compliance rules</td></tr><tr><td><strong>Knowledge Sets</strong></td><td>Ship background knowledge about your product that the AI can draw on</td></tr><tr><td><strong>Notifications</strong></td><td>Subscribe to entity lifecycle events for validation and automation</td></tr></tbody></table>

## When to Extend

### Create a Custom Provider When

* You need to connect to an AI service without an existing provider
* You want to use a self-hosted AI model
* You need custom authentication or API handling

### Create Middleware When

* You want to log all AI requests and responses
* You need to cache responses for identical requests
* You want to add rate limiting or retry logic
* You need to modify requests or responses globally

### Create Custom Tools When

* You want AI agents to interact with your systems
* You need to expose business logic to AI
* You want to enable AI to query databases or APIs

### Create Agent Workflows When

* You need multi-agent orchestration (e.g., writer + editor pipelines)
* You want to compose agents into sequential or parallel workflows
* You need custom agent collaboration patterns

### Create a Knowledge Set When

* You ship a package and want the AI to understand your product
* You want to provide background reference material without an end-user having to configure anything
* You have content that the AI should draw on only when it is relevant

### Subscribe to Notifications When

* You need to validate operations before they execute
* You want to audit changes for compliance
* You need to trigger automation in response to events
* You want to maintain data consistency across systems

## Architecture Overview

```mermaid
graph TD
    A["Your Code\n(IAIChatService / IAIEmbeddingService)"] --> B[Middleware Pipeline]
    B --> C["Provider\n(OpenAI / Azure / Your Provider)"]
    C --> D[AI Service API]
```

## In This Section

{% content-ref url="/pages/3VIw69H97G5IIXOhDihK" %}
[Custom Providers](https://docs.umbraco.com/ai-in-umbraco/extending/providers.md)
{% endcontent-ref %}

{% content-ref url="/pages/tyLfULoQlNO8U5izOJ6s" %}
[Middleware](https://docs.umbraco.com/ai-in-umbraco/extending/middleware.md)
{% endcontent-ref %}

{% content-ref url="/pages/Jb5Wl3R2NbvQVnCSI9rb" %}
[Custom Tools](https://docs.umbraco.com/ai-in-umbraco/extending/tools.md)
{% endcontent-ref %}

{% content-ref url="/pages/b0ZQqw6DYAIJ7J8lg3hW" %}
[Workflows](https://docs.umbraco.com/ai-in-umbraco/add-ons/agent/workflows.md)
{% endcontent-ref %}

{% content-ref url="/pages/GVUhRaHQnKMZtoKLhxhO" %}
[Knowledge Sets](https://docs.umbraco.com/ai-in-umbraco/extending/knowledge-sets.md)
{% endcontent-ref %}

{% content-ref url="/pages/vU1E3nMecuf488YExC2d" %}
[Notifications](https://docs.umbraco.com/ai-in-umbraco/extending/notifications.md)
{% endcontent-ref %}


---

# 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 that is not directly available in this page, you can query the documentation by asking a question.

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

```
GET https://docs.umbraco.com/ai-in-umbraco/extending/extending.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.

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.
