Skip to main content
These docs will be deprecated and no longer maintained with the release of LangChain v1.0 in October 2025. Visit the v1.0 alpha docs

Metal Retriever

This example shows how to use the Metal Retriever in a retrieval chain to retrieve documents from a Metal index.

Setup

  • npm
  • Yarn
  • pnpm
npm i @getmetal/metal-sdk @langchain/community @langchain/core

Usage

/* eslint-disable @typescript-eslint/no-non-null-assertion */
import Metal from "@getmetal/metal-sdk";
import { MetalRetriever } from "@langchain/community/retrievers/metal";

export const run = async () => {
const MetalSDK = Metal;

const client = new MetalSDK(
process.env.METAL_API_KEY!,
process.env.METAL_CLIENT_ID!,
process.env.METAL_INDEX_ID
);
const retriever = new MetalRetriever({ client });

const docs = await retriever.invoke("hello");

console.log(docs);
};

API Reference:


Was this page helpful?


You can also leave detailed feedback on GitHub.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.