Skip to main content

Llama Researcher is an autonomous agent designed for comprehensive online research on a variety of tasks.

Project description

🔎 GPT Researcher

Official Website Discord Follow

GitHub Repo stars Twitter Follow PyPI version

GPT Researcher is an autonomous agent designed for comprehensive online research on a variety of tasks.

The agent can produce detailed, factual and unbiased research reports, with customization options for focusing on relevant resources, outlines, and lessons. Inspired by the recent Plan-and-Solve and RAG papers, GPT Researcher addresses issues of speed, determinism and reliability, offering a more stable performance and increased speed through parallelized agent work, as opposed to synchronous operations.

Our mission is to empower individuals and organizations with accurate, unbiased, and factual information by leveraging the power of AI.

Why GPT Researcher?

  • To form objective conclusions for manual research tasks can take time, sometimes weeks to find the right resources and information.
  • Current LLMs are trained on past and outdated information, with heavy risks of hallucinations, making them almost irrelevant for research tasks.
  • Services that enable web search (such as ChatGPT + Web Plugin), only consider limited sources and content that in some cases result in superficial and biased answers.
  • Using only a selection of web sources can create bias in determining the right conclusions for research tasks.

Demo

https://github.com/assafelovic/gpt-researcher/assets/13554167/dd6cf08f-b31e-40c6-9907-1915f52a7110

Architecture

The main idea is to run "planner" and "execution" agents, whereas the planner generates questions to research, and the execution agents seek the most related information based on each generated research question. Finally, the planner filters and aggregates all related information and creates a research report.

The agents leverage both gpt3.5-turbo and gpt-4-turbo (128K context) to complete a research task. We optimize for costs using each only when necessary. The average research task takes around 3 minutes to complete, and costs ~$0.1.

More specifically:

  • Create a domain specific agent based on research query or task.
  • Generate a set of research questions that together form an objective opinion on any given task.
  • For each research question, trigger a crawler agent that scrapes online resources for information relevant to the given task.
  • For each scraped resources, summarize based on relevant information and keep track of its sources.
  • Finally, filter and aggregate all summarized sources and generate a final research report.

Tutorials

Features

  • 📝 Generate research, outlines, resources and lessons reports
  • 📜 Can generate long and detailed research reports (over 2K words)
  • 🌐 Aggregates over 20 web sources per research to form objective and factual conclusions
  • 🖥️ Includes an easy-to-use web interface (HTML/CSS/JS)
  • 🔍 Scrapes web sources with javascript support
  • 📂 Keeps track and context of visited and used web sources
  • 📄 Export research reports to PDF, Word and more...

📖 Documentation

Please see here for full documentation on:

  • Getting started (installation, setting up the environment, simple examples)
  • Customization and configuration
  • How-To examples (demos, integrations, docker support)
  • Reference (full API docs)

⚙️ Getting Started

Installation

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

Step 1 - Download the project and navigate to its directory

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

Step 3 - Set up API keys using two methods: exporting them directly or storing them in a .env file.

For Linux/Windows temporary setup, use the export method:

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

For a more permanent setup, create a .env file in the current gpt-researcher directory and input the env vars (without export).

  • 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.
  • For web search API, we recommend Tavily Search API, but you can also refer to other search APIs of your choice by changing the search provider in config/config.py to "duckduckgo", "googleAPI", "bing", "googleSerp", "searx" and more. Then add the corresponding env API key as seen in the config.py file.

Quickstart

Step 1 - Install dependencies

pip install -r requirements.txt

Step 2 - Run the agent with FastAPI

uvicorn main:app --reload

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


To learn how to get started with Docker, Poetry or a virtual environment check out the documentation page.

Run as PIP package

pip install gpt-researcher
from researcher import Researcher

query = "why is Nvidia stock going up?"
researcher = Researcher(query=query, report_type="research_report")
# Conduct research on the given query
research_result = await researcher.conduct_research()
# Write the report
report = await researcher.write_report()

For more examples and configurations, please refer to the PIP documentation page.

👪 Multi-Agent Assistant

As AI evolves from prompt engineering and RAG to multi-agent systems, we're excited to introduce our new multi-agent assistant built with LangGraph.

By using LangGraph, the research process can be significantly improved in depth and quality by leveraging multiple agents with specialized skills. Inspired by the recent STORM paper, this project showcases how a team of AI agents can work together to conduct research on a given topic, from planning to publication.

An average run generates a 5-6 page research report in multiple formats such as PDF, Docx and Markdown.

Check it out here or head over to our documentation for more information.

🚀 Contributing

We highly welcome contributions! Please check out contributing if you're interested.

Please check out our roadmap page and reach out to us via our Discord community if you're interested in joining our mission.

✉️ Support / Contact us

🛡 Disclaimer

This project, GPT Researcher, is an experimental application and is provided "as-is" without any warranty, express or implied. We are sharing codes for academic purposes under the MIT license. Nothing herein is academic advice, and NOT a recommendation to use in academic or research papers.

Our view on unbiased research claims:

  1. The main goal of GPT Researcher is to reduce incorrect and biased facts. How? We assume that the more sites we scrape the less chances of incorrect data. By scraping over 20 sites per research, and choosing the most frequent information, the chances that they are all wrong is extremely low.
  2. We do not aim to eliminate biases; we aim to reduce it as much as possible. We are here as a community to figure out the most effective human/llm interactions.
  3. In research, people also tend towards biases as most have already opinions on the topics they research about. This tool scrapes many opinions and will evenly explain diverse views that a biased person would never have read.

Please note that the use of the GPT-4 language model can be expensive due to its token usage. By utilizing this project, you acknowledge that you are responsible for monitoring and managing your own token usage and the associated costs. It is highly recommended to check your OpenAI API usage regularly and set up any necessary limits or alerts to prevent unexpected charges.


Star History Chart

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Researcher-0.4.3.tar.gz (34.7 kB view details)

Uploaded Source

Built Distribution

Researcher-0.4.3-py3-none-any.whl (50.7 kB view details)

Uploaded Python 3

File details

Details for the file Researcher-0.4.3.tar.gz.

File metadata

  • Download URL: Researcher-0.4.3.tar.gz
  • Upload date:
  • Size: 34.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.12

File hashes

Hashes for Researcher-0.4.3.tar.gz
Algorithm Hash digest
SHA256 4a1b4caa381659bb3cd2a6c877a19c54f88caa0dbccc775ddc4e39160bd39e6e
MD5 fcf9f3138c4f225240a4f8ec7ea80ac4
BLAKE2b-256 631915ad639981d9003fa2c04e4e425ca5ef04ddb36161c1fb603957ce845d7a

See more details on using hashes here.

File details

Details for the file Researcher-0.4.3-py3-none-any.whl.

File metadata

  • Download URL: Researcher-0.4.3-py3-none-any.whl
  • Upload date:
  • Size: 50.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.12

File hashes

Hashes for Researcher-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ba35adb9442f0daf8aea6e8edec9aed0e8bdfa663cada7aaf0c85b6c909174fb
MD5 108e894a80d4ba96a809b3a354415508
BLAKE2b-256 e2246356280275be8c17646b38a9e28ceb4f518135f13277253ef5b7802af338

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page