作者:Lance Eliot
Best practices in prompt engineering for the latest advances in generative AI and agentic AIs.
In today’s column, I identify and showcase a new prompting approach that serves to best make use of multi-agentic AI.
The deal is this. We are increasingly going to witness the advent of agentic AI, consisting of generative AI and large language models (LLMs) that perform a series of indicated tasks. Turns out that there are going to be quite a number of these agentic AIs. The question then becomes how you can suitably compose prompts that will invoke the right set of agentic AIs to get whatever work you want done.
There could very well be dozens, hundreds, or thousands of agent AIs to call upon. Your prompting must make sure to hit the nail on the head, otherwise, you’ll potentially invoke agentic AIs that you didn’t need to engage, plus you might miss the boat and fail to invoke agentic AIs that you should have involved.
Let’s talk about it.
This analysis of an innovative AI breakthrough is part of my ongoing Forbes column coverage on the latest in AI including identifying and explaining various impactful AI complexities (see the link here).
Readers might recall that I previously posted an in-depth depiction of over fifty prompt engineering techniques and methods, see the link here. Top-notch prompt engineers know that seriously learning a wide array of researched and proven prompting techniques is the best way to get the most out of generative AI and likely garner you some good bucks for your skilled deeds.
A new twist to the prompt engineering field is the emergence of agentic AI.
I’ll get started by discussing what agentic AI consists of.
Imagine that you are using generative AI to plan a vacation trip. You would customarily log into your generative AI account such as making use of ChatGPT, GPT-4o, o1, o3, Claude, Gemini, Llama, etc. The planning of your trip would be easy-peasy due to the natural language fluency of generative AI. All you need to do is describe where you want to go, and then seamlessly engage in a focused dialogue about the pluses and minuses of places to stay and the transportation options available.
When it comes to booking your trip, the odds are you would have to exit generative AI and start accessing the websites of the hotels, amusement parks, airlines, and other locales to buy your tickets. Few of the major generative AI available today will take that next step on your behalf. It is up to you to perform those nitty-gritty tasks.
This is where agents and agentic AI come into play.
In earlier days, you would undoubtedly phone a travel agent to make your bookings. Though there are still human travel agents, another avenue would be to use an AI-based travel agent that is based on generative AI.
The agentic AI has the interactivity that you expect with generative AI. It also has been preloaded with a series of routines or sets of tasks that perform the efforts of a travel agent. Using everyday natural language, you interact with the agentic AI which works with you on your planning and can proceed to deal with the booking of your travel plans.
Voila, this agentic AI proceeds to undertake a series of efforts to fulfill your travel booking request.
If one agentic AI is a good thing, we might as well up the ante and aim to leverage a multitude of agentic AIs. The world is headed toward having a zillion agentic AI agents that do this or that. I assure you; this is going to make everyone’s head spin. There will be more AI agents than you can poke a stick at.
The good news is that there will be plenty of agentic AIs to pick from. Riches aplenty. The bad news, as it were, will be that trying to determine which ones to invoke is going to be a bear.
Imagine that you enter a prompt that invokes a slew of agentic AI agents. If you’ve inadvertently invoked some that don’t need to be used, that’s bad for you. The odds are that you’ll need to pay for their usage, regardless of whether it was of use to you. There is also a solid chance that an agent AI that wasn’t relevant could end up messing with whatever you were trying to undertake.
The other side of that coin is when your prompt doesn’t invoke AI agents that you should have engaged. Oopsie, now the problem will be that your solving efforts might falter. A crucial AI agent that should have gotten underway was not activated. Like a weak link in a long chain, the lack of invoking even one of the needed AI agents might produce either no answer or a faulty answer.
For my latest coverage on the emerging role of said-to-be “orchestration” for multi-agentic AI, see the link here.
During my classes on prompt engineering, I emphasize that when it comes to composing prompts that are associated with multi-agent AI, you can think of the situation as consisting of two major approaches.
The two approaches are:
There are tradeoffs between those two approaches.
The driver’s seat is handy because you are explicitly stipulating the AI agents and how they are to be made use of. In a sense, this lessens the chances of some messiness if you were to allow generative AI to take the reins and ascertain which agents ought to be used. You are driving the car. Period, end of story.
Being a driver of a car can be burdensome.
Instead, sometimes it’s great to be a passenger. You simply say where you want to go and let the generative AI figure out the rest for you. This entails broadly stating what task or tasks are to be performed. The generative AI will hopefully do a bang-up job of selecting suitable agents and getting them going correctly.
Sometimes you should use the driver’s seat style, other times you should use the passenger’s seat style. It all depends on the circumstance at hand.
In a moment, I will walk you through some illustrative examples so that you can plainly see what the prompting looks like.
Before we get there, I would like to add some rules of thumb that I explain in my courses. There are five rules that are associated with each of the two approaches. Please know that many more rules are possible. I’ve condensed this to the key five rules per each approach.
My Driver’s seat rules are as follows.
My Passenger’s seat rules are as follows.
You will see these come into play in the examples I am about to showcase.
Let’s lay out a multi-agent AI scenario that is relatively straightforward. This will allow me to then indicate various prompts associated with the situation at hand.
The domain I’ve chosen has to do with using generative AI and agentic AI to help with doing coding, programming, or developing software. As you look at the examples, generalize since the same precepts apply to using agentic AI in other domains. I just picked coding because it is fresh on my mind and something that I use AI with all the time.
Envision that there are these five AI agents that you can invoke:
It is important for you to know something about the nature of the AI agents and any conditions associated with them. Let’s consider those various aspects.
You can use any of those AI agents. There isn’t a requirement that you use them, instead, they are merely available in case you would like to use them. Each one is a distinct or separate agent. The good news is that they readily share data with each other. They will automatically do so, and you don’t have to give any specific instructions to them in that regard.
None of the AI agents will automatically invoke another one. It is up to the mainstay invoker to specify a sequence of agents to be invoked when needed, and the mainstay invoker stipulates what the desired sequence is.
There is some overlap among the AI agents. For example, CodeReviewer reviews code and could potentially identify security vulnerabilities during that review process, while BugHunter explicitly seeks to find security vulnerabilities and will doggedly try to discover them. They both touch upon security. Another example is that CodeFixer optimizes code, and so does PerfAnalyzer. Keep in mind those overlaps and decide which of the AI agents you think will best befit your needs.
The easiest showcase consists of my taking the driver’s seat. In my prompt, I will tell generative AI which of the agent AIs are to be invoked. In a sense, generative AI is merely a conduit and will proceed to execute the agentic AIs as I have stipulated in my prompt.
Here we go.
Observe that generative AI sought to clarify what I wanted to have done and gave me a helpful recap. This is useful since I might have blundered or forgotten to invoke an agentic AI that would be important to use. Likewise, generative AI might have misinterpreted my prompt and improperly laid out what needed to be done.
Generative AI tried to double-check my request and suggested that an additional agentic AI be run. I told the generative AI that running the additional AI agent wasn’t necessary in this instance.
Nice to see that AI had my back.
Happy face.
In this next example, I want to do the same thing I did above, but this time I am going to let generative AI determine which agentic AIs to invoke. I am in the proverbial passenger’s seat. Leave the driving to AI. That’s sometimes a huge convenience.
Here we go.
You can see that the generative AI told me which of the various available AI agents it was anticipating running. Whether you care to know or not, that’s up to you. You can explicitly tell the generative AI to simply get going and not explain what it is going to do.
Generally, my preference is to have generative AI tell me what it is planning to do. In this instance, the generative AI was going to run the DocWriter agent. I don’t need that right now. Running it would have needlessly increased my billing charges -- I only run DocWriter once I’m sure my code is done and ready to be shipped.
If you are opting to use the passenger’s seat approach, make sure to be overt about wanting to use agentic AI. I mention this because your prompt might otherwise be overly vague, and the generative AI won’t catch your drift.
Look at this example.
In this case, the generative AI luckily opted to ask me for some well-needed clarification.
The problem with my vague “help me with my Python script” is that the generative AI could have gone in a wide array of directions. Maybe the generative AI would try to solve the issue directly and not invoke any AI agents. Perhaps the generative AI would simply sympathize with my plight and say something trite like don’t get down about needing help writing your code.
Remember, using generative AI is like a box of chocolates – you never know for sure what you might get out of a prompt. Try to always be as specific as you can.
The AI research community is pushing mightily ahead on the intricacies of multi-agent AI. You can expect new insights to arise nearly daily. I strive to bring the especially notable ones to your attention.
Speaking of which, a recent research paper entitled “AgentRec: Agent Recommendation Using Sentence Embeddings Aligned to Human Feedback” by Joshua Park and Yongfeng Zhang, arXiv, January 23, 2025, made these salient points (excerpts):
I thought you might find this particular study of keen interest due to the use of a specialized method for selecting AI agents.
Another factor I liked was that they did an interesting experiment consisting of eight AI agents and invoking them via thousands of prompts. Doing this in the large helps to identify what works and doesn’t work in the long run.
An imperative aspect of the above research study is that there is a solid chance of purposely getting generative AI to be especially good at selecting which AI agents ought to be run for a given request by a user. We can lean into the pattern-matching facility of generative AI to do so.
It goes this way.
Feed lots of examples of prompts and subsequent agentic AI choices into generative AI for a data training exercise (essentially, pairs that align). Generative AI will hone in on which prompts are best fitting for which agentic AI selections. After enough data training, the idea is that the prompt you enter as a passenger’s seat style approach will be suitably matched to which agentic AIs should be invoked. Thus, the generative AI will do better than mere chance since it has been specially data-trained accordingly.
I expect we’ll see a lot more of this as a means of inching generative AI toward the best or some optimal selection of AI agents.
Now that you know about invoking multi-agent AIs and the kinds of prompts to be used, I would urge you to consider practicing doing so. Practice makes perfect. Practice, practice, practice.
Admittedly, practicing is a bit challenging right now because few of the major generative AI apps are directly allowing users to invoke AI agents. Some of the generative AI apps will invoke them on your behalf, but not even necessarily tell you when this is being done, nor which ones are being invoked. It is all a mixed bag. Rapid changes are happening.
Best of luck and you might keep the famous words of Abraham Lincoln in mind: “The best thing about the future is that it comes only one day at a time.”
That equally applies to the advent of multi-agentic AI.