Skip to content

Add AG2 multi-agent system recipe#349

Open
faridun-ag2 wants to merge 2 commits intohuggingface:mainfrom
faridun-ag2:add-ag2-multiagent-recipe
Open

Add AG2 multi-agent system recipe#349
faridun-ag2 wants to merge 2 commits intohuggingface:mainfrom
faridun-ag2:add-ag2-multiagent-recipe

Conversation

@faridun-ag2
Copy link
Copy Markdown

New Recipe: Building Multi-Agent Systems with AG2 and Hugging Face

Adds a notebook demonstrating AG2 (formerly AutoGen), an open-source multi-agent framework with 500K+ monthly PyPI downloads.

Content

The notebook covers three progressive examples:

  1. Basic two-agent chat — AssistantAgent + UserProxyAgent with a HF model via Inference API
  2. Tool use — Agents calling Hugging Face Hub API to search models and get info, using AG2's decorator-based tool registration
  3. GroupChat orchestration — Researcher + Writer + Critic collaborating on a research overview

Why this recipe

The cookbook has multi-agent examples with smolagents but none with AG2, one of the most popular multi-agent frameworks. AG2 takes a different approach — declarative agent definitions with automatic orchestration via GroupChat — which complements existing recipes.

Integration

AG2 connects to Hugging Face models via the OpenAI-compatible Inference API endpoint (router.huggingface.co/v1), requiring only a HF token.

Checklist

  • Notebook runs top-to-bottom without errors
  • Lowercase filename
  • _toctree.yml and index.md updated
  • Author attribution included after first header
  • Non-essential outputs cleaned up
  • Uses open-source model (Qwen2.5-Coder-32B-Instruct)

New notebook demonstrating AG2 (formerly AutoGen) multi-agent framework
with HF Inference API: basic two-agent chat, decorator-based tool use,
and GroupChat orchestration with Researcher/Writer/Critic agents.
@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@faridun-ag2
Copy link
Copy Markdown
Author

Hi @merveenoyan @stevhliu ! Would love your review on this new AG2 multi-agent recipe when you get a chance. Happy to address any feedback!

@stevhliu
Copy link
Copy Markdown
Member

stevhliu commented Apr 1, 2026

hi, thanks for your interest in contributing a recipe! currently, it feels a bit thin and branded and we would love to see if you could make it a bit more applied for specific practical use-cases

Addresses reviewer feedback — more applied, less branded:
- Focus on practical use case: automated model comparison pipeline
- Scout/Analyst/Advisor agents with real HF Hub tools
- Three tools: search_models, get_model_details, compare_model_stats
- Interactive "Try It Yourself" section
- Removed AG2 stats/branding, introduced naturally
@faridun-ag2 faridun-ag2 force-pushed the add-ag2-multiagent-recipe branch from 7f532a9 to 7ddbd38 Compare April 1, 2026 23:04
@faridun-ag2
Copy link
Copy Markdown
Author

Hey @stevhliu, thanks for the feedback! Totally fair points.

I've reworked the notebook — instead of a generic API walkthrough, it now builds a model comparison pipeline that actually solves a real problem: "which model should I pick from the Hub?"

Three agents (Scout, Analyst, Advisor) use huggingface_hub tools to search models, read model cards, and compare stats before giving a recommendation. Also added a "Try It Yourself" section so readers can plug in their own use case.

Stripped out the AG2 branding/stats — it's just mentioned naturally as the tool being used.

Let me know what you think!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants