Exercise: Module 1, Lesson 3 - Designing an Agentic Workflow
Objective: To practice the principles of agentic design by conceptually mapping out the workflow for a new AI agent, without writing any code. This exercise focuses on the "whiteboard" or planning stage of agent development.
Your Task
Imagine you are tasked with designing a simple "Research Assistant" agent. The agent's goal is to take a user's question, research it online, and provide a summarized answer with sources.
Your task is to design the agent's workflow by defining its components, similar to how you would structure a graph in a framework like LangGraph.
Deliverable
Create a Markdown file that describes your agent design. Your design must include the following sections:
1. Agent's Goal:
- A single, clear sentence describing the agent's primary objective.
2. Tools Required:
- A list of the external "tools" the agent will need to perform its job. For each tool, give it a name (e.g.,
web_search) and a brief description of what it does (e.g., "Takes a search query and returns a list of URLs and snippets.").
3. Nodes in the Graph:
- A list of the key "nodes" or steps in your agent's workflow. Each node represents a function or a point of reasoning. You should have at least three nodes (e.g.,
planner,researcher,summarizer).
4. Edges and Workflow Logic:
- Describe the flow of logic (the "edges") that connect your nodes. Explain the step-by-step process the agent will follow from the moment it receives a user's question to when it delivers the final answer. How does the state change as it moves from node to node? When does it decide to use a tool?
Example Submission Snippet:
1. Agent's Goal:
To answer a user's question by searching the web, synthesizing the findings, and providing a concise summary with source URLs.
2. Tools Required:
web_search: A tool that takes a string search query and returns a list of relevant URLs.web_scraper: A tool that takes a URL and returns the full text content of the page.3. Nodes in the Graph:
planner: Takes the user's initial question and creates a step-by-step research plan.search_and_scrape: Executes the research plan by calling theweb_searchandweb_scrapertools to gather information.synthesizer: Takes the gathered information and the original question, and generates a final, summarized answer.4. Edges and Workflow Logic:
- The workflow begins at the
plannernode. It receives the user's question (e.g., "What are the benefits of a 4-day work week?") and generates a research plan (e.g., "1. Search for 'benefits of 4-day work week'. 2. Scrape the top 3 URLs. 3. Synthesize the findings.").- The output of the
planner(the plan and the list of URLs) is passed to thesearch_and_scrapenode. This node executes the plan, calling theweb_searchtool, and then passing the resulting URLs to theweb_scrapertool to get the full text of the articles.- The scraped text is then passed to the
synthesizernode. This node takes the raw text and the original user question and calls the LLM with a prompt like: "Based on the following articles, answer the question: 'What are the benefits of a 4-day work week?' Provide a summary and list the source URLs."- The output of the
synthesizeris the final answer, which is then returned to the user.