AgentFlow  by lupantech

Trainable agentic system for optimized planning and tool use

Created 4 months ago
1,510 stars

Top 27.2% on SourcePulse

GitHubView on GitHub
Project Summary

AgentFlow: In-the-Flow Agentic System Optimization

AgentFlow is a trainable, modular agentic framework designed to overcome the scalability and generalization limits of current tool-augmented reasoning approaches. It targets researchers and developers building sophisticated AI agents, offering improved planning, tool use, and long-horizon reasoning capabilities through direct optimization of its planner module.

How It Works

The framework employs a modular system comprising four specialized agents: Planner, Executor, Verifier, and Generator, which coordinate via evolving memory and integrated tools. AgentFlow's core innovation is the Flow-GRPO algorithm, which optimizes the planner agent "in-the-flow" online. This approach is advantageous for tackling long-horizon reasoning tasks with sparse rewards, enhancing tool-calling reliability and generalization beyond single-LLM interleaving methods.

Quick Start & Requirements

  • Installation: Execute bash setup.sh. Activate the virtual environment with source .venv/bin/activate. Install parallel for benchmark experiments: sudo apt-get install parallel.
  • Environment Variables: Configure API keys (OpenAI, Google, DashScope/Together) in agentflow/.env by copying agentflow/.env.template. Detailed instructions are available in the API Key Setup Guide.
  • Inference: Run python quick_start.py after setting up API keys.
  • Training: Requires dataset preparation (python data/get_train_data.py, python data/aime24_data.py) and execution via tmux using train/serve_with_logs.sh and train/train_with_logs.sh. Hyperparameters are configured in train/config.yaml.
  • Documentation: Links to a YouTube tutorial, test_env.md, benchmark.md, logs.md, and llm_engine.md (relative path assets/doc/llm_engine.md) are available within the repository structure.

Highlighted Details

  • AgentFlow (7B Backbone) achieves state-of-the-art results on 10 benchmarks, outperforming baselines by up to +14.9% (search) and surpassing GPT-4o (~200B) on several tasks.
  • The core innovation is the Flow-GRPO algorithm, enabling "in-the-flow" online optimization of the planner agent for long-horizon reasoning and sparse rewards.
  • Features a modular agentic system (Planner, Executor, Verifier, Generator) with evolving memory and seamless integration of diverse tools (Python, Google Search, Wikipedia, etc.).
  • Supports customization by allowing different LLM engines for each agent module.

Maintenance & Community

Core contributors include Zhuofeng Li, Haoxiang Zhang, and Pan Lu, with advisors James Zou, Yejin Choi, and Yu Zhang. A Slack community is available for contributions and discussions. Contact emails are provided for issues and collaborations.

Licensing & Compatibility

The project's license is not explicitly stated in the provided README, which is a critical omission for adoption decisions. The framework supports various LLM engines for its agent modules.

Limitations & Caveats

The setup requires obtaining and configuring multiple API keys, potentially incurring costs. The absence of a clearly stated license poses an adoption blocker. Training involves a multi-step process using tmux and specific dataset preparation.

Health Check
Last Commit

4 days ago

Responsiveness

Inactive

Pull Requests (30d)
2
Issues (30d)
5
Star History
70 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems") and Elie Bursztein Elie Bursztein(Cybersecurity Lead at Google DeepMind).

ROMA by sentient-agi

0.3%
5k
A meta-agent framework for building hierarchical multi-agent systems
Created 8 months ago
Updated 2 weeks ago
Starred by Eric Zhu Eric Zhu(Coauthor of AutoGen; Research Scientist at Microsoft Research), Elvis Saravia Elvis Saravia(Founder of DAIR.AI), and
2 more.

deepagents by langchain-ai

2.6%
9k
Framework for building advanced LLM agents
Created 6 months ago
Updated 1 day ago
Feedback? Help us improve.