Overview

LangChain은 키로 데이터를 저장하고 검색하기 위한 key-value store 인터페이스를 제공합니다. LangChain의 key-value store 인터페이스는 주로 embeddings 캐싱에 사용됩니다.

Interface

모든 BaseStores는 다음 인터페이스를 지원합니다:
  • mget(key: Sequence[str]) -> List[Optional[bytes]]: 여러 키의 내용을 가져오며, 키가 존재하지 않으면 None을 반환합니다
  • mset(key_value_pairs: Sequence[Tuple[str, bytes]]) -> None: 여러 키의 내용을 설정합니다
  • mdelete(key: Sequence[str]) -> None: 여러 키를 삭제합니다
  • yield_keys(prefix: Optional[str] = None) -> Iterator[str]: store의 모든 키를 yield하며, 선택적으로 prefix로 필터링할 수 있습니다
Base store는 효율성을 위해 여러 key-value 쌍을 한 번에 처리하도록 설계되었습니다. 이는 네트워크 왕복을 줄이고 기본 store에서 더 효율적인 배치 작업을 가능하게 할 수 있습니다.

Built-in stores for local development

Custom stores

BaseStore 클래스를 확장하여 자체 custom store를 구현할 수도 있습니다. 자세한 내용은 store interface documentation을 참조하세요.

All key-value stores


Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.
I