> 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/add-ons/search.md).

# Semantic Search

Semantic vector search add-on for finding content by meaning.

The Semantic Search add-on (`Umbraco.AI.Search`) adds AI-powered vector search to Umbraco. Content is indexed as vector embeddings, and similarity search is available through the CMS Search API and an AI agent tool.

## Installation

{% code title="Package Manager Console" %}

```powershell
Install-Package Umbraco.AI.Search
```

{% endcode %}

Or via .NET CLI:

{% code title="Terminal" %}

```bash
dotnet add package Umbraco.AI.Search
```

{% endcode %}

{% hint style="info" %}
Requires `Umbraco.AI` with an embedding-capable provider such as `Umbraco.AI.OpenAI`.
{% endhint %}

## How it works

1. When content is published, the indexer extracts text from all fields.
2. Text is split into chunks and converted to vector embeddings.
3. Embeddings are stored in the database alongside the content.
4. Searches embed the query and find content with similar vectors.

The index appears alongside other Umbraco indexes as `UmbAI_Search` and supports both content and media.

## Features

* **Semantic search** - Find content by meaning, not keywords
* **Culture-aware** - Separate embeddings per language variant
* **CMS Search integration** - Works with the standard Search API
* **Agent tool** - `semantic_search` tool for AI agent chat
* **SQL Server 2025 support** - Native `VECTOR_DISTANCE()` when available, brute-force fallback on older versions
* **SQLite support** - In-memory similarity for local development
* **Custom vector store** - Replace `IAIVectorStore` to use external providers

## Configuration

Add options under `Umbraco:AI:Search` in `appsettings.json`:

{% code title="appsettings.json" %}

```json
{
  "Umbraco": {
    "AI": {
      "Search": {
        "ChunkSize": 512,
        "ChunkOverlap": 50,
        "DefaultTopK": 100,
        "MinScore": 0.3
      }
    }
  }
}
```

{% endcode %}

| Option         | Default | Description                                                              |
| -------------- | ------- | ------------------------------------------------------------------------ |
| `ChunkSize`    | `512`   | Maximum tokens per text chunk                                            |
| `ChunkOverlap` | `50`    | Token overlap between consecutive chunks                                 |
| `DefaultTopK`  | `100`   | Maximum candidates from vector search before deduplication               |
| `MinScore`     | `0.3`   | Minimum cosine similarity (0.0–1.0) required for a result to be returned |

### Separate database

To store vectors in a separate database, add an `umbracoAIDbDSN` connection string:

{% code title="appsettings.json" %}

```json
{
  "ConnectionStrings": {
    "umbracoAIDbDSN": "Server=ai-db;Database=UmbracoAI;...",
    "umbracoAIDbDSN_ProviderName": "Microsoft.Data.SqlClient"
  }
}
```

{% endcode %}

If omitted, the default `umbracoDbDSN` connection is used.

## Documentation

| Section                                                                     | Description                  |
| --------------------------------------------------------------------------- | ---------------------------- |
| [Concepts](/ai-in-umbraco/add-ons/search/concepts.md)                       | How indexing and search work |
| [Custom vector store](/ai-in-umbraco/add-ons/search/custom-vector-store.md) | Replace the built-in store   |

## Related

* [Add-ons Overview](/ai-in-umbraco/add-ons/add-ons.md) - All add-on packages
* [Embeddings](/ai-in-umbraco/using-the-api/embeddings.md) - Embedding API
* [Providers](/ai-in-umbraco/providers/providers.md) - AI provider configuration


---

# 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/add-ons/search.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.
