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

    afrom_texts

    Async return VectorStore initialized from texts and embeddings.

    Copy
    afrom_texts(
      cls,
      texts: list[str],
      embedding: Embeddings,
      metadatas: list[dict] | None = None,
      *,
      ids: list[str] | None = None,
      **kwargs: Any = {}
    ) -> Self

    Parameters

    NameTypeDescription
    texts*list[str]

    Texts to add to the VectorStore.

    embedding*Embeddings

    Embedding function to use.

    metadataslist[dict] | None
    Default:None

    Optional list of metadatas associated with the texts.

    idslist[str] | None
    Default:None

    Optional list of IDs associated with the texts.

    **kwargsAny
    Default:{}

    Additional keyword arguments.

    View source on GitHub