Recipes

Multi-agent research and report pipeline built on AutoGen AgentChat

Discovered from README cross-links · 2 days ago

Research & KnowledgeSoftware & DevOps

A team of AutoGen agents that research a topic, critique drafts, and ship

What they did

They wanted a repeatable way to turn a rough question into a polished written brief without babysitting a chat window. Starting from the AutoGen quickstart, they installed autogen-agentchat plus the OpenAI extension, created an AssistantAgent backed by a GPT-4.1 model client, and confirmed the hello-world loop ran end to end. From there they expanded into a small team: a planner agent that decomposed the question into sub-questions, a researcher agent that answered each sub-question, a writer agent that assembled a draft, and a critic agent that reviewed the draft against the original question and returned concrete revision notes. They used AutoGen's team abstractions to run the agents in a round-robin style conversation with a termination condition based on the critic declaring the draft acceptable or a maximum turn count being hit. They also tried AutoGen Studio to sketch the same flow in a no-code GUI before committing to code, which helped them explain the design to non-engineers. Prompts and agent descriptions lived in a small config module so they could iterate without touching orchestration code. Output was written to markdown files in a reports directory, with the full message transcript saved alongside for auditability.

How it went

The pipeline produced usable first drafts on well-scoped questions and the critic loop measurably reduced vague or off-topic sections across a handful of trial runs. Setup was quick: the quickstart ran in minutes and the multi-agent version took an afternoon. Polish level was prototype-grade — good enough for internal briefs, not for anything customer-facing without human review. The main friction was tuning termination conditions so the critic did not loop forever or approve too early.

Worth knowing

AutoGen is archived and no longer maintained by Microsoft, so there are no bug or security fixes and the docs advise against production use; new work should target Microsoft Agent Framework, and existing code should follow the migration guide. The samples assume an OpenAI API key exported in the environment, and costs scale with every agent turn, so long critic loops get expensive. Agent quality depends heavily on prompt wording, and the transcript files can contain sensitive material if the research touches internal data.

Wiring

Install with pip install -U "autogen-agentchat" "autogen-ext[openai]" on Python 3.10+, and export OPENAI_API_KEY. Create an OpenAIChatCompletionClient for the chosen model, then instantiate AssistantAgent objects for planner, researcher, writer, and critic, each with a distinct system message. Compose them into a team (round-robin or selector style) with a termination condition combining a max-message limit and a text-mention or handoff stop when the critic signals approval. Run the team asynchronously with asyncio.run, capture the returned task result, and persist both the final message and the full message list to disk. Close the model client at the end of the run to release connections. Optionally install autogenstudio to prototype the same graph in a GUI before porting it to code.

Try it yourself

Set up a small AutoGen AgentChat pipeline in this repo: a planner, researcher, writer, and critic agent using OpenAIChatCompletionClient, run as a team with a termination condition that stops when the critic approves or after N turns. Put agent prompts in a config module, write the final draft and full transcript to a reports/ directory, and add a README note that AutoGen is archived and Microsoft Agent Framework is the successor.

Source

Tools in this stack