LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • MCP Adapters
    • Overview
    • Agents
    • Callbacks
    • Chains
    • Chat models
    • Embeddings
    • Evaluation
    • Globals
    • Hub
    • Memory
    • Output parsers
    • Retrievers
    • Runnables
    • LangSmith
    • Storage
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    MCP Adapters
    OverviewAgentsCallbacksChainsChat modelsEmbeddingsEvaluationGlobalsHubMemoryOutput parsersRetrieversRunnablesLangSmithStorage
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-classicretrieversparent_document_retrieverParentDocumentRetrieveraadd_documents
    Method●Since v1.0

    aadd_documents

    Adds documents to the docstore and vectorstores.

    Copy
    aadd_documents(
      self,
      documents: list[Document],
      ids: list[str] | None = None,
      add_to_docstore: bool = True,
      **kwargs: Any = {}
    ) -> None

    Parameters

    NameTypeDescription
    documents*list[Document]

    List of documents to add

    idslist[str] | None
    Default:None

    Optional list of IDs for documents. If provided should be the same length as the list of documents. Can be provided if parent documents are already in the document store and you don't want to re-add to the docstore. If not provided, random UUIDs will be used as idIDss.

    add_to_docstorebool
    Default:True

    Boolean of whether to add documents to docstore. This can be false if and only if ids are provided. You may want to set this to False if the documents are already in the docstore and you don't want to re-add them.

    **kwargsAny
    Default:{}

    additional keyword arguments passed to the VectorStore.

    View source on GitHub