> ## Documentation Index
> Fetch the complete documentation index at: https://www.getmaxim.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Inmemory

> Inmemory utilities for caching mechanisms and utilities for optimizing performance.

[View module source on GitHub](https://github.com/maximhq/maxim-py/blob/main/maxim/cache/inMemory.py)

## [MaximInMemoryCache](/sdk/python/references/cache/inMemory)

```python theme={null}
class MaximInMemoryCache()
```

In-memory cache implementation for [Maxim](/sdk/python/references/maxim).

This class provides a simple in-memory cache implementation
that stores key-value pairs in a dictionary.

#### \_\_init\_\_

```python theme={null}
def __init__()
```

Initialize the in-memory cache.

#### get\_all\_keys

```python theme={null}
def get_all_keys() -> List[str]
```

Get all keys currently stored in the cache.

#### get

```python theme={null}
def get(key: str) -> Optional[str]
```

Get a value from the cache by its key.

#### set

```python theme={null}
def set(key: str, value: str) -> None
```

Store a key-value pair in the cache.

#### delete

```python theme={null}
def delete(key: str) -> None
```

Remove a key-value pair from the cache.
