Hands-on Multi Agent LLM Restaurant Simulation, with Python and OpenAI

This is how I used Large Language Models Agents to simulate an end-to-end restaurant process, with Python. The post Hands-on Multi Agent LLM Restaurant Simulation, with Python and OpenAI appeared first on Towards Data Science.

Apr 28, 2025 - 18:48
 0
Hands-on Multi Agent LLM Restaurant Simulation, with Python and OpenAI

Last week, OpenAI released a PDF, and everyone is talking about it. This PDF is a 34-page guide that explains what LLM Agents are and how to use them.

The PDF is fairly short and also very readable (you don’t need to be a Prompt/Software Engineer to understand it), but in a few words, it explains three things:

.1. LLM Agents “are systems that independently accomplish tasks on your behalf.”

So aren’t they simple LLM prompts called through an API? Well, yes and no. You are using the same model(s) of Chat Completion, so they kind of are, but they are meant to create a specific action. What I mean by that is that the output of your agents should translate into an actionable output in your system. For example, if the LLM output says “spaghetti,” then “spaghetti” gets added to your data pipeline and eventually will be seen by someone who will cook spaghetti (spoiler).

2. LLM Agents are particularly well integrated with function (tools)

I am talking about when you ask a question to ChatGPT and it pulls out its image generator/web searcher/code snippets. It is internally using a function called tool, which is triggered by your prompt. Now, the image generator is an in-built function, but they can also call your function (tool), which you can specifically define for your task.

3. Multiple LLM Agents can be integrated back to back.

You can either integrate a single agent and provide him with multiple tools or split the tools into specific agents, which is what we are going to do in this article (second spoiler, lol).

Now, the technical details might be of interest to the software engineers, but why is this Agents thing a big deal for anyone else?
Well, it is because this is a paradigm shift that helps provide usefulness to the Open AI models. Think about it: now the LLMs provide actionable output. So it is not about using LLM prompts in the very last step of a pipeline to beautify your final output; it is about integrating your whole pipeline with LLM Agents to improve the whole pipeline quality.

As much as I try to explain it with words, I think it is just easier to show you. Let’s consider a restaurant, for example.

The standard restaurant has a very obvious natural pipeline: you wait in line, you order your food, you wait for your food, eat, and leave. Now, if we translate this with an “agent” approach, we can identify at least three agents:

  • The customer agent is an LLM Agent that orders food or asks the waiter for suggestions
  • The waiter agent is an LLM that collects the orders and provides suggestions when necessary
  • The entertainment agent is an LLM with the purpose of dealing with the complaints of the customers.

Now, OpenAI tells you very specifically how to build these beasts, but that’s the relatively easy part; there is much more, right?

We need to implement the restaurant, we need to create a queue method, where people get seated based on how busy the restaurant easy, we need to create the menu, simulate the waiting time, make sure everything works, and then and only then we can plug the agents in. As always:

Generative AI is powerful, provided it is in the right context.

So, before we get to the juicy part of the agents, in this article, you will see this:

  1. The System Design for the LLM Agent restaurant. A codeless idea, pen and paper (more like mouse and PowerPoint) scheme of the project.
  2. An Agent-free Restaurant implementation. plain and simple, just to create our code skeleton
  3. The Agent Restaurant implementation. Plus, a simple GUI to display it nicely
  4. Considerations and final remarks.

Looks like we have a lot of ground to cover. To the lab!                         </div>
                                            <div class= Read More