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-classicmemoryentityRedisEntityStore
    Class●Since v1.0Deprecated

    RedisEntityStore

    Copy
    RedisEntityStore(
      self,
      session_id: str = 'default',
      url: str = 'redis://localhost:6379/0',
      key_prefix:

    Bases

    BaseEntityStore

    Constructors

    Attributes

    Methods

    View source on GitHub
    str
    =
    'memory_store'
    ,
    ttl
    :
    int
    |
    None
    =
    60
    *
    60
    *
    24
    ,
    recall_ttl
    :
    int
    |
    None
    =
    60
    *
    60
    *
    24
    *
    3
    ,
    *
    args
    :
    Any
    =
    (
    )
    ,
    **
    kwargs
    :
    Any
    =
    {
    }
    )

    Parameters

    NameTypeDescription
    session_idstr
    Default:'default'

    Unique identifier for the session.

    urlstr
    Default:'redis://localhost:6379/0'

    URL of the Redis server.

    key_prefixstr
    Default:'memory_store'

    Prefix for keys in the Redis store.

    ttlint | None
    Default:60 * 60 * 24
    recall_ttlint | None
    Default:60 * 60 * 24 * 3
    *argsAny
    Default:()
    **kwargsAny
    Default:{}
    constructor
    __init__
    NameType
    session_idstr
    urlstr
    key_prefixstr
    ttlint | None
    recall_ttlint | None
    attribute
    redis_client: Any
    attribute
    session_id: str
    attribute
    key_prefix: str
    attribute
    ttl: int | None
    attribute
    recall_ttl: int | None
    attribute
    full_key_prefix: str

    Returns the full key prefix with session ID.

    method
    get
    method
    set
    method
    delete
    method
    exists
    method
    clear

    Redis-backed Entity store.

    Entities get a TTL of 1 day by default, and that TTL is extended by 3 days every time the entity is read back.

    Time-to-live for keys in seconds (default 1 day).

    Time-to-live extension for keys when recalled (default 3 days).

    Additional positional arguments.

    Additional keyword arguments.