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-corevectorstoresbaseVectorStoreadd_texts
    Methodā—Since v0.2

    add_texts

    Copy
    add_texts(
      self,
      texts: Iterable[str],
      metadatas: list[dict] 
    View source on GitHub
    |
    None
    =
    None
    ,
    *
    ,
    ids
    :
    list
    [
    str
    ]
    |
    None
    =
    None
    ,
    **
    kwargs
    :
    Any
    =
    {
    }
    )
    ->
    list
    [
    str
    ]

    Parameters

    NameTypeDescription
    texts*Iterable[str]

    Iterable of strings to add to the VectorStore.

    metadataslist[dict] | None
    Default:None

    Optional list of metadatas associated with the texts.

    idslist[str] | None
    Default:None
    **kwargsAny
    Default:{}

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

    Optional list of IDs associated with the texts.

    VectorStore specific parameters.

    One of the kwargs should be ids which is a list of ids associated with the texts.