mcpField
P
pydantic-ai-researcher

pydantic-ai-researcher

Local
github.com/ibagurAI & Agents1Updated 77w ago

About pydantic-ai-researcher

A Python research system for people investigating complex questions. Its research and evaluator agents iterate on answers using external MCP servers, including Tavily, Brave Search, and arXiv.

Key features

  1. 01Asynchronous research and evaluation loop
  2. 02Separate research and evaluator agents
  3. 03Pluggable external MCP servers
  4. 04Environment-based API configuration
  5. 05Interactive query entry

Use cases

  1. 01Research complex questions across sources
  2. 02Refine an answer through evaluator feedback

MCP support

The research agent uses external MCP servers, including Tavily, Brave Search, and arXiv, to gather information.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

pydantic-ai-researcher

Description

pydantic-ai-researcher is a research system that orchestrates an asynchronous loop between two specialized agents: a research agent and an evaluator agent. The research agent answers complex queries using external MCP servers, while the evaluator agent assesses and refines these answers, iterating until a satisfactory response is attained.

Features

  • Asynchronous Research Loop: Iterative evaluation and improvement of research answers.
  • Dual Agent System: Utilizes a research agent for data gathering and an evaluator agent for feedback.
  • Pluggable MCP Servers: Integrates with multiple MCP servers (Tavily, Brave Search, arXiv) for diverse data sources.
  • Environment Configurable: Uses environment variables and .env files for API key configuration.
  • Easy Setup: Straightforward installation via Pipfile or requirements.txt.

Installation / Setup

  1. Prerequisites: Ensure Python 3.x is installed.
  2. Installation:
    • Using Pipenv:
      pipenv install
      
    • Or using pip:
      pip install -r requirements.txt
      
  3. Configuration:
    • Create a .env file at the project root.
    • Define the required environment variables:
      • OPENAI_API_KEY
      • TAVILY_API_KEY
      • BRAVE_API_KEY
    • (Other API endpoints may also need to be defined as needed.)

Usage

Run the project by executing the following command:

python main.py

Type your research queries in the interactive prompt. To exit the program, type exit.

Architecture

The system implements a two-agent evaluator-optimizer loop:

  • Agent A (Research Agent): Generates initial answers to research queries using external data sources via MCP servers.
  • Agent B (Evaluator Agent): Evaluates the answers provided by Agent A and offers feedback for improvement.
  • Loop Mechanism: The system iterates through multiple cycles of evaluation until an answer is accepted or the maximum iteration limit is reached.

Below is the workflow diagram illustrating the evaluator-optimizer process:

evaluator-optimizer-workflow

Source: Building effective agents

Configuration

The project configuration relies on environment variables loaded via python-dotenv. Ensure that:

  • OPENAI_API_KEY is set for the OpenAI model usage.
  • TAVILY_API_KEY is set for accessing Tavily MCP Search.
  • BRAVE_API_KEY is set for using Brave Search MCP.
  • Additional configuration for arXiv MCP may be defined as needed.

Contributing / License

Contributions are welcome. Please submit issues and pull requests for bug fixes, improvements, or new features. Refer to the project's LICENSE file for licensing details.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.