# RedisSemanticCache

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/cache/RedisSemanticCache)

Cache that uses Redis as a vector-store backend.

## Signature

```python
RedisSemanticCache(
    self,
    redis_url: str,
    embedding: Embeddings,
    score_threshold: float = 0.2,
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `redis_url` | `str` | Yes | URL to connect to Redis. |
| `embedding` | `Embedding` | Yes | Embedding provider for semantic encoding and search. |
| `score_threshold` | `(float, 0.2)` | No |  (default: `0.2`) |

## Extends

- `BaseCache`

## Constructors

```python
__init__(
    self,
    redis_url: str,
    embedding: Embeddings,
    score_threshold: float = 0.2,
)
```

| Name | Type |
|------|------|
| `redis_url` | `str` |
| `embedding` | `Embeddings` |
| `score_threshold` | `float` |


## Properties

- `DEFAULT_SCHEMA`
- `redis_url`
- `embedding`
- `score_threshold`

## Methods

- [`clear()`](https://reference.langchain.com/python/langchain-community/cache/RedisSemanticCache/clear)
- [`lookup()`](https://reference.langchain.com/python/langchain-community/cache/RedisSemanticCache/lookup)
- [`update()`](https://reference.langchain.com/python/langchain-community/cache/RedisSemanticCache/update)

---

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