deepset-ai / deepset-ai/haystack-core-integrations
New Integration: AG2 multi-agent framework
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 203
- Forks
- 332
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 80
Description
Summary
Closes #3107
Add an AG2Agent Haystack component that wraps AG2 (formerly AutoGen) multi-agent conversations, allowing Haystack pipelines to leverage AG2's multi-agent orchestration.
What's included
AG2Agent— a Haystack@componentwrapping 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
On each run(), the component creates an AG2 AssistantAgent and UserProxyAgent, executes the conversation via user_proxy.run(assistant, message=query).process(), and returns the final reply along with the full message history.
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."}})
print(result["agent"]["reply"])
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the AG2Agent entry point in haystack_integrations.components.agents.ag2 and review the issue's standalone and pipeline usage examples. Implement the component with the listed configuration, serialization, conversation, reply, and message-history behavior, then verify it with mocked unit tests and confirm the README examples work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100