# Elastic

## Prerequisite

1. You can use the [official Docker image](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html) to get started, or you can use [Elastic Cloud](https://www.elastic.co/cloud/), Elastic's official cloud service. In this guide, we will be using cloud version.
2. [Register](https://cloud.elastic.co/registration) an account or [login](https://cloud.elastic.co/login) with existing account on Elastic cloud.

<figure><img src="/files/hGvIvEKeEp12grhG035J" alt=""><figcaption></figcaption></figure>

3. Click **Create deployment**. Then, name your deployment, and choose the provider.

<figure><img src="/files/70PtLNU3jMk7mar6Owm6" alt="" width="563"><figcaption></figcaption></figure>

4. After deployment is finished, you should be able to see the setup guides as shown below. Click the **Set up vector search** option.

<figure><img src="/files/Q8ywgVhTM62tntLLXTgE" alt=""><figcaption></figcaption></figure>

5. You should now see the **Getting started** page for **Vector Search**.

<figure><img src="/files/LM7CefL64cIg1EnofjTl" alt=""><figcaption></figcaption></figure>

6. On the left hand side bar, click **Indices**. Then, **Create a new index**.

<figure><img src="/files/2fb4fCiH70hLLGDLnaoJ" alt=""><figcaption></figcaption></figure>

7. Select **API** ingestion method

<figure><img src="/files/VZNLNKmIYr7j57wGmhUc" alt=""><figcaption></figcaption></figure>

8. Name your search index name, then **Create Index**

<figure><img src="/files/mWB5PkWO3gVThQQ3y0Wq" alt=""><figcaption></figcaption></figure>

9. After the index has been created, generate a new API key, take note of both generated API key and the URL

<figure><img src="/files/HBxc3D4olhmcdoH4wQZT" alt=""><figcaption></figcaption></figure>

## Flowise Setup

1. Add a new **Elasticsearch** node on canvas and fill in the **Index Name**

<figure><img src="/files/ymneXHNppL9ERRtA9X6R" alt="" width="275"><figcaption></figcaption></figure>

2. Add new credential via **Elasticsearch API**

<figure><img src="/files/ZMec9J5VLttN7nEviuRM" alt="" width="429"><figcaption></figcaption></figure>

3. Take the URL and API Key from Elasticsearch, fill in the fields

<figure><img src="/files/VfJo2oVR1r7cXei8YtOV" alt="" width="563"><figcaption></figcaption></figure>

4. After credential has been created successfully, you can start upserting the data

<figure><img src="/files/0uo5N11tIgS0Fx5DFtOw" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/SbbqHnTuEqGy4HA1Mpgq" alt=""><figcaption></figcaption></figure>

5. After data has been upserted successfully, you can verify it from Elastic dashboard:

<figure><img src="/files/9iXTNPHqDpxd3hMS9YMc" alt=""><figcaption></figcaption></figure>

6. Voila! You can now start asking question in the chat

<figure><img src="/files/AitU7h9ZeG85vtAqVVR9" alt=""><figcaption></figcaption></figure>

## Resources

* [LangChain JS Elastic](https://js.langchain.com/docs/integrations/vectorstores/elasticsearch)
* [Vector Search (kNN) Implementation Guide - API Edition](https://www.elastic.co/search-labs/blog/articles/vector-search-implementation-guide-api-edition)


---

# 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.flowiseai.com/integrations/langchain/vector-stores/elastic.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.
