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.
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.
-
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:
- Select Create project from the Serverless projects panel.
- Select Next from the Vector Database panel.
- Name your project.
- Select a cloud provider and region. For available regions, refer to Regions.
- Select Create project. It takes a few minutes to create your project.
- When the project is ready, select Continue to open it (you might need to log in to Elastic Cloud again).
NoteYou need the
adminpredefined 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.
-
(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_textfield, then run a semantic or hybrid queryStore your existing embeddings You already have vectors from your own model Index pre-generated embeddings into a dense_vectorfield, then run a semantic or hybrid queryYou can also skip the setup guide and continue with the steps below.
-
Ingest your data
Use the approach that matches how you create embeddings.
Generate embeddings from your contentYou can generate embeddings as part of the ingestion workflow instead of creating them in advance.
For text content, the recommended approach is to map the target field as
semantic_text. When you ingest documents, Elasticsearch uses the configured inference endpoint to generate and store embeddings automatically. You can check which models are used by default and learn how to change them in Configure inference endpoints documentation.For more control over the inference and ingestion workflow, you can also generate embeddings with an inference processor in an ingest pipeline and store them in a vector field. For more information, see Semantic search with ELSER.
To walk through mapping a
semantic_textfield, ingesting sample content, and running a hybrid query, follow the semantic search quickstart.Store your existing embeddingsCreate an index with a
dense_vectorfield, and any other text or metadata fields you might need, then index your pre-generated vectors.To walk through indexing sample embeddings and running a kNN search, follow Bring your own dense vectors to Elasticsearch.
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.
-
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:
- Vector search in Elasticsearch: Concepts, field types, quantization, and query options
- Ranking and reranking: Improve relevance after you have a baseline
- RAG: Patterns for grounding LLMs on retrieved context
- Vector search use cases: RAG, recommendations, multimodal search, and more
- Search Power and billing dimensions: Balance latency and cost for your project
- Elasticsearch Vector Database overview: When to choose this project type versus the general-purpose Elasticsearch project
- Elasticsearch solution: General-purpose project type and search application UI tools