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-corestoresBaseStore
    Class●Since v0.1

    BaseStore

    Abstract interface for a key-value store.

    This is an interface that's meant to abstract away the details of different key-value stores. It provides a simple interface for getting, setting, and deleting key-value pairs.

    The basic methods are mget, mset, and mdelete for getting, setting, and deleting multiple key-value pairs at once. The yield_keys method is used to iterate over keys that match a given prefix.

    The async versions of these methods are also provided, which are meant to be used in async contexts. The async methods are named with an a prefix, e.g., amget, amset, amdelete, and ayield_keys.

    By default, the amget, amset, amdelete, and ayield_keys methods are implemented using the synchronous methods. If the store can natively support async operations, it should override these methods.

    By design the methods only accept batches of keys and values, and not single keys or values. This is done to force user code to work with batches which will usually be more efficient by saving on round trips to the store.

    Copy
    BaseStore()

    Bases

    ABCGeneric[K, V]

    Used in Docs

    • Fleet AI context integration

    Methods

    method
    mget

    Get the values associated with the given keys.

    method
    amget

    Async get the values associated with the given keys.

    method
    mset

    Set the values for the given keys.

    method
    amset

    Async set the values for the given keys.

    method
    mdelete

    Delete the given keys and their associated values.

    method
    amdelete

    Async delete the given keys and their associated values.

    method
    yield_keys

    Get an iterator over keys that match the given prefix.

    method
    ayield_keys

    Async get an iterator over keys that match the given prefix.

    View source on GitHub