> ## 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.

# LocalFileStore integration

> Integrate with the LocalFileStore store using LangChain Python.

This will help you get started with local filesystem [key-value stores](/oss/python/integrations/stores). For detailed documentation of all `LocalFileStore` features and configurations head to the [API reference](https://reference.langchain.com/python/langchain-classic/storage/file_system/LocalFileStore).

## Overview

The `LocalFileStore` is a persistent implementation of `ByteStore` that stores everything in a folder of your choosing. It's useful if you're using a single machine and are tolerant of files being added or deleted.

### Integration details

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

### Installation

The LangChain `LocalFileStore` integration lives in the `langchain` package:

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

## Instantiation

Now we can instantiate our byte store:

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
from pathlib import Path

from langchain_classic.storage import LocalFileStore

root_path = Path.cwd() / "data"  # can also be a path set by a string

kv_store = LocalFileStore(root_path)
```

## 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']
```

You can see the created files in your `data` folder:

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
!ls {root_path}
```

```text theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
key1 key2
```

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 `LocalFileStore` features and configurations, head to the [API reference](https://reference.langchain.com/python/langchain-classic/storage/file_system/LocalFileStore)

***

<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/file_system.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
