Skip to main content

Getting Started

Quickstart

Step 0 - Install Python 3.11 or later. See here for a step-by-step guide.

Step 1 - Download the project

$ git clone https://github.com/assafelovic/gpt-researcher.git
$ cd gpt-researcher

Step 2 - Install dependencies

$ pip install -r requirements.txt

Step 3 - Create .env file with your OpenAI Key and Tavily API key or simply export it

$ export OPENAI_API_KEY={Your OpenAI API Key here}
$ export TAVILY_API_KEY={Your Tavily API Key here}
  • For LLM, we recommend OpenAI GPT, but you can use any other LLM model (including open sources) supported by Langchain Adapter, simply change the llm model and provider in config/config.py. Follow this guide to learn how to integrate LLMs with Langchain.
  • For search engine, we recommend Tavily Search API (optimized for LLMs), but you can also refer to other search engines of your choice by changing the search provider in config/config.py to "duckduckgo", "googleAPI", "googleSerp", or "searx". Then add the corresponding env API key as seen in the config.py file.
  • We highly recommend using OpenAI GPT models and Tavily Search API for optimal performance.

Step 4 - Run the agent with FastAPI

$ uvicorn main:app --reload

Step 5 - Go to http://localhost:8000 on any browser and enjoy researching!

Try it with Docker

Step 1 - Install Docker

Follow instructions at https://docs.docker.com/engine/install/

Step 2 - Create .env file with your OpenAI Key or simply export it

$ export OPENAI_API_KEY={Your API Key here}
$ export TAVILY_API_KEY={Your Tavily API Key here}

Step 3 - Run the application

$ docker-compose up

Step 4 - Go to http://localhost:8000 on any browser and enjoy researching!

Try it with PIP Pacakge