Loading

Get started with the Elasticsearch Vector Database project type

The Elasticsearch Vector Database project type on Elastic Cloud Serverless is built for AI-powered vector retrieval. Use this guide to create a project, add embeddings, and run similarity or semantic searches from your application.

Note

Not sure whether this project type is right for you? Refer to When to use this project type.

If you're looking for an introduction to the Elastic Stack or the Elasticsearch product, go to Elastic fundamentals or The Elasticsearch data store.

  1. Create an Elasticsearch Vector Database Serverless project

    There are two options to create serverless projects:

    • If you're a new user, sign up for a free 14-day trial. For more information about Elastic Cloud trials, check out Trial information.
    • If you're an existing customer, log in to Elastic Cloud and do the following:
      1. Select Create project from the Serverless projects panel.
      2. Select Next from the Vector Database panel.
      3. Name your project.
      4. Select a cloud provider and region. For available regions, refer to Regions.
      5. Select Create project. It takes a few minutes to create your project.
      6. When the project is ready, select Continue to open it (you might need to log in to Elastic Cloud again).
    Note

    You need the admin predefined role or an equivalent custom role to create projects. For more information, refer to User roles and privileges.

    After you've created your project, note the Elasticsearch endpoint and API key from the project connection details. You'll use these to index data and run searches. New indices in this project type use vector index mode automatically.

  2. (Optional) Follow the in-product setup guides

    When you create a new Vector Database project, the Set up your Elasticsearch Vector Database page includes two guided paths you can follow. Each path walks you through ingest and then search examples, with sample scripts you can run in a client of your choosing or run the examples directly in the Console.

    The following setup guides are available in Kibana:

    Guide When to use What you do
    Generate embeddings from your content You want Elasticsearch to create embeddings for you Ingest content into a semantic_text field, then run a semantic or hybrid query
    Store your existing embeddings You already have vectors from your own model Index pre-generated embeddings into a dense_vector field, then run a semantic or hybrid query

    You can also skip the setup guide and continue with the steps below.

  3. Ingest your data

    Use the approach that matches how you create embeddings.

    Use a language client or the Bulk API to load data. If you're not ready to use your own content, follow the semantic search quickstart.

  4. Search your data

    Match your query to the vector field type in your mapping. For details on which queries each field type supports, see Field types and queries.

    To walk through common patterns, refer to the following pages:

    For more query options, see Querying for search and the Elasticsearch Serverless API documentation.

After you've learned how to ingest embeddings and return relevant results, dig deeper into how vector search works, improve ranking for your use case, and tune project settings for latency and cost. Review the following: