LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraph.storebaseembed
    Module●Since v2.0

    embed

    Attributes

    Functions

    Classes

    View source on GitHub
    attribute
    EmbeddingsFunc: Callable[[Sequence[str]], list[list[float]]]

    Type for synchronous embedding functions.

    The function should take a sequence of strings and return a list of embeddings, where each embedding is a list of floats. The dimensionality of the embeddings should be consistent for all inputs.

    attribute
    AEmbeddingsFunc: Callable[[Sequence[str]], Awaitable[list[list[float]]]]

    Type for asynchronous embedding functions.

    Similar to EmbeddingsFunc, but returns an awaitable that resolves to the embeddings.

    function
    ensure_embeddings

    Ensure that an embedding function conforms to LangChain's Embeddings interface.

    This function wraps arbitrary embedding functions to make them compatible with LangChain's Embeddings interface. It handles both synchronous and asynchronous functions.

    function
    get_text_at_path

    Extract text from an object using a path expression or pre-tokenized path.

    function
    tokenize_path

    Tokenize a path into components.

    Types handled
    • Simple paths: "field1.field2"
    • Array indexing: "[0]", "[*]", "[-1]"
    • Wildcards: "*"
    • Multi-field selection: "{field1,field2}"
    class
    EmbeddingsLambda

    Wrapper to convert embedding functions into LangChain's Embeddings interface.

    This class allows arbitrary embedding functions to be used with LangChain-compatible tools. It supports both synchronous and asynchronous operations, and can handle:

    1. A synchronous function for sync operations (async operations will use sync function)
    2. An async function for both sync/async operations (sync operations will raise an error)

    The embedding functions should convert text into fixed-dimensional vectors that capture the semantic meaning of the text.

    Utilities for working with embedding functions and LangChain's Embeddings interface.

    This module provides tools to wrap arbitrary embedding functions (both sync and async) into LangChain's Embeddings interface. This enables using custom embedding functions with LangChain-compatible tools while maintaining support for both synchronous and asynchronous operations.