Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Experiments with RAG and tools

This is an example project demonstrating how to use Galileo experiments with applications that use RAG and tools.

This code is used in the Run an experiment against a RAG app how-to guide in the Galileo documentation.

Get Started

Install the dependencies:

npm i

Configure environment variables

You will need to configure environment variables to use this project. Copy the .env.example file to .env, then update the environment variables in the .env file with your OpenAI and Galileo values:

# Galileo environment variables
GALILEO_API_KEY=
GALILEO_PROJECT=
GALILEO_LOG_STREAM=

# OpenAI environment variables
OPENAI_API_KEY=

Usage

This sample contains both an application that generates a fake horoscope using a tool and a mock RAG function, as well as an experiment to test the same code.

To run the application, run:

npx tsx app.ts

Traces will be captured and logged to Galileo.

To run the experiment, run:

npx tsx experiment.ts

A link to the results of the experiment will be written to the console.

Project Structure

The project structure is as follows:

rag-and-tools/
├── env.example        # List of environment variables
├── package.json       # NPM project requirements
├── package-lock.json  # NPM project requirements
├── app.ts             # The main python application
├── experiment.ts      # Code to run the main application as an experiment
└── README.md          # Project documentation