# InMemoryDocumentIndex

> **Class** in `langchain_core`

📖 [View in docs](https://reference.langchain.com/python/langchain-core/indexing/in_memory/InMemoryDocumentIndex)

In memory document index.

This is an in-memory document index that stores documents in a dictionary.

It provides a simple search API that returns documents by the number of
counts the given query appears in the document.

## Signature

```python
InMemoryDocumentIndex(
    self,
    *args: Any = (),
    **kwargs: Any = {},
)
```

## Extends

- `DocumentIndex`

## Properties

- `store`
- `top_k`

## Methods

- [`upsert()`](https://reference.langchain.com/python/langchain-core/indexing/in_memory/InMemoryDocumentIndex/upsert)
- [`delete()`](https://reference.langchain.com/python/langchain-core/indexing/in_memory/InMemoryDocumentIndex/delete)
- [`get()`](https://reference.langchain.com/python/langchain-core/indexing/in_memory/InMemoryDocumentIndex/get)

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/9f232caa7a8fe1ca042a401942d5d90d54ceb1a6/libs/core/langchain_core/indexing/in_memory.py#L18)