Lecture guide: Agentic AI Frameworks & AutoGen + Building a Multimodal Knowledge Assistant#
Lecturer: Chi Wang (AutoGen-AI); Jerry Liu (LlamaIndex) · Course: UC Berkeley LLM Agents MOOC, Fall 2024 (CS 294-137), lecture 3 · Length: 1:06:00 Video: watch on YouTube Chapters that cite this lecture: 01. The Agent Framework Landscape · 02. AutoGen: Conversation Programming · 03. LlamaIndex: Building a Knowledge Assistant
In one sentence: Chi Wang explains agentic AI and the AutoGen framework, in which a program is a conversation between agents, and Jerry Liu shows how LlamaIndex builds a multimodal knowledge assistant: good parsing, several indexed representations per element, then reasoning on top.
Before you watch#
The lecture has two halves. AutoGen: Conversation Programming follows the first half in detail, LlamaIndex: Building a Knowledge Assistant the second, and The Agent Framework Landscape places both among other frameworks. No framework is needed to follow the argument; code examples are mostly skipped or only linked from the slides.
The lecture, part by part#
0:00–2:00 Two questions#
Chi Wang opens with two questions: what will future AI applications look like, and how can every developer be enabled to build them? Since about 2022 generative models have produced text and images far better than the techniques of his student years, such as topic modelling, and cleared the bar for more creative applications. The most important of the technical bets he and his colleagues have made since early 2023 is that future applications can be agentic: agents as a new way for people to interact with the digital world, carrying out ever more complex tasks on a person's behalf. Many doubted it at the time; since then he sees growing confirmation, including a Berkeley article on results shifting from a single language model to compound AI systems. In this book: AutoGen: Conversation Programming › What the practitioners say.
2:00–6:00 A demo, and what is new#
Agents such as personal assistants, autonomous bots and game players are an old notion; what is new is that generative AI makes the old applications easier to build and more capable, and enables new ones: science agents that make discoveries, web agents, software agents that build software from scratch. His demo, sent that morning by a startup, builds a website that lists models from Hugging Face and downloads them. Agents with different roles analyze the task, look for information, install dependencies, create files and compile the site. When he removes one critical line of code and runs the task again, the agents hit an error. In this book: AutoGen: Conversation Programming › What the practitioners say.
6:00–10:00 Three benefits, and a supply-chain example#
In the demo, the agents restore the removed line within a few steps: self-healing, in his reading. The benefits he emphasizes: a more natural interface, since one states what is wanted in plain language and iterates; complex tasks finished with little supervision; and, less discussed, agents as a software architecture in which several agents work on a task recursively. The example comes from a former colleague at Microsoft Research: supply-chain optimization in the cloud, which lets a coffee-shop owner ask what would happen to operating costs if shipping from one supplier to one store were prohibited. ChatGPT cannot answer, because the question involves the user's data, constraints and optimization tools. Built with AutoGen, three agents can: a commander receives the question and opens a nested chat with an agent that proposes code; the commander then checks the code with a safeguard agent and, if it is safe, executes it; the result goes back to the code agent, which writes the final answer. In this book: AutoGen: Conversation Programming › The core idea · AutoGen: Conversation Programming › What the practitioners say.
10:00–14:00 How the program is written, and why several agents#
In the supply-chain example, unsafe code is never run, and an execution error returns to the code agent for a rewrite. The user sees a plain answer. The program differs from a traditional one. Each agent is created in one line. Two nested chats are registered on the commander, each naming the participants, the sender, the receiver and how the chat is summarized. The user proxy sends the initial request, and the framework runs everything else. Why more than one agent? Three reasons: agents improve one another's work over turns; a complex task can be divided, with a better result per step; and some agents need no language model at all, doing grounding or validation with knowledge outside the model. His slide compares a safeguard task split between two agents with all its instructions packed into one agent: for GPT-4 the two-agent setup scores 20% higher, and for GPT-3.5 the gap is larger. So a multi-agent workflow pays off most when the task is hard and the model is weak. In this book: The Agent Framework Landscape › What the practitioners say · AutoGen: Conversation Programming › What the practitioners say.
14:00–18:00 A modular design, and the trade-offs a framework must cover#
On the programming side a modular design is easier to understand, maintain and extend: to change the safeguard, switch its backend from a model to a tool or a person and leave the rest alone, and because a person can take over any agent, human participation needs no extra mechanism. Designing such a framework is hard. It needs a unified agent abstraction, so that people in different roles, tools and models from different providers are one concept to reason about. It must accommodate many needs: static workflows with every step fixed, or dynamic ones when no one can foresee every situation; natural language for flexibility or a programming language for control; shared or isolated context; hierarchy; cooperation or competition; centralized or decentralized control; automation or intervention. In this book: AutoGen: Conversation Programming › What the practitioners say.
18:00–20:39 One pattern to derive the rest: conversation#
Design patterns keep emerging: conversation, ReAct, reflection, chain of thought, tree of thoughts, Monte Carlo tree search, tool use, planning, memory and several modalities. Too many to design for at once, so he asks whether one design point could derive the others. His choice, a personal one, is conversation, which he remembers from college as the way he made progress in learning. AutoGen is built on multi-agent conversation programming; LlamaIndex, Jerry Liu's framework, follows in the second half; LangGraph starts from graph-based control flows and CrewAI from high-level static workflows. In this book: AutoGen: Conversation Programming › What the practitioners say · The Agent Framework Landscape › What the practitioners say.
20:39–24:00 AutoGen: where it came from and its two concepts#
AutoGen began inside FLAML, an open-source library for automated machine learning and hyperparameter tuning, became a standalone repository in October 2023 after a first paper in August, and in 2024 moved to its own GitHub organization with open governance; it received a best-paper award at an ICLR 2024 workshop on agents. The concept he wants every developer to grasp: reason about a complex workflow in two steps, define the agents and get them to talk. The two ideas are a conversable agent, a generic concept that can run on a language model, a tool or human input, or a mix, and conversation programming. An agent can contain other agents and their inner conversations, appearing outside as one peer. The simplest pattern, two agents alternating, already gives reflection. In this book: AutoGen: Conversation Programming › The core idea · AutoGen: Conversation Programming › How it works, step by step.
24:00–28:59 Nested chat, tool use, group chat, and what people built#
One example pairs an author of blog posts with a critic. A nested chat can back the critic with a sequence of SEO, legal and ethics auditors and a chief auditor who merges their comments, invisible to the author. Tools also enter through conversation. Two language-model agents asked to play chess produce illegal moves; a third agent, backed by a Python library, manages the board, so that only legal moves stand and the players refine theirs until they are. In a group chat, agents of different roles are placed together and a group chat manager picks the next speaker from the task's progress; constraints (after A only B and C may speak) and transition logic can be added in natural language or code. In the community, the two largest categories are software development and agent platforms, followed by research and data processing and games, with a long tail from web browsing to blockchain. He highlights a group at MIT whose agent teams imitate a research group in protein and materials design, from collecting data to testing hypotheses, and a recent system of theirs in which a team of role-based agents reasons over an ontology knowledge graph to generate and select hypotheses. In this book: AutoGen: Conversation Programming › How it works, step by step · AutoGen: Conversation Programming › What the practitioners say.
28:59–33:00 Use cases: a web agent, and a construction firm#
Agent E, built by a startup called Emergence AI, is a hierarchical agent team that books flights or fills in medical forms; it reads the page's HTML rather than pixels, uses no multimodal model, and yet led the WebVoyager benchmark ahead of multimodal methods. At 73% success there is much room left. A construction company values the framework for letting users without expert knowledge explore many agent designs and configurations at scale. Contributors and users come from universities and companies worldwide. In this book: AutoGen: Conversation Programming › What the practitioners say.
33:00–37:04 Research directions: evaluation and AutoBuild#
Work continues in several areas. Evaluation: agent-based tools that read what an application does, propose success criteria for the task and score each dimension, then feed the scores back to improve the agents. The program interface keeps improving. AutoBuild is a first attempt at the question of which agents to create: the user describes a task, the system suggests agents with different roles, and they work in a group chat; a team created once can be reused for other tasks. The adaptive variant decomposes a task into steps and picks, or creates, a team for each step, adding new agents to the library, with promising results on maths programming and data analysis. The largest open question is how to design the best workflow for an application under quality, cost, latency and manual effort at once, alongside capability, scale, and ways for humans to guide the system and keep it safe. In this book: AutoGen: Conversation Programming › What the practitioners say · The Agent Framework Landscape › What the practitioners say.
37:04–40:00 LlamaIndex and the knowledge assistant#
Jerry Liu narrows the focus to one use case his company has explored deeply: a multimodal knowledge assistant. LlamaIndex helps developers build context-augmented LLM applications from prototype to production, with an open-source toolkit for agents over data, which began with retrieval-augmented generation (RAG) and now covers multi-step reasoning, plus an enterprise service for data indexing and RAG. In RAG, text from a knowledge base is chunked, embedded and stored in a vector database, and relevant chunks are retrieved into the prompt. Companies hold a million PDFs, slide decks and spreadsheets and want an interface that takes a task and returns a short answer, a structured report, or an action such as sending an email or writing code. In this book: LlamaIndex: Building a Knowledge Assistant › What the practitioners say.
40:00–44:00 Basic RAG and its four limits#
Basic RAG loads documents with a standard parser, slices the text every thousand tokens or so, embeds the slices and stores them in a vector store; a query does semantic search and stuffs the top results into the prompt. It answers simple questions and has four limits. Data processing is primitive: chunking ignores tables, images and sections that belong together. The model is used only for synthesis, not for reasoning or planning, a waste of the latest models, o1 and Claude 3.5 among them. Pipelines are one-shot and stateless, with no memory. And many questions get no answer at all, which shows up as hallucination; a chatbot that cannot answer 80% of the questions adds little. A better knowledge assistant has four ingredients: a high-quality multimodal retrieval pipeline; richer outputs than a chat reply; agentic reasoning over the inputs, with chain of thought, tool use and reflection; and deployment. In this book: LlamaIndex: Building a Knowledge Assistant › The core idea · LlamaIndex: Building a Knowledge Assistant › What the practitioners say.
44:00–48:00 Start with parsing#
Visual data means more than JPEG files: slide decks and papers carry charts, diagrams and odd layouts, and standard pipelines extract them badly. Garbage in, garbage out applies to LLM applications as to traditional machine learning, so the layer that parses, chunks and indexes documents is a necessary part of any production application. Complex documents have embedded tables, charts, images, headers and footers; off-the-shelf parsers break them and the model then hallucinates. Users want to ask pointed questions, compare several documents, or run research tasks, such as a survey of ten papers on quantization. It starts with a good PDF parser that returns text chunks, tables and diagrams in a consistent form; a model has a hard time with text a parser has garbled, however good it is. His company ships one, used by more than 30,000 people. In this book: LlamaIndex: Building a Knowledge Assistant › 1. Parse into clean elements.
48:00–51:28 Several representations per element#
Once a document is parsed into consistent elements, a standard pipeline embeds each one directly. His team found it better to extract several representations that point back to the source: for a table, various summaries; for a picture, which a text embedding cannot take, summaries written by a model; for a long text chunk, smaller chunks. These nodes are what gets embedded and indexed, with their references. At retrieval time the nodes are fetched and dereferenced, and the original element is passed to the model. Because current models are multimodal, text embedding still does the indexing while both text and images go into the prompt; image chunks can alternatively be indexed with CLIP embeddings. Such a multimodal RAG pipeline answers questions about the visual elements of a page, but it has no agents yet: no reasoning and no tools. In this book: LlamaIndex: Building a Knowledge Assistant › 2. Create several representations per element · LlamaIndex: Building a Knowledge Assistant › 4. Retrieve, then dereference.
51:28–54:00 Outputs beyond chat, and agentic RAG#
Agents should also produce whole units of output: a slide deck, a PDF, code, a report that a knowledge worker can use directly. Naive RAG handles pointed questions but fails on tasks that need the whole document, such as summarization, on comparisons across documents, on multi-part questions and on high-level tasks, because it retrieves a fixed number of chunks and never breaks the question down. At the general end stand whole agent architectures, such as the ReAct loop, about two years old. In this book: LlamaIndex: Building a Knowledge Assistant › 5. Add reasoning only where retrieval fails · LlamaIndex: Building a Knowledge Assistant › What the practitioners say.
54:00–1:00:00 Constrained or unconstrained#
The ReAct loop is chain of thought plus tool use; LLM Compiler goes further, planning a DAG up front, optimizing and running it, and replanning periodically. Many teams instead assemble constrained pieces for one use case, for the sake of reliability: tool use, a memory module, function calling, structured output, calling an existing API, and splitting a question into sub-questions. Agentic RAG is an agent layer over retrieval seen as a tool. A constrained flow: a router prompt selects one of n tools, the tool runs, a reflection prompt validates, and the program answers; there are no loops, and people wrote the control flow as if-else and while. An unconstrained architecture such as ReAct, LLM Compiler or tree of thought hands the agent a set of tools and lets it plan; it can solve a greater variety of tasks, but it may call tools it should not, loop forever, and it costs more, with larger prompts and more tools per call. Fewer architectures are built with wide unconstrained flows. His rule of thumb for ReAct: four or five tools, and fewer than ten with current models. LlamaIndex calls these programs workflows, all built on an event-driven orchestration in which steps pass messages and a step can be plain Python or a model call. His rough definition of an agent: a program with a non-zero number of LLM calls. In this book: LlamaIndex: Building a Knowledge Assistant › 6. Choose constrained or unconstrained on purpose · The Agent Framework Landscape › What the practitioners say.
1:00:00–1:06:00 Use cases and production#
Use cases he singles out are report generation, where a researcher agent retrieves chunks and fetches material from the web into a data cache and a second agent writes a report or a slide deck from it, with an optional third to check it; and, outside the slides, customer support, probably the leading practical enterprise use of agents. For production, each agent's behaviour sits behind an API and agents talk through a central message queue, so that the number of agents and of client sessions can grow; LlamaIndex runs each workflow locally or on Kubernetes. A human in the loop becomes a service: an agent that needs input sends a message and waits, as a coding agent does when it stops to ask what to do next. In this book: LlamaIndex: Building a Knowledge Assistant › What the practitioners say · The Agent Framework Landscape › What the practitioners say.
What to take away#
- Wang's bet is that applications become agentic, and that a multi-agent conversation is a programming model: define the agents, then get them to talk.
- Several small agents beat one overloaded agent, more so for weaker models and more complex tasks; a modular design also lets a person or a tool take over any agent.
- A knowledge assistant over complex documents starts with parsing: index several representations that point back to each source element, and let a multimodal model see the original.
- Choose constrained flows for reliability and unconstrained agents for expressiveness; in production, agents are services behind APIs that talk through a message queue.
Sources#
- Chi Wang and Jerry Liu, "Agentic AI Frameworks & AutoGen + Building a Multimodal Knowledge Assistant", UC Berkeley LLM Agents MOOC, Fall 2024 (CS 294-137): video.
- Course page: https://rdi.berkeley.edu/llm-agents/f24.