examples: add AG2 multi-agent chat over private documents#2210
examples: add AG2 multi-agent chat over private documents#2210faridun-ag2 wants to merge 2 commits intozylon-ai:mainfrom
Conversation
Add a standalone example demonstrating AG2 multi-agent orchestration on top of PrivateGPT's OpenAI-compatible API. Three specialized agents (Researcher, Analyst, Writer) collaborate to analyze private documents using PrivateGPT's RAG pipeline as a registered tool. No changes to core PrivateGPT code.
- Extract sources from choices[0].sources (PrivateGPT's actual response structure) instead of top-level sources field - Set max_consecutive_auto_reply=10 so UserProxy relays tool results back to the group chat - Add is_termination_msg to stop conversation after Writer says TERMINATE Verified end-to-end with PrivateGPT mock mode + OpenAI GPT-4o-mini.
|
Hey @imgarylai @Toad882 @atari2600tim ! This PR adds a standalone AG2 multi-agent example ( Note on the failing pre-commit CI check: The failure is not related to this PR. It's caused by a deprecated
This affects all PRs on this repo. Upgrading to Would appreciate a review when you get a chance. Happy to adjust anything! |
Description
Adds an example demonstrating AG2 multi-agent orchestration on top of PrivateGPT. Three specialized agents collaborate to analyze private documents using PrivateGPT's RAG API as a tool.
AG2 is an open-source multi-agent framework with 500K+ monthly PyPI downloads, 4,300+ GitHub stars, and 400+ contributors.
Architecture
What it demonstrates
/v1/chat/completionsas a registered AG2 toolWhy multi-agent + private RAG
Files
examples/ag2_multiagent.py— standalone script, no changes to core PrivateGPTexamples/README.md— setup and usage guideTesting