Skip to main content

ChatGPT Plugin Retriever

This example shows how to use the ChatGPT Retriever Plugin within LangChain.

To set up the ChatGPT Retriever Plugin, please follow instructions here.


import { ChatGPTPluginRetriever } from "langchain/retrievers/remote";

export const run = async () => {
const retriever = new ChatGPTPluginRetriever({
url: "",
auth: {
bearer: "super-secret-jwt-token-with-at-least-32-characters-long",

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


API Reference:

Help us out by providing feedback on this documentation page: