# Find Embeddings

The block allows you to find the most similar rows in the knowledge base, which is a table of objects and their embeddings, based on a given query embedding[^1], and return the indices of these rows as a list sorted in descending order of similarity.

Embeddings for both the query and the embedding table being searched can be obtained using the "Get Embeddings" block. When the block is used for the first time, a vector database is built, which may take a long time. In subsequent calls to the block with the same "Database ID," the already created vector database will be used, and the speed of the block's operation increases significantly.

<table data-header-hidden><thead><tr><th width="283.36669921875" valign="top"></th><th width="317.98333740234375" valign="top"></th></tr></thead><tbody><tr><td valign="top">Query Embedding</td><td valign="top">[Text] The embedding for which similar rows need to be found in the table. The value for this field can be obtained using the "Get Embedding" block.</td></tr><tr><td valign="top">Knowledge Base</td><td valign="top">[Data Table] The table in which the search will be conducted. One of the columns of the table must contain embeddings; other columns can contain any user data.</td></tr><tr><td valign="top">Database ID</td><td valign="top"><p>[Text] You can specify a different database ID so that the block starts building the vector database from scratch on the first run.</p><p>When the block is used for the first time, a vector database is built, which may take a long time. In subsequent calls to the block with the same "Database ID," the already created vector database will be used, and the speed of the block's operation increases significantly.</p></td></tr><tr><td valign="top">Embedding Column</td><td valign="top"><p>[Number/Text] The index or name of the column from the table specified in the "Knowledge Base" property, where the embeddings are located.</p><p>Default is <code>1</code>.</p></td></tr><tr><td valign="top">Number of Results</td><td valign="top"><p>[Number] The maximum number of result rows returned by the block from the knowledge base.</p><p>Default is <code>5</code>.</p></td></tr><tr><td valign="top">Row Indices</td><td valign="top">[List] A list of row indices from the Knowledge Base containing the most similar embeddings to the query, sorted in descending order of similarity.</td></tr><tr><td valign="top">Similarity</td><td valign="top">[List] Numerical measures of similarity for each of the results.</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" - by 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 the blocks will output during operation. Possible values:</p><ul><li>"Default" - by default;</li><li>"Release" - output is disabled;</li><li>"Debug" - outputs main information;</li><li>"Detailed" - outputs detailed information.</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 Message</td><td valign="top">[Text] Returns detailed information about the error in case of incorrect execution of the block's work.</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, rows, 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/naiti-embeddingi-openaisearchembeddings.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.
