Home / Function/ test_inmemory_dump_load() — langchain Function Reference

test_inmemory_dump_load() — langchain Function Reference

Architecture documentation for the test_inmemory_dump_load() function in test_in_memory.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  938f3fb5_bd40_4866_94e4_5aaa07299b29["test_inmemory_dump_load()"]
  a974d690_d5fa_ba65_671d_ce8278eefe7d["test_in_memory.py"]
  938f3fb5_bd40_4866_94e4_5aaa07299b29 -->|defined in| a974d690_d5fa_ba65_671d_ce8278eefe7d
  style 938f3fb5_bd40_4866_94e4_5aaa07299b29 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/vectorstores/test_in_memory.py lines 86–98

def test_inmemory_dump_load(tmp_path: Path) -> None:
    """Test end to end construction and search."""
    embedding = DeterministicFakeEmbedding(size=6)
    store = InMemoryVectorStore.from_texts(["foo", "bar", "baz"], embedding)
    output = store.similarity_search("foo", k=1)

    test_file = str(tmp_path / "test.json")
    store.dump(test_file)

    loaded_store = InMemoryVectorStore.load(test_file, embedding)
    loaded_output = loaded_store.similarity_search("foo", k=1)

    assert output == loaded_output

Domain

Subdomains

Frequently Asked Questions

What does test_inmemory_dump_load() do?
test_inmemory_dump_load() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/vectorstores/test_in_memory.py.
Where is test_inmemory_dump_load() defined?
test_inmemory_dump_load() is defined in libs/core/tests/unit_tests/vectorstores/test_in_memory.py at line 86.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free