# RedisStore

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/storage/redis/RedisStore)

BaseStore implementation using Redis as the underlying store.

## Signature

```python
RedisStore(
    self,
    *,
    client: Any = None,
    redis_url: Optional[str] = None,
    client_kwargs: Optional[dict] = None,
    ttl: Optional[int] = None,
    namespace: Optional[str] = None,
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `client` | `Any` | No | A Redis connection instance (default: `None`) |
| `redis_url` | `Optional[str]` | No | redis url (default: `None`) |
| `client_kwargs` | `Optional[dict]` | No | Keyword arguments to pass to the Redis client (default: `None`) |
| `ttl` | `Optional[int]` | No | time to expire keys in seconds if provided,  if None keys will never expire (default: `None`) |
| `namespace` | `Optional[str]` | No | if provided, all keys will be prefixed with this namespace (default: `None`) |

## Extends

- `ByteStore`

## Constructors

```python
__init__(
    self,
    *,
    client: Any = None,
    redis_url: Optional[str] = None,
    client_kwargs: Optional[dict] = None,
    ttl: Optional[int] = None,
    namespace: Optional[str] = None,
) -> None
```

| Name | Type |
|------|------|
| `client` | `Any` |
| `redis_url` | `Optional[str]` |
| `client_kwargs` | `Optional[dict]` |
| `ttl` | `Optional[int]` |
| `namespace` | `Optional[str]` |


## Properties

- `client`
- `ttl`
- `namespace`

## Methods

- [`mget()`](https://reference.langchain.com/python/langchain-community/storage/redis/RedisStore/mget)
- [`mset()`](https://reference.langchain.com/python/langchain-community/storage/redis/RedisStore/mset)
- [`mdelete()`](https://reference.langchain.com/python/langchain-community/storage/redis/RedisStore/mdelete)
- [`yield_keys()`](https://reference.langchain.com/python/langchain-community/storage/redis/RedisStore/yield_keys)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/4b280287bd55b99b44db2dd849f02d66c89534d5/libs/community/langchain_community/storage/redis.py#L8)