Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

22 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”ฌ ARES: Autonomous Research & Multi-Agent Evaluation Engine

Python 3.10+ LangGraph NVIDIA NIM Ollama License: MIT

ARES is a stateful, graph-orchestrated multi-agent research engine built on top of LangGraph. Unlike simple linear, one-shot AI scripts that fail silently or lack resilience, ARES simulates a real-world research team: it dynamically generates distinct analyst personas, subjects them to interactive human feedback, runs parallel search-grounded expert interviews, and synthesizes the findings into a cited, comprehensive markdown report.


๐Ÿ’ก What Makes ARES Different?

Most AI-based search tools work as black boxes: you enter a query, wait, and get a generic summary. If a search query is off-topic or a tool crashes, the entire run is lost.

ARES tackles this with a highly resilient, human-in-the-loop, and parallel graph architecture:

  • Stateful Autonomy with SQLite Persistence: Runs are backed by a persistent SQLite database. The engine can pause, await human review, and resume from checkpoints without losing state.
  • Parallel Map-Reduce Fan-Out: Orchestrates multiple independent AI analyst personas in parallel (Map step), each interviewing a context-grounded AI expert. The engine then synthesizes their findings (Reduce step).
  • Grounded expert Q&A (No Hallucinations): The AI experts are restricted to retrieved context (Wikipedia + DuckDuckGo/Tavily) and must cite references inline (e.g., [1], [2]).
  • Aesthetic Terminal Experience: Fully driven by a rich terminal interface featuring live status spinners, colored panels for Q&A, structured tables, and real-time Markdown rendering.

๐Ÿ—๏ธ Multi-Agent Architecture

The orchestration logic is structured into four distinct phases, visualized in the workflow diagram below:

graph TD
    %% Phase 1: Analyst Generation
    START([START]) --> create_analysts["Phase 1: Create Analysts<br/><i>(Generate Persona Set)</i>"]
    create_analysts --> human_feedback{"human_feedback<br/><i>(Interrupt Checkpoint)</i>"}
    
    %% Phase 1 Feedback Loops
    human_feedback -- "Provide Edits / Refinement" --> create_analysts
    human_feedback -- "Press Enter (Accept)" --> conduct_interview["Phase 2 & 3: Map Phase<br/><i>(Parallel Analyst Interviews)</i>"]
    
    %% Phase 2: Sub-Graph (Fanned-Out)
    subgraph "Phase 2: Analyst Q&A Sub-Graph (Per Persona)"
        direction TB
        sub_start([START]) --> ask_question["ask_question<br/><i>(Analyst Formulates Q)</i>"]
        ask_question --> continue_or_finish{"continue_or_finish?"}
        continue_or_finish -- "Keep Interviewing" --> search_context["search_context<br/><i>(Query Wikipedia & Web)</i>"]
        search_context --> answer_question["answer_question<br/><i>(Expert Answers using Context)</i>"]
        answer_question --> route_messages{"route_messages?"}
        route_messages -- "Under Turn Cap" --> ask_question
        route_messages -- "Turn Cap Reached" --> save_interview["save_interview"]
        continue_or_finish -- "Analyst Signed Off" --> save_interview
        save_interview --> write_section["write_section<br/><i>(Generate Cited Memo)</i>"]
        write_section --> sub_end([END])
    end
    
    %% Phase 3: Reduce Phase
    conduct_interview --> write_report["write_report<br/><i>(Synthesize Body)</i>"]
    conduct_interview --> write_introduction["write_introduction<br/><i>(Write Intro)</i>"]
    conduct_interview --> write_conclusion["write_conclusion<br/><i>(Write Conclusion)</i>"]
    
    write_report --> finalize_report["finalize_report<br/><i>(Stitch Final Document)</i>"]
    write_introduction --> finalize_report
    write_conclusion --> finalize_report
    
    finalize_report --> END([END])

    classDef phaseStyle fill:#1e1e2f,stroke:#4f46e5,stroke-width:2px,color:#fff;
    classDef graphStyle fill:#111827,stroke:#1f2937;
    class create_analysts,conduct_interview,write_report,write_introduction,write_conclusion,finalize_report phaseStyle;
Loading

๐Ÿš€ Live Demo Walkthrough

ARES includes a gorgeous interactive command-line interface (CLI) powered by the rich library. Here is a preview of the CLI lifecycle:

1. Topic & Persona Generation

When started, ARES asks for a research topic and dynamically creates diverse analyst perspectives (e.g., policy analysts, economic advisors, field experts) to cover all angles of the topic.

 โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
 โ”‚ ๐Ÿ”ฌ ARES                                                โ”‚
 โ”‚ Autonomous Research & Multi-Agent Evaluation Engine    โ”‚
 โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
๐Ÿ” Research topic: Renewable energy integration in microgrids
[dim]Run ยท thread_id=9f2a0b1c ยท analysts=3 ยท turns/interview=3[/]

๐Ÿง‘โ€๐Ÿ”ฌ 3 Analyst(s) Generated
 โ•ญโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
 โ”‚ # โ”‚ Name             โ”‚ Role              โ”‚ Affiliation        โ”‚ Focus                                    โ”‚
 โ”œโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
 โ”‚ 1 โ”‚ Dr. Elena Vance  โ”‚ Grid Architect    โ”‚ NREL               โ”‚ Grid stability, load balancing, storage  โ”‚
 โ”‚ 2 โ”‚ Marcus Aurelius  โ”‚ Financial Officer โ”‚ CleanTech Capital  โ”‚ CapEx/OpEx, ROI, and economic viability  โ”‚
 โ”‚ 3 โ”‚ Sarah Jenkins    โ”‚ Policy Lead       โ”‚ Energy Transition  โ”‚ Regulatory frameworks and subsidies     โ”‚
 โ•ฐโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

โœ๏ธ  Feedback for analysts (Enter to accept): _

2. Live Q&A Stream

Once you accept the analyst personas (or press Enter to proceed), ARES kicks off the parallel interviews. The CLI streams the live questions and expert answers, complete with formatting and search logs.

๐ŸŽ™๏ธ  Interviews & Report Synthesis
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
๐Ÿ” Searching sources (Wikipedia + web)...
[Wikipedia] โœ… Found 2 docs for: 'Microgrid battery storage ROI'
[Web] โœ… duckduckgo returned 3 results for: 'Microgrid battery storage ROI'

โ•ญโ”€ ๐ŸŽค Analyst Question (Marcus Aurelius) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ What is the typical return on investment period for lithium-ion        โ”‚
โ”‚ battery energy storage systems integrated into remote microgrids?      โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

โ•ญโ”€ ๐Ÿ’ฌ Expert Answer โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ Based on NREL's 2025 assessment [1], the ROI period for remote         โ”‚
โ”‚ microgrid battery storage ranges between 4.8 to 7.2 years, heavily     โ”‚
โ”‚ dependent on local diesel fuel displacement offsets [2].               โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

๐Ÿ› ๏ธ Setup & Installation

Prerequisites

  • Python 3.10 or higher.
  • An active LLM Provider account (either NVIDIA NIM API Key or a local Ollama server running).

1. Clone & Install Dependencies

# Clone the repository
git clone https://github.com/yourusername/ARES.git
cd ARES

# Install required packages
pip install -r requirements.txt

2. Configure Environment

Create a .env file in the root directory:

# Choose LLM Provider: "nvidia" (default) or "ollama"
LLM_PROVIDER="nvidia"

# NVIDIA NIM Configuration (if using nvidia)
NVIDIA_API_KEY="your_nvidia_api_key_here"
NVIDIA_MODEL="meta/llama-3.3-70b-instruct"

# Ollama Configuration (if using ollama)
# OLLAMA_MODEL="llama3.1:8b"

# Persistence & Checkpointing Backend: "sqlite" (default) or "memory"
CHECKPOINT_BACKEND="sqlite"
CHECKPOINT_DB="ares_checkpoints.sqlite"

# Web Search Provider: "duckduckgo" (default, keyless) or "tavily"
SEARCH_BACKEND="duckduckgo"
# TAVILY_API_KEY="your_tavily_api_key_here" (if using tavily)

# Search limitations
WEB_MAX_RESULTS=3
MAX_SOURCES_FOR_EXPERT=5
MAX_SOURCE_CHARS=1500

โšก Running ARES

ARES supports multiple execution modes via command-line arguments:

A. Fully Interactive Mode (Default)

Enter your topic, review personas, and provide feedback interactively:

python ARES.py

B. Non-Interactive Mode

Skip human feedback checkpoints and run the research process end-to-end automatically (great for pipelines or scripting):

python ARES.py --topic "Artificial Intelligence in Agriculture" --no-feedback

C. Resuming an Interrupted Run

Since ARES uses persistent state checkpoints, you can resume an interrupted session by specifying its previous thread_id:

python ARES.py --thread-id "9f2a0b1c"

D. Adjusting Research Depth

Customize the number of analysts generated and the depth of the interviews:

python ARES.py --max-analysts 4 --max-turns 4 --output "ai_report.md"

๐Ÿณ Running with Docker

ARES ships with a slim, non-root container image so you can run it without a local Python setup. Configuration is injected at runtime โ€” no secrets are baked into the image โ€” and generated reports plus SQLite checkpoints persist in a named volume.

1. Configure

cp .env.example .env      # then edit .env and add your NVIDIA_API_KEY

2A. Build & run with Docker

# Build the image
docker build -t ares:latest .

# Run a research job (persist artefacts in the `ares_data` volume)
docker run --rm -it --env-file .env -v ares_data:/data \
  ares:latest --topic "Artificial Intelligence in Agriculture" --no-feedback

The finished report is written to /data/research_report.md inside the volume.

2B. Or use Docker Compose

# NVIDIA NIM provider (default) โ€” reads keys from .env
docker compose run --rm ares --topic "AI in Agriculture" --no-feedback

Run fully locally (no API key) with the bundled Ollama sidecar:

docker compose --profile local up -d ollama
docker compose exec ollama ollama pull llama3.1:8b
LLM_PROVIDER=ollama OLLAMA_HOST=http://ollama:11434 \
  docker compose run --rm ares --topic "AI in Agriculture" --no-feedback

Note: the interactive persona-feedback prompt needs a TTY. Use docker run -it or docker compose run (both allocate one). For headless / CI pipelines, pass --no-feedback to skip the human-in-the-loop checkpoint.


๐Ÿ“ Repository Structure

โ”œโ”€โ”€ ARES.py                  # Core logic, State Graphs, and CLI driver
โ”œโ”€โ”€ requirements.txt         # Package dependencies
โ”œโ”€โ”€ Dockerfile               # Container image (slim, non-root)
โ”œโ”€โ”€ docker-compose.yml       # Compose stack (ARES + optional Ollama sidecar)
โ”œโ”€โ”€ .dockerignore            # Build-context excludes (keeps secrets out)
โ”œโ”€โ”€ .env.example             # Template for the runtime configuration
โ”œโ”€โ”€ research_report.md       # Default output path for the finalized report
โ”œโ”€โ”€ ares_checkpoints.sqlite  # SQLite database storing run states & history
โ”œโ”€โ”€ academic/                # Research paper (LaTeX + Markdown) & figures
โ””โ”€โ”€ LICENSE                  # Project License

๐Ÿ›ก๏ธ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Autonomous Research & Multi-Agent Evaluation Engine

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages