Skip to content

feat: add AG2 multi-agent framework integration#3106

Open
faridun-ag2 wants to merge 2 commits intodeepset-ai:mainfrom
faridun-ag2:feat/ag2-integration
Open

feat: add AG2 multi-agent framework integration#3106
faridun-ag2 wants to merge 2 commits intodeepset-ai:mainfrom
faridun-ag2:feat/ag2-integration

Conversation

@faridun-ag2
Copy link
Copy Markdown

Summary

Add an integration for AG2 (formerly AutoGen), a multi-agent conversation
framework with 500K+ monthly PyPI downloads, 4,300+ GitHub stars, and 400+ contributors.

What's included

  • AG2Agent — A Haystack @component that wraps AG2 multi-agent conversations
  • Full serialization support (to_dict / from_dict)
  • Configurable: model, system message, API type, code execution, auto-reply limits
  • Unit tests with mocked dependencies
  • README with standalone and pipeline usage examples

How it works

The AG2Agent component creates an AG2 AssistantAgent and UserProxyAgent,
runs a conversation with the input query, and returns the final reply along with
the full message history. It integrates seamlessly into Haystack pipelines.

Usage

from haystack import Pipeline
from haystack_integrations.components.agents.ag2 import AG2Agent

pipeline = Pipeline()
pipeline.add_component("agent", AG2Agent(model="gpt-4o-mini"))
result = pipeline.run({"agent": {"query": "Explain RAG."}})

Related

Add AG2Agent component that wraps AG2 (formerly AutoGen) multi-agent
conversations for use in Haystack pipelines.

- AG2Agent Haystack component with @component decorator
- Serialization support (to_dict/from_dict)
- Configurable LLM model, system message, API type
- Unit tests with mocked AG2 agents
- README with usage examples
@faridun-ag2 faridun-ag2 requested a review from a team as a code owner April 5, 2026 06:55
@faridun-ag2 faridun-ag2 requested review from davidsbatista and removed request for a team April 5, 2026 06:55
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 5, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the type:documentation Improvements or additions to documentation label Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic:CI type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants