Momento Cache는 세계 최초의 진정한 serverless 캐싱 서비스로, 즉각적인 탄력성, scale-to-zero 기능, 그리고 매우 빠른 성능을 제공합니다. Momento Vector Index는 가장 생산적이고 사용하기 쉬운 완전한 serverless vector index로 돋보입니다. 두 서비스 모두 SDK를 다운로드하고, API key를 받아서, 코드에 몇 줄만 입력하면 바로 사용할 수 있습니다. 이들은 함께 LLM 데이터 요구사항을 위한 포괄적인 솔루션을 제공합니다.
이 페이지는 LangChain 내에서 Momento 생태계를 사용하는 방법을 다룹니다.

설치 및 설정

  • 여기에서 무료 계정에 가입하여 API key를 받으세요
  • pip install momento로 Momento Python SDK를 설치하세요

Cache

Momento를 LLM prompt와 response를 위한 serverless, 분산, 저지연 cache로 사용하세요. 표준 cache는 모든 환경에서 Momento 사용자의 주요 사용 사례입니다. Momento Cache를 애플리케이션에 통합하려면:
from langchain.cache import MomentoCache
그런 다음 다음 코드로 설정하세요:
from datetime import timedelta
from momento import CacheClient, Configurations, CredentialProvider
from langchain.globals import set_llm_cache

# Instantiate the Momento client
cache_client = CacheClient(
    Configurations.Laptop.v1(),
    CredentialProvider.from_environment_variable("MOMENTO_API_KEY"),
    default_ttl=timedelta(days=1))

# Choose a Momento cache name of your choice
cache_name = "langchain"

# Instantiate the LLM cache
set_llm_cache(MomentoCache(cache_client, cache_name))

Vector Store

Momento Vector Index (MVI)는 vector store로 사용할 수 있습니다. MVI를 vector store로 사용하는 방법에 대한 안내는 이 노트북을 참조하세요.
from langchain_community.vectorstores import MomentoVectorIndex

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