跳到主要内容
此页面介绍如何在 LangChain 中使用 Metal

什么是 Metal?

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

快速开始

首先创建一个 Metal 账户 然后,您可以轻松利用 MetalRetriever 类来开始检索您的数据,用于语义搜索、提示上下文等。此类别接受一个 Metal 实例和要传递给 Metal API 的参数字典。
from langchain_classic.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")

以编程方式连接这些文档到 Claude、VSCode 等,通过 MCP 获取实时答案。
© . This site is unofficial and not affiliated with LangChain, Inc.