0.0.1-alpha.3 • Published 8 months ago

examples-rerank v0.0.1-alpha.3

Weekly downloads
-
License
-
Repository
-
Last release
8 months ago

Re-ranking Results

A simple example showing how to do result re-ranking with RAG using Mastra, OpenAI, and PGVector.

Prerequisites

  • Node.js v20.0+
  • pnpm (recommended) or npm
  • OpenAI API key
  • Postgres connection string

Getting Started

  1. Clone the repository and navigate to the project directory:
git clone https://github.com/mastra-ai/mastra
cd examples/basics/rag/rerank
  1. Copy the environment variables file and add your OpenAI API key:
cp .env.example .env

Then edit .env and add your OpenAI API key:

OPENAI_API_KEY=sk-your-api-key-here
POSTGRES_CONNECTION_STRING=your-postgres-connection-string-here
  1. Install dependencies:
pnpm install
  1. Run the example:
pnpm start
0.0.1-alpha.3

8 months ago