> For the complete documentation index, see [llms.txt](https://docs.appfarm.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.appfarm.io/library/action-nodes/semantic-search.md).

# Semantic search

{% hint style="info" %}
**Beta feature**

Semantic search is not generally available yet. Get in touch with your Appfarm contact to discuss early access.
{% endhint %}

Semantic search is used to find objects in the database by meaning rather than exact words. It searches a property that has [semantic search enabled](/reference/data-model/object-class-properties.md#semantic-search) in the data model, and returns the objects whose values are most similar in meaning to the search term.

## Usage

This action node can be used when users describe what they are looking for in their own words, and the matching objects may not contain the same words. An example can be a knowledge base where users ask a question and get the articles that answer it.

To match exact words, search as the user types, search several properties at once, or filter the results, use [Full-text search](/library/action-nodes/full-text-search.md) instead.

The action node is available in apps and [flows](/reference/flows.md).

See [Configure semantic search](/how-to/logic-and-flow/configure-semantic-search.md) for a step-by-step guide on how to set up semantic search in an app.

## Properties

| Property               | Description                                                                                                                                                                                                                                                                                                                                              |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Data source**        | Select the data source you want to populate with the search results. Must be a runtime-only data source.                                                                                                                                                                                                                                                 |
| **Search score**       | <p><em>Available when a <strong>Data source</strong> is selected.</em><br><br>Every object returned by Semantic search is assigned a score from 0 to 1 based on similarity to the search term. Select a property on the selected <strong>Data source</strong> to store this score, for example to sort or filter on it later. Must be of type Float.</p> |
| **Search in property** | Select the property to search in. Only String and Rich Text properties with **Enable semantic search** selected in the data model are listed. Changing the **Data source** clears this selection.                                                                                                                                                        |
| **Search term**        | Define the text to search for. This will typically be an app variable or action param containing the user's input. The search term can be at most 2000 characters long.                                                                                                                                                                                  |
| **Limit**              | Limit the maximum number of objects returned in the search. Default is 10, and the value must be between 1 and 1000. If the **Data source** has cardinality one, a single object is returned.                                                                                                                                                            |

## Search results

Each search replaces the contents of the selected **Data source**. The objects are sorted by similarity, with the most similar object first.

If the search term is empty, no objects are returned and the data source is cleared.

The search only returns objects the user has [permission](/reference/security/permissions.md) to read. A user without read access to the object class gets an empty result rather than an error.

Rich Text properties are searched by their text content. Formatting is not part of the search.

## Index availability

The search index for a property is built separately in each environment, starting when the change is deployed there. Until the build has finished, the action node fails with one of these errors:

* `Semantic search index for '<node name>' has not been created yet - it is created on the next index sync`
* `Semantic search index for '<node name>' is not ready yet - embeddings are being prepared (status: <status>)`

`<node name>` is the property's **Node Name** in the data model.

{% hint style="info" %}
**Good to know**

On large object classes the index build can take some time, since every existing object is processed. Plan for this when deploying a new semantic search property to an environment with a lot of data.
{% endhint %}


---

# 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.appfarm.io/library/action-nodes/semantic-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.
