GPT Researcher (gptr)

About

GPT Researcher is an autonomous agent that takes care of the tedious task of research for you, by scraping, filtering and aggregating over 20+ web sources per a single research task.

Installation

There are 3 usage options: pip Package, End-to-End Application, and Multi-Agent System with LangGraph. You can find installation and deployment instructions in the project’s official documentation.

Here's a usage option comparison table:

Feature
pip Package
End-to-End Application
Multi Agent System

Ease of Integration

High

Medium

Low

Customization

High

Medium

High

Out-of-the-box UI

No

Yes

No

Complexity

Low

Medium

High

Best for

Developers

End-users

Researchers/Experimenters

1. Clone the repository:

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

2. Set up the environment: copy .env.example to .env and add your AIMLAPI key and other environment variables in the following format:

AIMLAPI_API_KEY=***
FAST_LLM="aimlapi:x-ai/grok-3-mini-beta"
SMART_LLM="aimlapi:x-ai/grok-3-mini-beta"
STRATEGIC_LLM="aimlapi:x-ai/grok-3-mini-beta"
EMBEDDING="aimlapi:text-embedding-3-small"
AIMLAPI_BASE_URL="https://api.aimlapi.com/v1"

3. Run the app:

3.1. Via main.py — a GUI will be available at localhost:8000 3.2. (Optional) Via Docker:

docker compose up --build  

4. To use it, import the library and create an instance of GPTResearcher :

pip install gpt-researcher

System requirements:

  • Python 3.10+

  • pip package manager

See the examples below for how to create and use an instance.

How to Use AIML API with GPT Researcher

Agent Example

If you're interested in using GPT Researcher as a standalone agent, you can easily import it into any existing Python project. Below, is an example of calling the agent to generate a research report:

from gpt_researcher import GPTResearcher
import asyncio

async def fetch_report(query):
    """
    Fetch a research report based on the provided query and report type.
    """
    researcher = GPTResearcher(query=query)
    await researcher.conduct_research()
    report = await researcher.write_report()
    return report

async def generate_research_report(query):
    """
    This is a sample script that executes an async main function to run a research report.
    """
    report = await fetch_report(query)
    print(report)

if __name__ == "__main__":
    QUERY = "What happened in the latest burning man floods?"
    asyncio.run(generate_research_report(query=QUERY))

You can further enhance this example to use the returned report as context for generating valuable content such as news article, marketing content, email templates, newsletters, etc.

You can also use GPT Researcher to gather information about code documentation, business analysis, financial information and more. All of which can be used to complete much more complex tasks that require factual and high quality realtime information.

Our Supported Models

To learn more about GPT Researcher, check out the documentation page.

Last updated

Was this helpful?