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-coreindexingbaseDocumentIndexaupsert
    Method●Since v0.2

    aupsert

    Add or update documents in the VectorStore. Async version of upsert.

    The upsert functionality should utilize the ID field of the item if it is provided. If the ID is not provided, the upsert method is free to generate an ID for the item.

    When an ID is specified and the item already exists in the VectorStore, the upsert method should update the item with the new data. If the item does not exist, the upsert method should add the item to the VectorStore.

    Copy
    aupsert(
      self,
      items: Sequence[Document],
      ,
      **kwargs: Any = {}
    ) -> UpsertResponse

    Parameters

    NameTypeDescription
    items*Sequence[Document]

    Sequence of documents to add to the VectorStore.

    **kwargsAny
    Default:{}

    Additional keyword arguments.

    View source on GitHub