AI Settings

API Key

Web Search (EXA)

Supabase Vector Store

Environment Variables

Add these to your .env.local file:

OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key
GROQ_API_KEY=your_groq_api_key
GOOGLE_API_KEY=your_google_api_key
DEEPSEEK_API_KEY=your_deepseek_api_key
FIREWORKS_API_KEY=your_fireworks_api_key

Current Selection

Provider: OpenAI
Model: GPT-4o Mini
Max Tokens: 16,384
Context Window: 16,384
β–² + πŸ¦œπŸ”—
  • πŸ”— This template showcases how to perform retrieval with a LangChain.js chain and the Vercel AI SDK in a Next.js project.
  • πŸͺœ The chain works in two steps:
  • 1️⃣ First, it rephrases the input question into a "standalone" question, dereferencing pronouns based on the chat history.
  • 2️⃣ Then, it queries the retriever for documents similar to the dereferenced question and composes an answer.
  • πŸ’» You can find the prompt and model logic for this use-case in app/api/chat/retrieval/route.ts.
  • 🐢 By default, the agent is pretending to be a talking puppy, but you can change the prompt to whatever you want!
  • 🎨 The main frontend logic is found in app/retrieval/page.tsx.
  • πŸ”± Before running this example on your own, you'll first need to set up a Supabase vector store. See the README for more details.
  • πŸ‘‡ Upload some text, then try asking e.g. What is a document loader? below!