# RedisEntityStore

> **Class** in `langchain_classic`

📖 [View in docs](https://reference.langchain.com/python/langchain-classic/memory/entity/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.

## Signature

```python
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 = {},
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `session_id` | `str` | No | Unique identifier for the session. (default: `'default'`) |
| `url` | `str` | No | URL of the Redis server. (default: `'redis://localhost:6379/0'`) |
| `key_prefix` | `str` | No | Prefix for keys in the Redis store. (default: `'memory_store'`) |
| `ttl` | `int \| None` | No | Time-to-live for keys in seconds (default 1 day). (default: `60 * 60 * 24`) |
| `recall_ttl` | `int \| None` | No | Time-to-live extension for keys when recalled (default 3 days). (default: `60 * 60 * 24 * 3`) |
| `*args` | `Any` | No | Additional positional arguments. (default: `()`) |
| `**kwargs` | `Any` | No | Additional keyword arguments. (default: `{}`) |

## Extends

- `BaseEntityStore`

## Constructors

```python
__init__(
    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 = {},
)
```

| Name | Type |
|------|------|
| `session_id` | `str` |
| `url` | `str` |
| `key_prefix` | `str` |
| `ttl` | `int \| None` |
| `recall_ttl` | `int \| None` |


## Properties

- `redis_client`
- `session_id`
- `key_prefix`
- `ttl`
- `recall_ttl`
- `full_key_prefix`

## Methods

- [`get()`](https://reference.langchain.com/python/langchain-classic/memory/entity/RedisEntityStore/get)
- [`set()`](https://reference.langchain.com/python/langchain-classic/memory/entity/RedisEntityStore/set)
- [`delete()`](https://reference.langchain.com/python/langchain-classic/memory/entity/RedisEntityStore/delete)
- [`exists()`](https://reference.langchain.com/python/langchain-classic/memory/entity/RedisEntityStore/exists)
- [`clear()`](https://reference.langchain.com/python/langchain-classic/memory/entity/RedisEntityStore/clear)

## ⚠️ Deprecated

Deprecated since version 0.3.1.

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/fb6ab993a73180538f6cca876b3c85d46c08845f/libs/langchain/langchain_classic/memory/entity.py#L211)