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

# InMemoryByteStore integration

> Integrate with the InMemoryByteStore store using LangChain Python.

This guide will help you get started with in-memory [key-value stores](/oss/python/integrations/stores). For detailed documentation of all `InMemoryByteStore` features and configurations head to the [API reference](https://reference.langchain.com/python/langchain-core/stores/InMemoryByteStore).

## Overview

The `InMemoryByteStore` is a non-persistent implementation of a `ByteStore` that stores everything in a Python dictionary. It's intended for demos and cases where you don't need persistence past the lifetime of the Python process.

### Integration details

| Class                                                                                                 | Package                                                                   | Local | [JS support](https://js.langchain.com/docs/integrations/stores/in_memory/) |                                            Downloads                                            |                                            Version                                           |
| :---------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------ | :---: | :------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------: |
| [`InMemoryByteStore`](https://reference.langchain.com/python/langchain-core/stores/InMemoryByteStore) | [`langchain-core`](https://reference.langchain.com/python/langchain-core) |   ✅   |                                      ✅                                     | ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain_core?style=flat-square\&label=%20) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain_core?style=flat-square\&label=%20) |

### Installation

The LangChain `InMemoryByteStore` integration lives in the `langchain-core` package:

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
pip install -qU langchain-core
```

## Instantiation

Now you can instantiate your byte store:

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
from langchain_core.stores import InMemoryByteStore

kv_store = InMemoryByteStore()
```

## Usage

You can set data under keys like this using the `mset` method:

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
kv_store.mset(
    [
        ["key1", b"value1"],
        ["key2", b"value2"],
    ]
)

kv_store.mget(
    [
        "key1",
        "key2",
    ]
)
```

```text theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
[b'value1', b'value2']
```

And you can delete data using the `mdelete` method:

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
kv_store.mdelete(
    [
        "key1",
        "key2",
    ]
)

kv_store.mget(
    [
        "key1",
        "key2",
    ]
)
```

```text theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
[None, None]
```

***

## API reference

For detailed documentation of all `InMemoryByteStore` features and configurations, head to the [API reference](https://reference.langchain.com/python/langchain-core/stores/InMemoryByteStore)

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/python/integrations/stores/in_memory.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
