create_kv_docstore() — langchain Function Reference
Architecture documentation for the create_kv_docstore() function in _lc_store.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 6896bb51_3719_86a4_4161_a27cf2759c97["create_kv_docstore()"] b62a282c_e004_7e47_33d5_aaacd87a9220["_lc_store.py"] 6896bb51_3719_86a4_4161_a27cf2759c97 -->|defined in| b62a282c_e004_7e47_33d5_aaacd87a9220 style 6896bb51_3719_86a4_4161_a27cf2759c97 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/langchain_classic/storage/_lc_store.py lines 70–92
def create_kv_docstore(
store: ByteStore,
*,
key_encoder: Callable[[str], str] | None = None,
) -> BaseStore[str, Document]:
"""Create a store for langchain `Document` objects from a bytes store.
This store does run time type checking to ensure that the values are
`Document` objects.
Args:
store: A bytes store to use as the underlying store.
key_encoder: A function to encode keys; if `None`, uses identity function.
Returns:
A key-value store for `Document` objects.
"""
return EncoderBackedStore(
store,
key_encoder or _identity,
_dump_document_as_bytes,
_load_document_from_bytes,
)
Domain
Subdomains
Source
Frequently Asked Questions
What does create_kv_docstore() do?
create_kv_docstore() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/storage/_lc_store.py.
Where is create_kv_docstore() defined?
create_kv_docstore() is defined in libs/langchain/langchain_classic/storage/_lc_store.py at line 70.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free