LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • MCP Adapters
    Standard Tests
    Text Splitters
    • Overview
    • Agents
    • Callbacks
    • Chains
    • Chat models
    • Embeddings
    • Evaluation
    • Globals
    • Hub
    • Memory
    • Output parsers
    • Retrievers
    • Runnables
    • LangSmith
    • Storage
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    MCP Adapters
    Standard Tests
    Text Splitters
    OverviewAgentsCallbacksChainsChat modelsEmbeddingsEvaluationGlobalsHubMemoryOutput parsersRetrieversRunnablesLangSmithStorage
    Language
    Theme
    Pythonlangchain-classicmemoryentityRedisEntityStore
    Classā—Since v1.0Deprecated

    RedisEntityStore

    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.

    Copy
    RedisEntityStore(
      self,
      session_id: str = 'default',
      url: str = 'redis://localhost:6379/0',
      key_prefix: str = 'memory_store',
      ttl: int | None = 60 * 60 * 24,
      recall_ttl: int | None = 60 * 60 * 24 * 3,
      *args: Any = (),
      **kwargs: Any = {}
    )

    Bases

    BaseEntityStore

    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

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

    recall_ttlint | None
    Default:60 * 60 * 24 * 3

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

    *argsAny
    Default:()

    Additional positional arguments.

    **kwargsAny
    Default:{}

    Additional keyword arguments.

    Constructors

    constructor
    __init__
    NameType
    session_idstr
    urlstr
    key_prefixstr
    ttlint | None
    recall_ttlint | None

    Attributes

    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.

    Methods

    method
    get
    method
    set
    method
    delete
    method
    exists
    method
    clear
    View source on GitHub