liveBook · Manning

AutoGen

As explained in Enterprise RAG

AutoGen is a framework for building applications whose language-model agents collaborate through messages and callable functions.

AutoGen is used to turn retrieval from a one-shot search call into an agent workflow. An assistant can interpret or rewrite a question, choose a database or index, and propose a search; an executor runs the search function and returns structured results. The pair can repeat, switch strategies, or request clarification when retrieval is weak. section 4.0 section 4.11

For a RAG system, this separation makes the search path explicit. The Search Assistant Agent is instructed to use retrieved records rather than its own knowledge and to report limited evidence honestly. The Search Executor Agent runs without code execution or human input, uses a low-temperature model configuration, and terminates only after sufficient information is retrieved. section 4.1.2 section 4.1.2

A production-oriented AutoGen retrieval design includes:

  • An assistant and user-proxy/executor pair; version 0.2 requires two agents to run a function. section 4.1.1 section 4.1.2
  • Streaming function calling and asynchronous agents, allowing tools to run while output streams and multiple searches to proceed concurrently. section 4.1.1
  • Fallback model configurations, so AutoGen can move to another configured model when one fails. section 4.1.2
  • Query triage, separate group-chat managers, and asynchronous recipient plans to target relevant databases while avoiding unnecessary waits and token use. section 4.11
  • Logging of questions, search results, and answers for auditing and continuous improvement, plus websocket streaming for responsive delivery. section 4.11

Product-record retrieval

A user asks, “What is Product XYZ?” with chat history. A Group Chat Manager routes the request to a Search Assistant Agent, which recommends the rewritten query “Product XYZ.” A Search Executor Agent calls the data source and returns structured results; a Writer Agent streams a concise answer. The arrangement supports Azure AI Search keyword and vector lookups. section 4.1.2 section 4.11

Figure 4.3 A user question (“What is Product XYZ?”) enters the system with its chat history and is routed through a Group Chat Manager to two agents. The Search Assistant Agent decides what to ask the database and recommends calling the search function with the rewritten query “Product XYZ.” The Search Executor Agent runs that function against the data source, returning structured search results. Those results flow to a Writer Agent, which streams back a concise answer to the user.

Trace the handoff from user question and chat history through the manager, search agents, data source, and streaming writer response. section 4.1.2

Configure the workflow with the `autogen` package, `asyncio`, Azure asynchronous search and credential libraries, environment variables, and an LLM configuration list. A `.env` file holds credentials and disables Docker through `AUTOGEN_USE_DOCKER=0`; Azure access is authenticated with `AzureKeyCredential`. Test candidate models for the specific RAG workload, particularly where privacy or compliance constrains API use. section 4.1.2 section 4.1.1

How Enterprise RAG covers it

How deep it goes
Builds an assistant-executor implementation with configurations, prompts, termination logic, asynchronous search, and operational logging.
Examples
Follows a Product XYZ question through a Group Chat Manager, search assistant, executor, Azure index, and writer.
What it assumes
Assumes an existing Azure AI Search index and Python environment while introducing AutoGen agent configuration.
What you can do after
Build it from scratch as an asynchronous, grounded Azure AI Search retrieval workflow with auditable responses.
How it connects
Connects RAG, Azure AI Search, vector search, keyword search, function calling, streaming, WebSockets, and SQLite logging.

Also explained in

Compare how 2 books explain AutoGen →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Enterprise RAG. The section links point to the parts of the book it draws on.