> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-docsby-1791319236-3be7a15.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Store integrations

> Integrate with stores using LangChain JavaScript.

## Overview

LangChain provides a key-value store interface for storing and retrieving data by key. The key-value store interface in LangChain is primarily used for caching [embeddings](/oss/javascript/integrations/embeddings).

## Interface

All [`BaseStores`](https://reference.langchain.com/javascript/langchain-core/stores/BaseStore) are **generic** and support the following interface, where `K` represents the key type and `V` represents the value type:

* `mget(keys: K[]): Promise<(V | undefined)[]>`: get the values for multiple keys, returning `undefined` if a key does not exist
* `mset(keyValuePairs: [K, V][]): Promise<void>`: set the values for multiple keys
* `mdelete(keys: K[]): Promise<void>`: delete multiple keys
* `yieldKeys(prefix?: string): AsyncGenerator<K | string>`: asynchronously yield all keys in the store, optionally filtering by a prefix

The generic nature of the interface allows you to use different types for keys and values. For example, `BaseStore<string, BaseMessage>` would store messages with string keys, while `BaseStore<string, number[]>` would store arrays of numbers.

<Note>
  Base stores are designed to work with **multiple** key-value pairs at once for efficiency. This saves on network round-trips and may allow for more efficient batch operations in the underlying store.
</Note>

## Built-in stores for local development

<Columns cols={2}>
  <Card title="InMemoryStore" icon="link" href="/oss/javascript/integrations/stores/in_memory" arrow="true" cta="View guide" />

  <Card title="LocalFileStore" icon="link" href="/oss/javascript/integrations/stores/file_system" arrow="true" cta="View guide" />
</Columns>

## Custom stores

You can also implement your own custom store by extending the [`BaseStore`](https://reference.langchain.com/javascript/langchain-core/stores/BaseStore) class. See the [store interface documentation](https://reference.langchain.com/javascript/langchain-core/stores/BaseStore) for more details.

## All key-value stores

<div class="integration-downloads-table">
  | Integration | Downloads |
  | :- | :- |
  | [`AlBuddyMemoryStore`](https://github.com/flytomoon/al-buddy-memory/blob/main/docs/integrations/langchain.md) | <span data-sort-value="2091"><a href="https://www.npmjs.com/package/al-buddy-memory" target="_blank">  <img src="https://img.shields.io/npm/dm/al-buddy-memory?style=flat-square&label=%20&" alt="Downloads per month" noZoom class="rounded not-prose" /></a></span> |
  | [`InMemoryStore`](/oss/javascript/integrations/stores/in_memory) | <span data-sort-value="-1">N/A</span> |
  | [`LocalFileStore`](/oss/javascript/integrations/stores/file_system) | <span data-sort-value="-1">N/A</span> |
</div>

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to your agent of choice 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/javascript/integrations/stores/index.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
