LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-corevectorstoresbaseVectorStore
    Class●Since v0.2

    VectorStore

    Interface for vector store.

    Copy
    VectorStore()

    Bases

    ABC

    Used in Docs

    • Fleet AI context integration
    • Moorcheh integration

    Attributes

    attribute
    embeddings: Embeddings | None

    Access the query embedding object if available.

    Methods

    method
    add_texts

    Run more texts through the embeddings and add to the VectorStore.

    method
    delete

    Delete by vector ID or other criteria.

    method
    get_by_ids

    Get documents by their IDs.

    The returned documents are expected to have the ID field set to the ID of the document in the vector store.

    Fewer documents may be returned than requested if some IDs are not found or if there are duplicated IDs.

    Users should not assume that the order of the returned documents matches the order of the input IDs. Instead, users should rely on the ID field of the returned documents.

    This method should NOT raise exceptions if no documents are found for some IDs.

    method
    aget_by_ids

    Async get documents by their IDs.

    The returned documents are expected to have the ID field set to the ID of the document in the vector store.

    Fewer documents may be returned than requested if some IDs are not found or if there are duplicated IDs.

    Users should not assume that the order of the returned documents matches the order of the input IDs. Instead, users should rely on the ID field of the returned documents.

    This method should NOT raise exceptions if no documents are found for some IDs.

    method
    adelete

    Async delete by vector ID or other criteria.

    method
    aadd_texts

    Async run more texts through the embeddings and add to the VectorStore.

    method
    add_documents

    Add or update documents in the VectorStore.

    method
    aadd_documents

    Async run more documents through the embeddings and add to the VectorStore.

    method
    search

    Return docs most similar to query using a specified search type.

    method
    asearch

    Async return docs most similar to query using a specified search type.

    method
    similarity_search

    Return docs most similar to query.

    method
    similarity_search_with_score

    Run similarity search with distance.

    method
    asimilarity_search_with_score

    Async run similarity search with distance.

    method
    similarity_search_with_relevance_scores

    Return docs and relevance scores in the range [0, 1].

    0 is dissimilar, 1 is most similar.

    method
    asimilarity_search_with_relevance_scores

    Async return docs and relevance scores in the range [0, 1].

    0 is dissimilar, 1 is most similar.

    method
    asimilarity_search

    Async return docs most similar to query.

    method
    similarity_search_by_vector

    Return docs most similar to embedding vector.

    method
    asimilarity_search_by_vector

    Async return docs most similar to embedding vector.

    method
    max_marginal_relevance_search

    Return docs selected using the maximal marginal relevance.

    Maximal marginal relevance optimizes for similarity to query AND diversity among selected documents.

    method
    amax_marginal_relevance_search

    Async return docs selected using the maximal marginal relevance.

    Maximal marginal relevance optimizes for similarity to query AND diversity among selected documents.

    method
    max_marginal_relevance_search_by_vector

    Return docs selected using the maximal marginal relevance.

    Maximal marginal relevance optimizes for similarity to query AND diversity among selected documents.

    method
    amax_marginal_relevance_search_by_vector

    Async return docs selected using the maximal marginal relevance.

    Maximal marginal relevance optimizes for similarity to query AND diversity among selected documents.

    method
    from_documents

    Return VectorStore initialized from documents and embeddings.

    method
    afrom_documents

    Async return VectorStore initialized from documents and embeddings.

    method
    from_texts

    Return VectorStore initialized from texts and embeddings.

    method
    afrom_texts

    Async return VectorStore initialized from texts and embeddings.

    method
    as_retriever

    Return VectorStoreRetriever initialized from this VectorStore.

    View source on GitHub