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.
Initialization
To initialize a vector store, provide it with an embedding model:from langchain_core.vectorstores import InMemoryVectorStore
vector_store = InMemoryVectorStore(embedding=SomeEmbeddingModel())
Adding documents
AddDocument objects (holding page_content and optional metadata) like so:
vector_store.add_documents(documents=[doc1, doc2], ids=["id1", "id2"])
Deleting documents
Delete by specifying IDs:vector_store.delete(ids=["id1"])
Similarity search
Issue a semantic query usingsimilarity_search, which returns the closest embedded documents:
similar_docs = vector_store.similarity_search("your query here")
k— number of results to returnfilter— conditional filtering based on metadata
Similarity metrics & indexing
Embedding similarity may be computed using:- Cosine similarity
- Euclidean distance
- Dot product
Metadata filtering
Filtering by metadata (e.g., source, date) can refine search results:vector_store.similarity_search(
"query",
k=3,
filter={"source": "tweets"}
)
Top integrations
Select embedding model: Select vector store:| Vectorstore | Delete by ID | Filtering | Search by Vector | Search with score | Async | Passes Standard Tests | Multi Tenancy | IDs in add Documents |
|---|---|---|---|---|---|---|---|---|
AstraDBVectorStore | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
AzureCosmosDBNoSqlVectorStore | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ |
AzureCosmosDBMongoVCoreVectorStore | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ |
AsyncCockroachDBVectorStore | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
CouchbaseSearchVectorStore | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
DatabricksVectorSearch | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ |
ElasticsearchStore | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ |
InMemoryVectorStore | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ✅ |
LambdaDB | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
Milvus | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Moorcheh | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
MongoDBAtlasVectorSearch | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
openGauss | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ❌ | ✅ |
PineconeVectorStore | ✅ | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ✅ |
QdrantVectorStore | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
RedisVectorStore | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ |
Weaviate | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
SQLServer | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ |
ValkeyVectorStore | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ |
ZeusDB | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
Oracle AI Database | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
All vector stores
Activeloop Deep Lake
Alibaba Cloud MySQL
Astra DB Vector Store
Azure Cosmos DB Mongo vCore
Azure Cosmos DB No SQL
Azure Database for PostgreSQL - Flexible Server
CockroachDB
Couchbase
Databricks
IBM Db2
Amazon Document DB
Elasticsearch
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
Kinetica
LambdaDB
Lindorm
Amazon MemoryDB
Milvus
Moorcheh
MongoDB Atlas
Oceanbase
openGauss
Oracle AI Database
PGVectorStore
Pinecone
Pinecone (sparse)
Qdrant
Redis
SAP HANA Cloud Vector Engine
SQLServer
SurrealDB
Teradata VectorStore
Valkey
VDMS
veDB for MySQL
Volcengine RDS for MySQL
Weaviate
YDB
ZeusDB
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.
