# AI Server. Find Embeddings

The block allows:

* to find the most similar strings in the knowledge base for a given embedding query[^1],
* to return a list of them, sorted in descending order of similarity.

The knowledge base can be populated using the "AI Server. Add Document" and "AI Server. Add Chunks" blocks.

<table data-header-hidden><thead><tr><th width="296.76666259765625" valign="top"></th><th width="323.566650390625" valign="top"></th></tr></thead><tbody><tr><td valign="top">Search Query</td><td valign="top">[Text] The text that needs to be found.</td></tr><tr><td valign="top">Number of Results</td><td valign="top">[Number] The number of results in the response.</td></tr><tr><td valign="top">List of GUID/File Paths</td><td valign="top"><p>[List] A list of file GUIDs or paths where the search should be performed.</p><p>For example, <code>@("GUID";"Folder 1\Subfolder 2\Subfolder 3\Document.docx")</code>.</p><p>The file path must include the file name and extension.</p></td></tr><tr><td valign="top">List of GUID/Folder Paths</td><td valign="top"><p>[List] A list of GUIDs or folder paths where the search should be performed.</p><p>For example, <code>@("GUID";"Folder 1\Subfolder 2\Subfolder 3")</code>.</p></td></tr><tr><td valign="top">Include Subfolders</td><td valign="top">If enabled, subfolders will be considered.</td></tr><tr><td valign="top">Timeout</td><td valign="top">[Number] The maximum wait time for a response in seconds.</td></tr><tr><td valign="top">Result</td><td valign="top"><p>[List of Objects] A list of ChunkItem objects.</p><p>Available properties:</p><ul><li>Text - the text of the chunk;</li><li>FileGUID - the GUID of the file where the chunk was found;</li><li>FolderGUID - the GUID of the folder where the chunk was found;</li><li>FileName - the file name with extension but without the folder path;</li><li>FilePath - the file name with the folder path;</li><li>Metadata - the metadata of the chunk;</li><li>FileMetadata - the metadata of the file;</li><li>Distance - the degree of closeness.</li></ul></td></tr><tr><td valign="top">Error Handling Level</td><td valign="top"><p>Select the error handling level. Possible values:</p><ul><li>"Default" - default;</li><li>"Ignore" - errors are ignored;</li><li>"Handle" - errors are handled.</li></ul><p>If "Default" is selected, the value from the "Start" block of this diagram will be used.</p></td></tr><tr><td valign="top">Message Level</td><td valign="top"><p>Select the message level that blocks will output during operation. Possible values:</p><ul><li>"Default" - default;</li><li>"Release" - output is disabled;</li><li>"Debug" - main information output;</li><li>"Detailed" - detailed information output.</li></ul><p>If "Default" is selected, the value from the "Start" block of this diagram will be used.</p></td></tr><tr><td valign="top">Error Text</td><td valign="top">[Text] Returns detailed information about the error in case of incorrect execution of the block.</td></tr></tbody></table>

[^1]: An embedding is a vector (a set of numbers) that characterizes the meaning associated with the given input text. Words or sentences with similar meanings will have embeddings with minimal cosine distance. Embeddings can also be used to search for the most semantically similar words, strings, or paragraphs in document databases.


---

# 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://docs.sherparpa.ru/en/sherpa-rpa/sherpa-designer/spravochnik-blokov/mashinnoe-obuchenie-machine-learning/ai-server.-naiti-embeddingi-searchembeddingsaiserver.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.
