Skip to main content
Open on GitHub

Metal

本页面介绍了如何在LangChain中使用Metal。

什么是Metal?​

Metal 是一个为生产环境构建的托管检索和记忆平台。轻松将您的数据索引到 Metal 并对其运行语义搜索和检索。

Screenshot of the Metal dashboard showing the Browse Index feature with sample data.

快速入门​

通过 创建 Metal 账户 开始。

然后,您可以轻松利用 MetalRetriever 类来开始检索您的数据以进行语义搜索、提示上下文等。该类接收一个 Metal 实例以及传递给 Metal API 的参数字典。

from langchain.retrievers import MetalRetriever
from metal_sdk.metal import Metal


metal = Metal("API_KEY", "CLIENT_ID", "INDEX_ID");
retriever = MetalRetriever(metal, params={"limit": 2})

docs = retriever.invoke("search term")
API 参考:MetalRetriever