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

# Diaflow Vectors

Retrieve relevant/ Add data from Diaflow vector database

<figure><img src="https://3864624312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRdo1pkMnofwxf3lpWftw%2Fuploads%2FPfGKuReKSyoxymyqo6kx%2Fimage.png?alt=media&amp;token=72028cd6-bd8e-4f0f-abe5-21714ecb3935" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3864624312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRdo1pkMnofwxf3lpWftw%2Fuploads%2FWJCfq4bBr85RWLU3c6hn%2Fimage.png?alt=media&amp;token=26061139-67b5-4971-aa0f-9f76fea50bf2" alt=""><figcaption></figcaption></figure>

## Description

**What it does:** The Diaflow Vector component is used to vectorize data and transforming raw input data into a numerical format that the model can understand and process.

The Diaflow Vector component has the identifier of vec-**X**, where **X** represents the instance number of the Diaflow Vector component.\
\
**When to use it?** Imagine you're building an AI-powered chatbot that needs to answer user questions based on a massive knowledge base of documents. Diaflow Vectors lets you efficiently search through this knowledge base to find the most relevant information. It's not just about keyword matching – it's about understanding the meaning of the query and finding semantically similar content.&#x20;

*<mark style="color:red;">Caution with action "</mark><mark style="color:red;">**Add data to Vectors**</mark><mark style="color:red;">"</mark>*

After you run the node

* The system is processing the data, and it may take a few minutes to successfully save it to the **Vector**. You can check the data processing status on the **Vector** **page**
* When the name of the added data matches the name of existing data, the system will automatically **overwrite** the old data &#x20;

## Component settings

| Parameter Name | Description                                                                                                                                                                                                                                                                                                                                                                                                           |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Action         | <p>Options:<br><br><strong>(1)</strong> <strong>Search data from Vectors:</strong></p><ul><li>All data from vectors: Uses all available vector data. </li><li>From vector groups: Uses data from specific groups of vectors. </li><li>From vector files: Uses data from specific vector files.</li></ul><p><br><strong>(2)</strong> <strong>To add data to Vectors:</strong></p><ul><li>Add data to vectors</li></ul> |
| Input          | <p><strong>(1)</strong> <strong>Search data from Vectors:</strong><br>The content will be used as a keyword for searching data.<br><br><strong>(2)</strong> <strong>To add data to Vectors</strong><br>Include:<br>- File (.docx, .pdf, .txt)<br>- URL</p>                                                                                                                                                            |
| Destination    | <p>Applied this field witch <strong>action = Add data to vectors</strong><br><br>Option:</p><ul><li>Root </li><li>Group</li></ul>                                                                                                                                                                                                                                                                                     |
| Select data    | Allows the user to manage his vector files. Refer to [Vectors](/drive/diaflow-vectors.md) section to have more information.                                                                                                                                                                                                                                                                                           |

## Advanced configurations

This Diaflow Vectors component has no advanced configurations.

## Use case

### A - Search data from Vector

Here is a simple use case of the Diaflow Vector component, where the Diaflow Vector component is being used to get data from vector.

**Input:**&#x20;

* Action = "**Search data from Vectors"**
* Select data from Vector Group
* Input prompt to search: Tell me the story about Kaka's footballer

<figure><img src="https://3864624312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRdo1pkMnofwxf3lpWftw%2Fuploads%2Fsjd5x55f1ns3H02cCY3P%2Fimage.png?alt=media&amp;token=930cdec7-c185-41e0-b705-b26ac99db38d" alt=""><figcaption></figcaption></figure>

**Output:**&#x20;

<figure><img src="https://3864624312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRdo1pkMnofwxf3lpWftw%2Fuploads%2FMaT940fBBGLshffmIla3%2Fimage.png?alt=media&amp;token=d2d6f081-9e07-4790-a72c-21e967539b3d" alt=""><figcaption></figcaption></figure>

### B - Add data to Vector

Here is a simple use case of the Diaflow Vector component, where the Diaflow Vector component is being used to add data to vector.

**Input**:

* Action = "**Add data to vectors**"
* Destination = "Root"
* Input = Refer link from the node before (With this use case is Trigger node)&#x20;

<figure><img src="https://3864624312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRdo1pkMnofwxf3lpWftw%2Fuploads%2FF1dRsOp31SDvELHc0A75%2Fimage.png?alt=media&amp;token=98a3ac6b-c518-44e0-b158-6f29f26c1d5e" alt=""><figcaption></figcaption></figure>

**Output**:

<figure><img src="https://3864624312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRdo1pkMnofwxf3lpWftw%2Fuploads%2FOXoXcb7yiO2PVKrinNe6%2Fimage.png?alt=media&amp;token=5bc8bc33-2f31-4a0c-b94d-8764b5fe7142" alt=""><figcaption></figcaption></figure>

At the vector page, when the user reloads the page, it will show the File

<figure><img src="https://3864624312-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRdo1pkMnofwxf3lpWftw%2Fuploads%2FDJHIXQ9P8C1Ovl6QnZFX%2Fimage.png?alt=media&amp;token=58b5390e-56e5-406a-8790-6ff2b5a3acbb" alt=""><figcaption></figcaption></figure>
