|
1 |
| -In this unit, you learn about AI Agents, which are autonomous entities capable of making decisions and performing tasks based on their environment and objectives. Also, you explore various agentic patterns - including the Evaluator Optimizer pattern - to improve the performance and decision-making capabilities of AI systems by evaluating and refining outputs. |
| 1 | +In this unit, you learn about AI agents, which are autonomous entities capable of making decisions and performing tasks based on their environment and objectives. Also, you explore various *agentic patterns* - including the Evaluator Optimizer pattern - to improve the performance and decision-making capabilities of AI systems by evaluating and refining outputs. |
2 | 2 |
|
3 | 3 | ## What is an AI Agent?
|
4 | 4 |
|
5 | 5 | An AI agent is a software entity designed to perform tasks autonomously or semi-autonomously by receiving input, processing information, and taking actions to achieve specific goals.
|
6 | 6 |
|
7 |
| -Agents can send and receive messages, generating responses using a combination of models, tools, human inputs, or other customizable components. |
| 7 | +Agents can send and receive messages, generating responses using a combination of models, tools, human inputs, and other customizable components. |
8 | 8 |
|
9 | 9 | ## What problems do AI agents solve?
|
10 | 10 |
|
11 |
| -AI agents offer several advantages for application development by enabling the creation of modular components that collaborate to reduce manual intervention in complex tasks. Key benefits include: |
| 11 | +AI agents offer several advantages for application development by enabling the creation of modular components that collaborate to reduce manual intervention in complex tasks. These advantage include the following key benefits: |
12 | 12 |
|
13 |
| -- Modular Components: Define specialized agents for tasks like data scraping, API interaction, or natural language processing. This modularity makes it easier to adapt the application as requirements evolve. |
| 13 | +- Modular components: define specialized agents for tasks like data scraping, API interaction, and natural language processing. This modularity makes it easier to adapt the application as requirements evolve. |
14 | 14 |
|
15 |
| -- Collaboration: Multiple agents can work together - one might handle data collection, another performs analysis, while yet another makes decisions - creating distributed intelligence. |
| 15 | +- Collaboration: multiple agents can work together. One might handle data collection, another might perform analysis, while yet another might make decisions, creating distributed intelligence. |
16 | 16 |
|
17 |
| -- Human-Agent Collaboration: Agents can work alongside humans to augment decision-making, for example, by preparing analyses that humans review and refine. |
| 17 | +- Human-agent collaboration: agents can work alongside humans to augment decision-making - for example, by preparing analyses that humans review and refine. |
18 | 18 |
|
19 |
| -- Process Orchestration: Agents can coordinate tasks across systems, tools, and APIs, automating end-to-end processes such as cloud orchestration, deployments, or creative workflows. |
| 19 | +- Process orchestration: agents can coordinate tasks across systems, tools, and APIs, automating end-to-end processes such as cloud orchestration, deployments, and creative workflows. |
20 | 20 |
|
21 | 21 | ## Agent workflows and patterns
|
22 | 22 |
|
23 |
| -Modern AI applications can be designed using a variety of agentic patterns. The Spring AI blog post on Agentic Patterns outlines several key workflows: |
| 23 | +Modern AI applications can be designed using various agentic patterns. The Spring AI blog post on Agentic Patterns outlines several key workflows: |
24 | 24 |
|
25 |
| -- Chain workflow: Breaks complex tasks into a series of sequential steps. Each step processes the output of the previous one, allowing for gradual transformation and refinement of data. |
| 25 | +- Chain workflow: breaks complex tasks into a series of sequential steps. Each step processes the output of the previous one, enabling gradual transformation and refinement of data. |
26 | 26 |
|
27 |
| -- Parallelization workflow: Executes multiple LLM calls concurrently using techniques like thread pools and futures. This pattern is ideal for processing large volumes of independent items or obtaining diverse perspectives through majority voting. |
| 27 | +- Parallelization workflow: executes multiple large language model (LLM) calls concurrently using techniques like thread pools and futures. This pattern is ideal for processing large volumes of independent items or obtaining diverse perspectives through majority voting. |
28 | 28 |
|
29 |
| -- Routing workflow: Directs inputs to specialized handlers based on content. By classifying the input and routing it to a corresponding prompt, the system ensures that each type of task is handled optimally. |
| 29 | +- Routing workflow: directs inputs to specialized handlers based on content. By classifying the input and routing it to a corresponding prompt, the system ensures that each type of task is handled optimally. |
30 | 30 |
|
31 |
| -- Orchestrator-Workers workflow: Uses a central orchestrator to decompose a complex task into subtasks that are handled by specialized worker agents. This pattern supports distributed problem solving while maintaining overall process control. |
| 31 | +- Orchestrator-Workers workflow: uses a central orchestrator to decompose a complex task into subtasks that are handled by specialized worker agents. This pattern supports distributed problem solving while maintaining overall process control. |
32 | 32 |
|
33 |
| -- Evaluator Optimizer workflow: Focused on iterative refinement, this dual-model approach uses a generator (writer) to produce an initial output and an evaluator (editor) to review and suggest improvements. The process repeats until the output meets defined quality standards. |
| 33 | +- Evaluator Optimizer workflow: focused on iterative refinement, this dual-model approach uses a generator (writer) to produce an initial output and an evaluator (editor) to review and suggest improvements. The process repeats until the output meets defined quality standards. |
34 | 34 |
|
35 | 35 | ## Advanced content generation with the Evaluator Optimizer Agent pattern
|
36 | 36 |
|
37 | 37 | Building on the core RAG functionality, advanced AI applications benefit from iterative refinement for generating high-quality content. The Evaluator Optimizer Agent pattern employs a dual-model process:
|
38 | 38 |
|
39 |
| -- Generator (Writer): Produces an initial draft, such as a blog post. |
40 |
| -- Evaluator (Editor): Reviews the draft, providing detailed feedback and identifying areas for improvement. |
| 39 | +- Generator (Writer): produces an initial draft, such as a blog post. |
| 40 | +- Evaluator (Editor): reviews the draft, providing detailed feedback and identifying areas for improvement. |
41 | 41 |
|
42 | 42 | ### How it works
|
43 | 43 |
|
44 | 44 | The following steps describe how this pattern works:
|
45 | 45 |
|
46 |
| -1. Initial generation: The writer creates a draft based on the given topic. |
| 46 | +1. Initial generation: the writer creates a draft based on the given topic. |
47 | 47 |
|
48 |
| -1. Evaluation: The evaluator reviews the draft against criteria such as clarity, engagement, and structure. |
| 48 | +1. Evaluation: the evaluator reviews the draft against criteria such as clarity, engagement, and structure. |
49 | 49 |
|
50 |
| -1. Iterative refinement: If improvements are needed, feedback is incorporated and the writer generates a revised draft. |
| 50 | +1. Iterative refinement: if improvements are needed, feedback is incorporated and the writer generates a revised draft. |
51 | 51 |
|
52 |
| -1. Loop until approved: The process repeats until the content meets the desired quality standards or a maximum number of iterations is reached. |
| 52 | +1. Loop until approved: the process repeats until the content meets the desired quality standards or a maximum number of iterations is reached. |
53 | 53 |
|
54 | 54 | ### Example application: blog post generation
|
55 | 55 |
|
|
0 commit comments