Table of Contents

Author :

Ampcome CEO
Mohamed Sarfraz Nawaz
Ampcome linkedIn.svg

Mohamed Sarfraz Nawaz is the CEO and founder of Ampcome, which is at the forefront of Artificial Intelligence (AI) Development. Nawaz's passion for technology is matched by his commitment to creating solutions that drive real-world results. Under his leadership, Ampcome's team of talented engineers and developers craft innovative IT solutions that empower businesses to thrive in the ever-evolving technological landscape.Ampcome's success is a testament to Nawaz's dedication to excellence and his unwavering belief in the transformative power of technology.

Topic
AI

Agentic Workflow: All you need to know about building AI agents

Agentic Workflow is an innovative approach that enables LLMs to take an iterative and multi-step process to execute complex tasks with 40% more accuracy.
Agentic Workflow - Ampcome
Author :
Ampcome CEO
Mohamed Sarfraz Nawaz
Ampcome linkedIn.svg

Mohamed Sarfraz Nawaz is the CEO and founder of Ampcome, which is at the forefront of Artificial Intelligence (AI) Development. Nawaz's passion for technology is matched by his commitment to creating solutions that drive real-world results. Under his leadership, Ampcome's team of talented engineers and developers craft innovative IT solutions that empower businesses to thrive in the ever-evolving technological landscape.Ampcome's success is a testament to Nawaz's dedication to excellence and his unwavering belief in the transformative power of technology.

Topic
AI

Artificial intelligence expert, Andrew Ng gave one of his excellent speeches at Sequoia Capital AI Ascent 2024 and guess what?

He brought to light a new trend in the AI landscape – Agentic Workflow and AI Agents.

Agentic workflow is an innovative process of interacting with LLMs to complete complex tasks and produce outputs that are significantly more accurate than traditional methods. 

Unlike the zero-shot method, Agentic workflow takes a more iterative and multi-step approach to break down one complex task into several small steps. This allows the model to consider your feedback at every step, self-reflect and collaborate with multiple agents to execute the tasks and produce output that’s over 41% more accurate than the conventional method.

This article aims to decode the concept of Agentic Workflow, its design patterns and workflow pillars.

What is Agentic Workflow?

Agentic workflow is the sophisticated iterative and multi-step process to interact and instruct Large Language Models to complete complex tasks with more accuracy.

In this process, a single task is divided into multiple small tasks that are more manageable and leave scope for improvements throughout the task completion process.

Additionally, the Agentic workflow also involves deploying several AI agents to carry out specific roles and tasks. These agents are equipped with specific personalities and attributes that make them capable of collaborating and executing defined tasks with high accuracy.

Another key highlight of Agentic Workflow is the use of advanced prompt engineering techniques and frameworks. The process includes techniques like chain of thought, planning and self-reflection that enable the AI agents to:

  • Break down complex tasks into manageable tasks
  • Determine the sequence of tasks
  • Adjust the task plan when faced with difficulties
  • Self-reflect their own output and identify areas of improvement

The prompt engineering techniques and multi-agent approach enable the AI agents to autonomously plan, collaborate, determine and execute the necessary steps to complete tasks.

Let's assume you ask the LLM to write you a blog. In the traditional approach, you will enter one prompt instructing the LLM to write a blog on a certain topic. It is like asking someone to write a blog from start to finish without reviewing the research sources, checking the outlines and improving the tone and quality of the content.

The traditional zero-shot approach leaves no scope for iterations, feedback and improvements during the process of writing the blog. This significantly reduces the accuracy and quality of the output.

On the contrary, in the Agentic workflow, we don’t give a single prompt to write the blog. Instead, we break down the task into smaller tasks like:

  • First researching the topic from credible sources
  • Creating a blog outline with headings and sub-headings
  • Analyzing, modifying and improving the outline
  • Writing the first draft of the blog
  • Proofreading and editing the blog to ensure high content quality

Here the LLM is instructed to complete the bigger task by following a step-by-step process. The output of each step acts as the input for the next task. 

In summary, Agentic Workflow is an iterative and collaborative model that transforms the interaction with LLMs into a series of manageable, refinable steps, allowing for continuous improvement and adaptation throughout the task-completion process.

Similarly, Andrew Ng in his speech showed a case study where his team evaluated the performance of GPT3 and GPT4 models on coding capabilities. The team used a coding benchmark HumanEval to test the difference in results between the traditional “zero-shot prompting” method and the Agentic Workflow method in solving code problems.

The task was: “Given a non-empty list of integers, return the sum of all even-positioned elements.”

  • In the zero-shot prompting technique, GPT-3.5’s accuracy was 48% and GPT-4’s accuracy was 67%.
  • But when the same task was done with Agentic Workflow, the output surpassed the accuracy of GPT-3.5 and GPT-4 using zero-shot prompting.
  • Using Agentic workflow on GPT-3.5 gave an accuracy of 95.1% on HumanEval which surpassed the accuracy of even GPT-4 on traditional prompting methods.

This case vividly demonstrates that even lower versions of large language models (such as GPT-3.5) can achieve superior performance in solving complex problems by breaking down tasks into multiple steps and repeatedly iterating and optimizing, surpassing the performance of a one-time direct output generation.

What Are The Three Pillars Of the Agentic Workflow Process?

There are three pillars of the Agentic workflow process.

  • AI Agents
  • Prompt Engineering
  • Generative AI Networks

Let's understand each of them.

AI Agents

  • AI agents are the core of the Agentic workflow process.
  • Each of them has their own personalities, roles and functions. 
  • They are trained and equipped with specific attributes that make them highly capable of carrying out intended tasks.
  • These AI agents also have access to tools and resources to be able to enhance their capabilities and to be able to perform tasks more efficiently.
  • These tools and resources help the AI agents to gather information, analyse the data and take action.
  • You can integrate tools like web search, image generation, code execution and more.

Also Read: What Are AI Agents? How To Build AI Agents For Your Business Tasks?

Prompt Engineering Techniques

  • The agentic workflow involves the use of techniques like chain of thoughts, planning and self-reflection.
  • In the planning technique, the AI agents are prompted to break down one big complex task into smaller tasks for efficient execution and management.
  • They also analyze the task at hand and decide the sequence of the tasks to be taken. Plus, the agents are well capable of adjusting the plans in case they face any challenges while completing the task.
  • The self-reflection technique is where the AI agents gain the capability to introspect and critique their own work.
  • These agents analyze the output, review and identify the areas of improvement based on self-feedback.
  • Self-reflection technique ensures that there’s always scope for improvements and iterations during the process of the task execution which eventually boosts the performance of the LLMs and enhances the accuracy of the output. 

Generative AI Networks (GAINs)

  • The essence of Agentic workflow lies in the multi-agent collaboration which is made possible by the deployment of GAINs.
  • Imagine a team of AI specialists, each with unique strengths. A coder writes the code, a critic analyzes the results, a designer creates the overall plan, and a CEO steers the project forward. This is the power of GAINs, a collaborative approach to AI problem-solving.
  • By working together, these AI agents can tackle complex challenges in a more comprehensive and innovative way than any single AI could on its own. GAINs bring together different perspectives and expertise, fostering a synergy that leads to groundbreaking solutions.

Agentic Reasoning Design Patterns

Andrew Ng explained 4 common AI agent design patterns to use in the Agentic workflow:

  • Reflection
  • Tool use
  • Planning
  • Multiagent collaboration

Reflection

This pattern features an AI system enhancing its capabilities through self-feedback and iterative refinement. By reflecting on and analyzing its initial output, the AI system can improve the quality and accuracy of its results. 

This method is applicable not only to programming tasks but also to other fields such as writing, design, or any activity that benefits from iterative improvement.

These techniques enable language models to become more adaptive and flexible, effectively catering to users' needs. In real-world applications, this method is frequently employed, involving multiple rounds of interaction and gradual corrections to help the AI deliver more satisfactory responses.

Tool Use

The concept of tool use emerged from early explorations in the field of computer vision. Initially, language models couldn't process images, so the solution was to create functions that could interact with visual APIs for tasks like image generation and object detection. 

With the advent of multimodal language models such as GPT, the idea of tool use gained popularity, transforming language models from isolated systems into intelligent agents integrated with external tools and knowledge bases.

Through tool use, language models can now undertake a variety of tasks, including web searches, code generation, and enhancing personal productivity, thereby significantly extending their original natural language processing capabilities. 

Looking ahead, the integration of tool use is likely to become a crucial direction in the evolution of language models, equipping them with enhanced planning, reasoning, and action capabilities.

Planning

Planning involves training language models to reason, devise, and decompose complex tasks. This capability allows language models to go beyond merely answering questions by proactively developing and executing action plans. 

With planning abilities, language models can autonomously break down tasks, identify the necessary substeps and tools, and coordinate the use of various models. 

For example, as Andrew mentioned, a language model might need to first detect a person's posture in an image, then call an image generation model to create a new image, and finally integrate it with voice synthesis to produce the final output.

Multi-agent Collaboration

Multiagent collaboration involves multiple language models or agents working together through interaction to complete complex tasks. 

For instance, simulating experts in different roles, like doctors and nurses, can help in jointly developing diagnostic and treatment plans. 

The crucial aspect of this approach is training the agents to collaborate efficiently, ensuring a clear division of labor to prevent conflicts and contradictions.

In the future, multiagent systems could become a powerful tool for solving complex problems, showcasing a level of collaborative ability that exceeds that of individual agents.

Final Thoughts

In conclusion, manually simulating Agentic Workflows within chatbots is not just a stepping stone, but a springboard. It propels us towards a future brimming with intelligent and collaborative AI systems. 

Through these simulations, we can unlock the true potential of LLMs and AI agents, fostering innovation and propelling us forward in the ever-evolving realm of artificial intelligence. 

The knowledge gleaned from these experiments will serve as the blueprint for crafting Agentic Workflows that revolutionize industries and empower real-world applications. 

As we delve deeper into this exploration, we stand poised to unlock a future empowered by effective AI collaboration.

Is finding the right tech partner to unlock AI benefits in your business hectic?

Ampcome is here to help. With decades of experience in data science, machine learning, and AI, I have led my team to build top-notch tech solutions for reputed businesses worldwide.

Let’s discuss how to propel your business!

Ready To Supercharge Your Business With Intelligent Solutions?

At Ampcome, we engineer smart solutions that redefine industries, shaping a future where innovations and possibilities have no bounds.

Agile Transformation