InMemoryStore Class — langchain Architecture
Architecture documentation for the InMemoryStore class in stores.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 92f0697d_8332_eb1c_9955_e3d4bc74877a["InMemoryStore"] f0969880_8c80_c0b9_0855_568e385cf51f["stores.py"] 92f0697d_8332_eb1c_9955_e3d4bc74877a -->|defined in| f0969880_8c80_c0b9_0855_568e385cf51f
Relationship Graph
Source Code
libs/core/langchain_core/stores.py lines 244–264
class InMemoryStore(InMemoryBaseStore[Any]):
"""In-memory store for any type of data.
Attributes:
store: The underlying dictionary that stores the key-value pairs.
Examples:
```python
from langchain.storage import InMemoryStore
store = InMemoryStore()
store.mset([("key1", "value1"), ("key2", "value2")])
store.mget(["key1", "key2"])
# ['value1', 'value2']
store.mdelete(["key1"])
list(store.yield_keys())
# ['key2']
list(store.yield_keys(prefix="k"))
# ['key2']
```
"""
Defined In
Source
Frequently Asked Questions
What is the InMemoryStore class?
InMemoryStore is a class in the langchain codebase, defined in libs/core/langchain_core/stores.py.
Where is InMemoryStore defined?
InMemoryStore is defined in libs/core/langchain_core/stores.py at line 244.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free