Skip to main content

Overview

A vector stores embedded data and performs similarity search.

Interface

LangChain provides a unified interface for vector stores, allowing you to:
  • add_documents - Add documents to the store.
  • delete - Remove stored documents by ID.
  • similarity_search - Query for semantically similar documents.
This abstraction lets you switch between different implementations without altering your application logic.

Initialization

To initialize a vector store, provide it with an embedding model:

Adding documents

Add Document objects (holding page_content and optional metadata) like so:

Deleting documents

Delete by specifying IDs:
Issue a semantic query using similarity_search, which returns the closest embedded documents:
Many vector stores support parameters like:
  • k — number of results to return
  • filter — conditional filtering based on metadata

Similarity metrics & indexing

Embedding similarity may be computed using:
  • Cosine similarity
  • Euclidean distance
  • Dot product
Efficient search often employs indexing methods such as HNSW (Hierarchical Navigable Small World), though specifics depend on the vector store.

Metadata filtering

Filtering by metadata (e.g., source, date) can refine search results:

Top integrations

Select embedding model:
Select vector store:
pip
Install the package and start Elasticsearch locally using the start-local script:
This creates an elastic-start-local folder. To start Elasticsearch:
Elasticsearch will be available at http://localhost:9200. The password for the elastic user and API key are stored in the .env file in the elastic-start-local folder.

All vector stores

Activeloop Deep Lake

Alibaba Cloud MySQL

Alibaba Cloud OpenSearch

AnalyticDB

Annoy

Apache Doris

ApertureDB

Astra DB Vector Store

Atlas

AwaDB

Azure Cosmos DB Mongo vCore

Azure Cosmos DB No SQL

Azure Database for PostgreSQL - Flexible Server

Azure AI Search

Bagel

BagelDB

Baidu Cloud ElasticSearch VectorSearch

Baidu VectorDB

Apache Cassandra

Chroma

Clarifai

ClickHouse

CockroachDB

Couchbase

DashVector

Databricks

IBM Db2

DingoDB

DocArray HnswSearch

DocArray InMemorySearch

Amazon Document DB

DuckDB

China Mobile ECloud ElasticSearch

Elasticsearch

Epsilla

Faiss

Faiss (Async)

FalkorDB

Gel

Google AlloyDB

Google BigQuery Vector Search

Google Cloud SQL for MySQL

Google Cloud SQL for PostgreSQL

Firestore

Google Memorystore for Redis

Google Spanner

Google Bigtable

Google Vertex AI Feature Store

Google Vertex AI Vector Search

Hippo

Hologres

Jaguar Vector Database

Kinetica

LambdaDB

LanceDB

Lantern

Lindorm

LLMRails

ManticoreSearch

MariaDB

Marqo

Meilisearch

Amazon MemoryDB

Milvus

Momento Vector Index

Moorcheh

MongoDB Atlas

MyScale

Neo4j Vector Index

NucliaDB

Oceanbase

openGauss

OpenSearch

Oracle AI Database

Pathway

Postgres Embedding

PGVecto.rs

PGVector

PGVectorStore

Pinecone

Pinecone (sparse)

Qdrant

Relyt

Rockset

SAP HANA Cloud Vector Engine

ScaNN

SemaDB

SingleStore

scikit-learn

SQLiteVec

SQLite-VSS

SQLServer

StarRocks

Supabase

SurrealDB

Tablestore

Tair

Tencent Cloud VectorDB

Teradata VectorStore

ThirdAI NeuralDB

TiDB Vector

Tigris

TileDB

Timescale Vector

Typesense

turbopuffer

Upstash Vector

USearch

Vald

Valkey

VDMS

veDB for MySQL

Vearch

Vectara

Vespa

viking DB

vlite

Volcengine RDS for MySQL

Weaviate

Xata

YDB

Yellowbrick

Zep

Zep Cloud

ZeusDB

Zilliz

Zvec