# InMemorySemanticCache

> **Class** in `langchain_aws`

📖 [View in docs](https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/cache/InMemorySemanticCache)

Cache that uses MemoryDB as a vector-store backend.

## Signature

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

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `redis_url` | `str` | Yes | URL to connect to MemoryDB. |
| `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-aws/vectorstores/inmemorydb/cache/InMemorySemanticCache/clear)
- [`lookup()`](https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/cache/InMemorySemanticCache/lookup)
- [`update()`](https://reference.langchain.com/python/langchain-aws/vectorstores/inmemorydb/cache/InMemorySemanticCache/update)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-aws/blob/2f5e41cef9442ec840c0d8401e34dea74b061ba0/libs/aws/langchain_aws/vectorstores/inmemorydb/cache.py#L129)