AutoGen tutorial: local agents with Ollama and TinyLlama

Learn to set up AutoGen with Ollama and TinyLlama using Python 3.10+, then define researcher, writer and reviewer agents in a five-round workflow.

Player not loading? Watch on YouTube

This tutorial explains a local AI workflow built with Microsoft's AutoGen framework, Ollama and TinyLlama. The speaker assigns researcher, writer and reviewer roles to separate agents, then passes their responses through a conversation loop. Each agent has a system message that describes its task.

Setup starts with Python 3.10 or above, Visual Studio Code and a Python virtual environment. The walkthrough installs AutoGen, downloads Ollama and pulls TinyLlama. Graphviz is optional for workflow visualization. The speaker describes this configuration as running without an API key or cloud connection after the model download.

The code explanation uses the AssistantAgent, GroupChat and GroupChatManager API style shown in the video, along with the model name and an Ollama server base URL. The script accepts a topic or uses a default request to explain artificial intelligence. It prints responses to the terminal and saves the conversation to a text file. The speaker sets five rounds and cites TinyLlama's limited context as the reason for keeping the exchange short.

The demonstration starts an artificial intelligence topic and shows an initial researcher response. The speaker notes that execution is slow and ends before the full workflow finishes. The research and review roles describe the intended behavior; the demonstration does not establish that the agents retrieve external sources or verify factual accuracy.