Architecting Intelligent Agents: Multi-Step Reasoning with Live Demo
Swarnamalya Mohan55:042026
Agenții trebuie să-și câștige autonomia, nu să o primească din prima zi
Dacă întrebați un chatbot de ce a eșuat o implementare, vă oferă sfaturi generice de depanare; un agent poate citi logurile, verifica incidentele anterioare și deduce cauza principală. Această capacitate aduce însă și privilegii asupra instrumentelor și riscul unor acțiuni ireversibile. Swarnamalya Mohan, Senior Full Stack Developer la FedEx, construiește live un agent Gmail în jurul unei singure întrebări: cât de mult ar trebui să i se permită să facă singur?
Aflați cum să construiți agenți cu instrumente, memorie și aprobare umană și când să îi păstrați simpli
Swarnamalya Mohan, Senior Full Stack Developer la FedEx, explică ce face dintr-un agent AI mai mult decât un LLM: un model care lucrează cu instrumente, instrucțiuni, memorie și un flux de lucru controlat, într-o buclă de tip observare, raționament, acțiune. Prin demonstrații live în LangGraph, inclusiv un asistent Gmail cu aprobare umană și memorie, ea pledează pentru o abordare care pornește de la problemă și începe simplu, susținută de guardrails, observabilitate, evaluări și soluții de rezervă.
“Deci LLM-ul este un creier, dar tot ce determină rezultatul final sunt instrumentele, memoria și contextul.”
“Și, din nou, supraîncărcarea contextului este foarte periculoasă, pentru că o cantitate mare de conținut aruncată la grămadă este clasificată drept zgomot de agentul AI.”
What you will learn
Diferențiați AI-ul generativ de AI-ul agentic și explicați bucla observare, raționament, acțiune, răspuns care pune în mișcare un agent.
Stabiliți dacă o problemă are nevoie de AI, apoi alegeți între designuri bazate pe reguli, pe fluxuri de lucru, semi-autonome și autonome, cântărind autonomia față de controlul uman.
Construiți un agent ReAct în LangGraph cu instrumente Python decorate, un prompt de sistem, output structurat și memorie pe termen scurt prin checkpoint-uri și ID-uri de thread.
Adăugați întreruperi human-in-the-loop și memorie persistentă, astfel încât agentul să se oprească înaintea acțiunilor cu miză mare și să rețină preferințele utilizatorului.
Pregătiți agenții pentru producție cu descrieri precise ale instrumentelor, context concis, guardrails, logging, observabilitate, evaluări, reîncercări, soluții de rezervă și monitorizarea costurilor.
Details
Level
Intermediate
Format
Tech talk
Technical depth
Practitioner
For
Mid-career, Senior individual contributor
Length
55:04
Published
July 2026
Questions this talk answers
Prin ce diferă AI-ul agentic de AI-ul generativ?
AI-ul generativ produce un rezultat pornind de la un prompt și poate oferi doar sfaturi generice, de exemplu recomandări de depanare pentru o implementare eșuată. Un agent poate inspecta logurile sistemului, interoga baze de date și verifica incidentele anterioare pentru a deduce cauza reală.
Care sunt componentele de bază ale unui agent AI?
Mohan enumeră cinci: modelul ca creier, instrumente precum funcții Python sau wrappere de API, instrucțiuni sub formă de prompturi de sistem, memorie pe termen scurt și lung și un flux de lucru care rulează totul într-un mediu controlat.
Câtă autonomie ar trebui să aibă un agent enterprise?
Mai întâi confirmați că problema are nevoie de AI, apoi echilibrați autonomia și controlul uman între designuri bazate pe reguli, pe fluxuri de lucru, semi-autonome și autonome. Agenții semi-autonomi, care se opresc pentru aprobare umană la sarcinile cu miză mare, sunt un bun punct de plecare pentru companii.
Când ar trebui adăugate memorie, RAG sau mai mulți agenți?
Doar atunci când problema o cere: începeți cu un agent, un instrument și o sarcină bine definită. Sistemele multi-agent aduc costuri și latență mai mari și sunt greu de depanat, așa că adăugați-le doar când un singur agent nu poate gestiona sarcina.
Ce face ca un agent AI să fie pregătit pentru producție?
Tratați-l ca pe orice sistem distribuit: logarea fiecărui pas, observabilitate, de exemplu cu LangSmith, evaluări pe baza unor rubrici, reîncercări și soluții de rezervă elegante, plus atenție la cost și latență. Adăugați guardrails, validare înainte de acțiune, aprobare umană pentru pașii riscanți și permisiunile potrivite pentru instrumente.
AI generativ vs agentic: testul implementării eșuate (59 s)
Are problema ta nevoie de AI? (86 s)
Începe simplu: un agent, un instrument, o sarcină (84 s)
Speaker: Okay. Let's get started. Firstly, thank you so much folks for joining this session and thank you Women in Tech for such a valuable initiative because it's empowering the women community. And a brief intro about myself, I'm Swarnamalya Mohan, working as a full stack developer at FedEx and primarily involved in building and training AI/ML models and pipelines.
So today I'll be talking about architecting the intelligent agents using the multi-step reasoning approach. We all know that AI is moving in a very faster pace, more than just beyond a chat based interactive interface. So today we'll be building and designing systems that can reason through action and decide what step it has to execute, identifies what tool calls it has to perform, and it can also communicate with different other models.
Speaker: So let's take a deeper dive into looking at what it takes to build an AI agent and what are the patterns, architecture, and the engineering practices to build a more trustworthy and reliable AI agent. So the goal of this session is not just to impart the conceptual knowledge, but we'll also be connecting and translating all the concepts to live demos, to a live real world working sessions. So let's get started. So let's take our overall agenda, what's going to be covered. So I'll kickstart with the agent fundamentals, with the definition components and what makes the agent loop. And then following which I'll cover the architecture, the system components and the code building tools that's involved.
Speaker: Finally, we'll delve into each component in detail, which is the tools prompting context and memory. And we'll also take a look at the most interesting topic, which is the multi-agent systems. And we can also see what disciplines and standards are required for building a more trustworthy and very production ready AI agent. So the demo is not actually in the end. I'll be navigating between the demo Speaker 3: The demo and the presentation slides for us to translate and connect the ideas. Okay, let's get started. So the first question is, does AI agents really matter? Yes, AI agents does significantly matter because there is a rapid shift from a simple answer generation system to a complete task execution system. So we all have worked with the traditional chatbots. So the chatbot
Speaker 3: The chatbots are very reactive in a way that, you know, you ask a question, it helps you with the answer. It's definitely helpful, but I would say it's very limited in its use. The chatbots does not really know what lives in your system. It cannot query your logs, or it cannot see what has gone broken or failed in your logs. So they're very limited and helps with this very simple prompt. But the AI agents Speaker 3: It goes a step further. So they can interact with the tools, they know what exactly lives in your system, and they can interact with the observability platforms, just to understand the context behind. So that's where AI agents are more powerful and superseding. So this opens up use cases to building a customer support agent, or it could also be like an incident triage agent in the enterprise world. So this opens up use cases to building a customer support agent, or it could also be like an incident triage agent in the enterprise world.
Speaker 3: So these are reshaping on how we see the systems, while it does the task seamlessly, end to end. So AI agents does play a very significant role. Speaker 3: So looking about the distinction between the generator AI and the agentic AI. So a generator AI just produces the output by taking a simple prompt, while agentic AI goes beyond a single point.
Speaker 3: A step further, and then reasons, not just by producing an output, it interacts with the tools, it interacts with databases, queries your enterprise documents, and it can do many more. So let's take an example here, consider a case where I would like to, you know, look for the failed deployment. And I would ask the generator AI in this case. So I would ask the reason behind my failed deployment. And all that the generator AI Speaker 3: Is capable to give is a very generic troubleshooting advice, because it does not know what is what my system looks like, right? It does not know what lives in my system. But agentic AI knows to inspect the system logs, it can read my Splunk logs on my data trace logs. And it can also check the previous incidents. So let's say there is a similar incident that has occurred in the past. So it will be able to infer the root cause of the root
Speaker 3: And analysis and analysis and findings based on it. So that makes the agentic AI more powerful than Generative AI in a way that it does not give a generic advice. It gives you a very super refined and fine tuned advice and recommendation solutions. Speaker 3: So let's take a look at what the definition of an AI agent is. Well, there's no Speaker 3: one size fits all definition for an AI agent. All that I can say is it is more than just an LLM. So it is a reasoning system at its core that's interconnected with five major core components. The first one comes as the model. So you can imagine model like a brain of an LLM that's capable to reason and decide. And the next one is the tools. So tools are something like, you know, it could be as simple as Python
Speaker 3: function functions or it could be like a wrapper that the agent can call and instructions. So this is a very powerful one because instructions nothing but the system prompts, which are like the guidelines that you provide to the agent stating that this is the role you play. This is the persona you own. And you know, the constraints or identities that you can define for an agent. Coming next is memory. So memory again has two different types.
Speaker 3: One is the short and the long term memory. So we know that memory is very essential for remembering the context. Like let's say you have a conversation follow up. You do not have to provide all the context right from scratch. So memory facilitates for remembering the context and provides for persistent storage. And next comes to work flow.
Speaker 3: So all these interconnected components should be executed in a control environment. And that's where work flow takes care of it. So you can imagine workflow like a framework or something that helps to execute each task in a very controlled environment. So these are the five major components that makes up an AI agent. Let's take a closer look at the agent loop. So this is again a very interesting and something important topic in the agentic AI. So it starts with observing the user task. So it first receives the user task, observes what user input is and then tries to reason through the task. It identifies what is required to execute the task and accomplish the task. It identifies what tool calls are required for it and then acts
accordingly. So the action is nothing but performing the tool calls. So the tool call is like you know triggering the web search or triggering any external APIs or it could be any database queries or you know enterprise documents. So it acts accordingly. So once it retrieves the information with the tool calls, it responds or generates the final output. So here is the endless loop it follows until the task is being accomplished. So this is how we define an AI agent with a very stateful way where it starts with observing and goes on to the loop until it accomplishes the task.
So let's take a look at what the agentic AI systems are. So before taking a look at what the classification buckets are, let's flip the narrative here. So my recommendation to any enterprise problem is the problem first approach where we start to identify what are the gaps or what pain points we need to address in an enterprise level and then decide if the problem requires AI because not always all problem requires AI. And if you're able to solve without AI well and good because you're saving the cost, latency and the complexity of it. But then if you see that the problem necessitates the use of AI, that's where we'll have to decide the degree of autonomy and the role of human control that you want to
retain. Because it's always a trade-off that you have between the degree of autonomy and the human control you want to retain and based on which we have these four buckets of classifications. So the first one is like the rule-based system. So the rule-based system is like a traditional if-else-then condition. It has a very fixed flow and there's nothing that can you know break or impose a lot of control on. So this can be classified as low autonomy and low control and following which we have workflow agents.
But yeah, rule-based does not have any usage of AI. It's a very traditional conditional constraint. And then we have workflow agents where it gets started with an AI, but it's a very predefined sequence that follows. Now, let's take an example of a document processing agent. So all it is defined to do is just extract the contents of the document and then read through it and then summarize it. So it's a very predefined way and it does not deviate from its process.
So this can be classified somewhere between low to moderate autonomy to low to moderate control because we do not face any failures or fall back for this. And coming to the semi-autonomous agents. Yeah, semi-autonomous are again a very good approach to get started in enterprise because they do have agents that can reason dynamically, but it also pauses for human approval whenever there is like a high risk or a high stake task that it determines. So it's a very good blend of AI agent and a human intervention. So this is a very good start.
And the final one is autonomous agents. These are very powerful in a way that it does not have any human control on it. So it does not require or it requires just minimal human input. So it's a very powerful one, but at the same time, it carries a higher risk of it because it can do any irreversible tasks and it can lead to any real time consequences. So the trade-off between autonomy and the human control is very essential in designing any of the AI systems or AI agents.
Okay, now let's take a closer look at the architecture because we'll be closely moving to the demo now. So with that, we have the LLM at the core of execution because LLM is like the brain of an AI agent where it has the capability to reason and decide. So the LLM receives the user request in the form of a user prompt. And what it does is it identifies what tools and APIs it has to call. So as mentioned, tools could be like your web search database or any API call. And then it identifies if there is any memory or context preferences that it needs to decide before making a final outcome decision. So the memory could be like, you know, short term conversation, or it could also be like a long term that is stored in your persistent
database. And context is like the state of the current window. So the current conversations or the current tool outputs, everything matters for context. And context is also like the deciding factor for reasoning. So LLM is a brain, but all that drives the final output is tools, memory and context. So the final response is basically a blend, a proper blend of all of this. And that's what makes the AI agent more stateful rather than just having an LLM embedded, it makes it more stateful because it is surrounded by tools, memory and context. Okay, I'm revisiting this site, because we are very much close to connecting these building blocks to a demo. Now, here, we get started with the model first. So models could be any of
your desired model. It could be open AI model or the cloud, Gemini, or it could also be like open source models, like your hugging face models, etc. But it's based off, you know, the reasoning capability you need, the latency, the cost that the project involves. And it could also be what tools support the model offers. So that's something that has to be taken into concentration. And next, we'll look at what the tools are. So tools are like Python functions.
Or APIs, and prompts are like the system instructions. While state is nothing but your context. And the runtime execution is land graph. So it's not just land graph. There are multiple other runtime execution of frameworks that exists. But for this demo, I'm going to consider the land graph because it provides a very simplistic and, you know, realistic way of creating agents. And it orchestrates agent in the form of graph that's composed of nodes and edges.
So let's now take a look at the demo. So I have two demos lined up. So this is like a starter demo, just to give you the illustration of how tools and everything are designed. And then we'll move to the product demo. So this is a simple agent that fetches the weather conditions provided you give the city name. So I'm using my open AI API key for this. And then here's where the tool definition comes in.
So this is like your Python function that gets the weather condition. And this is the tool decorator to denote that this is the tool that the agent has to use. And here's the model initialization portion where you're initializing the open AI model. And this is the in-memory saver. So in-memory saver is the built-in land graph memory that provides you for saving the current conversation, or it could be like your tool outputs.
But this is not a long term. It is like a short term memory store. But in case if you prefer for a long term, you should always go with your persistent database or relational database, or any of the SQL databases that you wish to reference it across the sessions. And now here's where the agent gets created. So the create react agent is the land graph inbuilt function. So react stats for reasoning and action, and you pass the model, and you bind it with the tools. So the tools is nothing but get weather.
And then you give the system prompt stating that you're a helpful assistant, and you give the checkpoint, which means it takes the snapshot at every instant. So it's like giving you a context that saves it at every time. And you take that snapshot and store it in the thread ID. So the thread ID that's used is the user session one. So in case I have to follow up the same conversation, I access it using the same config.
So this is the first response I would like to invoke the agent with. So I'll ask what is the weather at Raleigh. And then let's look at the response. It says the weather in Raleigh is sunny. Now, if you look at the second prompt, I just asked what about New York, I'm not providing what context about New York needs to be fetched, or what details about New York needs to be fetched.
It is able to infer that the weather in New York is also sunny, because I'm passing the config, which maintains the conversation context, because the config stores the user session ID, which is relating to the weather. So, it infers that it is about the weather condition, and it provides that the weather in New York is also sunny.
So this is like a basic illustration of how tools model AI agent can be created using LandGraph, and how memory plays like a pivotal role. I have added a few of the complexities going further here. So the other way is, this is a useful way of defining a schema. Let's say you want a fixed schema to be output. And in that case, you give this is the schema. And while creating the agent, you pass the response format, and the agent gives in the schema, the city conditions and recommendation.
So in this case, you're asking the weather in Raleigh, and also you're just asking for the outfit recommendation. So the LLM is able to identify and give you the output recommendation based on the weather condition. Since it is sunny, it has recommended like wear light and breathable clothing, and then don't forget sunscreen. So this is how the OpenAI models are able to reason and give it to the agentic flow.
Now I've added a second round of complexity here. So instead of hard coding that the weather is sunny, I want to fetch what is the exact temperature in that particular city. So what I'm using is I'm using the OpenMeteor API call. So this helps us fetch the weather condition. So it makes use of the latitude and longitude if we pass the city name. So it takes care of getting the weather conditions.
So all I need to pass is what is the temperature in Raleigh. So I'm passing the city and it takes the city and finds the location based on the latitude and longitude it computes and gives us the temperature in Raleigh. And it also gives us the weather conditions like the humidity and the wind speed. So in this case, the tool that we invoke here is an API. The first case we invoke the tool, which was a Python wrapper or a function.
So in this case it has an API call to an external API. So this is like a starter demo before we get to the product now. Yeah, this is another level of complexity I've added where we are encoding the weather codes and then having the recommendation of clothing in a very structured manner. So all we do here is again the same, we do the tool call using, so there is two tools. One is to get the weather clothing.
There is another tool that gets the weather code to text. So there are two tools that's involved here and the agent knows what tool to call here, finally returns the output. So even in this case, you see, I asked the first context as what should I wear in Raleigh. And the second thing is just what about New York.
It maintains it because it has the memory that is stored. So the follow up conversation is maintained using the in context memory. And then you ask it to compare both the places and tell me which output is better. So this is the response that I've received. So it says the current temperature is about 53 and then the recommendation of clothing and similarly in New York, and then it does the comparison.
So this is how we develop the AI agent. And this is like a very simple AI agent and straightforward tool implementations. Now let me take to another demo where we are building a Gmail agent assist. So the intention of having a Gmail AI agent assist is to interpret the incoming emails and then identify what category does it belong to.
Let's say the Gmail is marketing or a spam mail that does not require a response. So it's something that can be ignored. And there is another category of email that requires the response. Let's say there's an email that asks me to schedule a call. So that requires a response. And there's another category that agent cannot deal on its own.
Let's say there is a partnership email, which I cannot miss and let AI agent deal on its own. So that's something that the AI agent has to notify. So these are three categories the agent identifies and classifies into. And based on the categories it responds accordingly. So this is how the code works like. I'm not going to delve deeper because of the time limitations, but I can give the overall view of what tools we use in this and then give the working demo of it.
So at the first place, we are having three tools. One is to write the email. So this is relevant to the Gmail. And the second one is to schedule a meeting. And this makes use of calendar. And next is to check the calendar availability. This is again making use of a calendar. So there are primarily three tool implementations where Gmail and calendar are the two tools that the AI agent refers for making any decision.
And then we have this classification based on the emails that is either ignore, respond or notify. Now let me trigger. So I do have this in my GitHub repo and the links would be shared in the towards the end of the presentation. So I'm deploying this using the streamlet. So it provides like a lightweight deployment platform to have the applications deployed.
And again, this AI agent has three versions. One is that runs a basic Gmail assist. And the second thing is it runs with human in the loop, which means there is a human intervention. And third thing is it demonstrates the usage of memory because adding preferences to memory helps us, you know, access it across the sessions and not just that for that session.
So it helps us access it multiple times and we do not have to repeat the same repetitive queries. So it is deploying in the streamlet. Okay, here we go. So this is the first version where it just interprets what type of email it is and then does the further action. So here's the incoming email we have from John and the subject is to schedule a call to discuss the tax planning strategies for the year.
Now let's run the Gmail assistant and let's see what it classifies this email into. So it's analyzing it. Yeah, so the triage decision is respond because it requires, it requires a calendar or a time schedule. So the triage decision is respond. And here's the final generated message by the agentic AI. So it says, thank you for reaching out.
I'm available on Tuesday and have scheduled a 45 minute call. But how did it arrive at this decision? Let's trace the stack. So this is the first incoming email that the agent has received. So John has sent the email to request for availability on Tuesdays and Thursdays. So AI has interpreted the message. And the first thing it does is it checks the calendar availability.
So it does the tool call. So the tools, the tool used here is calendar. And the calendar tool has returned the message. It is available on 19th from nine, three available slots. And again, on Thursday at three available slots. Finally, AI agent now goes ahead and uses the earliest time to schedule the meeting, which is 19th, which is Tuesday.
And then it would schedule the calendar invite stating that on Tuesday for 45 minutes with two attendees. Once it schedules a calendar invite, it also has to draft the email and send it as a response to John. So the next tool message is to Gmail. So it sends the email confirming the availability. And finally, the AI message is done.
So this is how the entire tool call is performed endless towards the, you know, by using the tool calls and then identifying the available slots and doing it more seamlessly. So this is how the AI flow is designed in the agent. And we can also take a look at the context because I've been emphasizing on what the context is and why is it so important.
But this is how the context looks like. So it stores all the current conversation into the message and keeps appending the same thing, the messages on using the same, same vectors tool, which is message. So we see the human message, which is the first message that John has sent. The second one is AI interpretation, where it calls the tool that is calendar for availability.
And this is the tool message where tool returns the message outputs. And again, it goes back to AI reasoning. And again, tool message for scheduling the meeting. So it goes on. So this is how context is maintained and provided for the AI agent at the moment of reasoning. Now let's consider another scenario. This is to respond. I have another sample template where I have like a newsletter email.
And let's see how the AI agent decifies this as. So I'm just passing the newsletter content here, the newsletter email that I've received. Okay. Now we see the decision is ignored because it does not require any response or it does not require any human intervention because it's just an informational email. So it identifies it as ignored and there is no final generated message or there is no steps that's continuing further.
Now, this is the first version. Let me deploy the second version, which includes human in the loop. So, this is like interrupts in between pauses before it even sends the email because we want the human confirmation or human approval. I do not want the AI agent in it on its own. Okay. So it's deploying the app here.
Yeah. GitHub link will be shared towards the end. Uh, I do have the QR code or I can share it now itself. I have shared the GitHub link. Okay. Now let's take a look at the human in the loop. So I do have the same email that John has requested for the time on Tuesdays or Thursdays. Let me run the assistant.
Now it has requested telling that human approval is required. So it has not drafted or sent the message yet. So what this does is it does the same way. Uh, it proposes the, uh, preferred date and time, which is 45 minutes. And on 19th, because it has inferred using the calendar tool and it has found my available slots.
And I do have my time availability on Tuesdays and Thursdays, and it is, uh, taking the latest one. Now I can either approve the action and then, uh, go ahead, uh, to have the AI agent to, uh, draft the email and confirm to send it. But I can also give the feedback. Now let's say I do not want it on 90.
I do not want it for 45 minutes. I would say, keep the call for 30 minutes. And let me send this feedback. Now we see in the edited tool arguments, the AI agent has now corrected the time to 30 minutes because I do not prefer a 45 minute call. Let me submit the edited arguments for the AI agent to now go ahead and send the email.
Now I see it is a 30 minute call. Okay. This is my preferred time. Let me approve the action for it to send the email to John. Yeah. Now it has sent the email with suggesting a 30 minute call. So this is how a human in the loop can interrupt pause and then give the feedback and then AI agent corrects it accordingly.
So the stack trace follows the same where the incoming email is being interpreted by AI. And then we see the AI calling the available tools, which is calendar and Gmail in this case. It finds the available slot and then it goes forward to propose the earliest time. But then there is again a user feedback because there's an interrupt that is triggered.
And all that AI does is it considers the final feedback and goes ahead to change the proposed time. And finally, it schedules it for 30 minutes with two attendees using the calendar. And then it writes the email as well. So there is a tool called to the Gmail to send the email to John with 30 minutes. So this is how human in the loop is being performed.
And this is really helpful in enterprise scenarios because we cannot let the AI agent deal on its own. And we would require human intervention in any high risk or high stake activities. So this is a very good illustration for the human in the loop. Now, there's a second one that tests for memory. So let's say I do not want to input the preferences again and again.
And I want my AI agent to remember it once I input and it has to take that into consideration whenever there is a further emails on similar basis. Now, let me hit the agent that triggers the memory as well. Let's open it now. Just deploying. And so memory helps us identify what preferences user wants to be stored persistently.
And it also helps us add what kind of email needs to be classified into ignore, respond and notify categories. So that we do not have to repeatedly tell the agent to do the same thing. Now we have the same email from John. Let me run the assistant. Okay. Now, we have the proposed agent action where it asks for human approval.
And also we see that it has scheduled it for 45 minutes on 19th. Now I do not want it for 45 minutes. So let me give the feedback as, and I'm not going to approve this. Let me give the feedback as schedule tax calls for 30 minutes. Let me send the feedback. And yeah, so we have the tool arguments edited to 30 and let me also submit.
Okay. Now before submitting it, this is how the memory looks like. So now the calendar preferences has the updated, updated record as well, which is the new preference that I have right now, which is the tax call should be scheduled for 30 minutes always. Now let me submit the edited arch. And let me approve the action because it looks good for me.
Now we'll see the AI agent would go ahead and send the email scheduling it for 30 minutes. This is the final message that AI agent has sent. Thanks for reaching out. I've scheduled a 30 minute call for Tuesday. Now let's see how memory plays a role. I am going to start a new thread, keeping the new mem, keeping the memory retained.
Now let me run the assistant again. So now this is like a new call to the AI agent. Now this is like a second time the AI agent is able to see the same email from John. Now let's see how it infers the proposed time. Just give me a minute. Let me start it from first. Because it has lost the context.
Let me give. Schedule tax meetings for 30 minutes. Let me send it back. Let me send feedback. So the edited tool argument is 30 minutes. Let me start the new thread, but keeping the memory. Run the assistant. Yeah. So ideally it should keep the memory in place and then suggest it only for 30 minutes. Even when you run the AI agent assist for the second time.
So it is still considering 45 minutes, but ideally it should be keeping it 30 minutes. Because that's how the memory is being stored. And it would prefer the same thing to be considered as user preference for the second time. So that's how memory keeps the AI agent to remember the context and continue it for the second time.
And so these are the versions of Gmail AI agent assist. That helps us with drafting the emails and then collaborating with the calendar tool. To identify what are the available slots and then store the preferences in memory and then send the email. Now let's continue with the presentation. We just took a look at how the LAN graph provides inbuilt capabilities to define the tool, to initialize the model and to provide the system prompts and to create the react agent, which is reasoning and action agent, and then invoke it with the user message.
So let's take a look at what are the standards that defines the tool. So vague tool descriptions or very vague tool patterns or tool definitions is very harmful because the AI agent will determine what tool to call and when to call based on the tool descriptions. So it's very essential for us to define the exact definitions of the tool that it is intended for.
And as mentioned, the tool could be anything, it could be like a weather API or it could be like your web search or it could be any database lookup or a SQL query to database. And next comes the prompts. So prompts makes the AI agent more powerful in a way that defines what role person or it has to play in its own.
And there are different types of prompt where it ranges from static, dynamic and runtime. So static is like where the AI agent is fixed throughout its life cycle. So let's say you want the agent to only act as an on call instant triage agent. Then in that case, you just give your helpful instant triage identifier. Your intention is to identify the severity, the probable root cause and the findings of the issue or incident.
And that helps to retain the scope of the AI agent to be acting as only the instant triage agent. The next one is the dynamic prompt. So dynamic prompt is like it's dependent on the state of the agent. Let's say you want the agent to cite the documents provided it has retrieved the documents. So you cite the documents only because it has retrieved it.
And also it's dependent on a state. So wherever there's reliability on a state, the dynamic prompts comes into place. There's also another example where we can say to deviate to a different tool in case of failures. Because tools and APIs does fail due to timeout issues or anything. So there's a way of deviating the AI agent workflow.
And finally comes the runtime personalization. So this is again a very powerful one. It allows us to inject the user specific metadata or the preferences or the time zone during the runtime. And these are the different prompts. So recommendation would be to start with the static prompt because static prompt is very simpler and does not create ambiguity to the AI agent.
And then proceed for dynamic prompt only when necessary. Again, context engineering is again the most powerful or it makes the agent more different from just an LLM. Because it is able to carry forward the state, the outputs of the tool, outputs of intermediate decisions and everything. So again, there is two types. One is static. It is because it is fixed at the prompt creation while dynamic is injected at the runtime.
And again, context overloading is very dangerous because dumping a lot of content is classified as noise by AI agent. It might hamper the efficiency of the AI agent. So context engineering is very pivotal for any AI agent creation. So as discussed memory, there are short term memory to retain the context and long term memory for persistent store.
It could be like in database. And there's again the scoped memory based on the user session and the project storage. So the user memory is primarily for user preferences and session is for storing any of the session workflow files and everything. And project memory is any of the project files or artifacts that helps the AI agent run seamlessly.
Coming to planning. So this is how AI agents can deal with a very complex task, which is not straightforward. So if the task is too big for it to understand, then what it does is it reasons through a task, identifies what manageable or breakable steps it can lead to, and then execute it with each step. So this is the difference between the direct tool calling and planning.
So in planning agents can plan and then break it into steps manageable enough for it to run and then execute each step. While direct tool calling, for example, we took a look at the weather fetch API call, which is a direct tool call. All you need to is to get the information about the city. So that's a straightforward, but then when there is a repetitive task or when there is a task that's involved in sequential manner, it requires planning.
And this helps the AI agent to return the output without hallucination. Next comes the agentic rag. So agentic rag is very different from traditional rag because a traditional rag, all it does is it fetches the grounded information and it gets the top K chunks of, chunks of information that relates close to the query. But agentic rag moves beyond that.
In agentic rag, retrieval is a tool, which means it can call the tool any number of times with the optimized query and with whatever search it needs to find. So let's say the agentic rag wants to do a broader search at first time and do a fine tuned or narrow search. So it can call multiple times the rag.
So agentic rag makes it more powerful rather than a traditional drag because retrieval becomes a tool and the document search is also very optimized with the query. So this is very helpful in enterprise where there are 5,000 documents and information scattered across. So it plays a very pivotal role to have information more structured and organized retrieval. Next coming to the multi-agent systems.
Multi-agent systems is the most interesting one because it allows the agents to spin up specialized agents. Let's consider an example where we have a research agent, a code execution agent and a writing agent where each one is specialized to do its own task. So research is to find its findings and summarizes it while code execution agent is for running the code and running the test and snippets.
And writing agent is for drafting the content and giving the summaries and gives the formatting in the right format. So all this is managed by one supervisor or central node that delegates the responsibility based on the task it receives. So it identifies which agent is specialized to do what task and it delegates and handoffs the task. Once the task is accomplished by each of the specialist agent, it provides and it goes back to the control to the supervisor and fetches all the output it has received.
And supervisor decides what information has to be sent to the user based on its overall reasoning and findings. This is very powerful, but it also is very complex because in case of any failures or something, it's very hard to debug and trace back the failures. So it's very powerful in a way, but also it involves its own cost latency and the complexity in tracing back the fallback mechanisms.
Now, what it takes to build a very trustworthy AI agents. So AI agents has access to all the tools. It has all the privileges. So the trust is a very important concept in this AI agents. And since AI agents is responsible for completing and executing the task end to end, it can lead to real world consequences in case of any irreversible actions.
So in order to eliminate or prevent all the dire consequences, we set up the guardrails. So guardrails are something like instructing the agent what to do and what not to do and setting the input/output filtering schema validation. So let's say somebody asked the AI agent about the credit card details. It shouldn't even reach the tool. So it should block the request at the user level or user prompt itself in such a way that there is no breaching or violation of information.
And next comes validation before action. So always agents has to validate the plan task before it is executing. And that way we can minimize hallucination or incorrectness that it might encounter. So this third thing is human in the loop where we are involving the human intervention and allowing the human to take the high-stake or high-risk actions. Without human approval, it cannot go ahead and proceed.
And the final one is safer tool execution because it has access to all the tools. So giving the right permission is very essential. And also logging all the tool calls and all the tool outputs is very essential. So it does not exceed its privileges. So we're almost towards the end of the slide where we can wrap up with discussing the production considerations.
So designing an AI agent almost follows the same discipline as you design any other distributed systems in enterprise. So the first and foremost is the basic one, which is logging. So logging each and every conversation right from system prompt to tool outputs to reasoning context till it gets the final output state. So in that manner, we are able to identify what are the multi-step failures it has encountered and helps us trace it.
So observability is again, a very important concept as it allows us to trace every step of execution in the AI agent. And Langsmith is one that offers the observability that's integrated with the Lang graph. So it helps us to visualize the execution path as we took a look at the demo. And then identifies to monitor how the AI agent does the flow from the start to the calling of tools and then finally rendering the output.
And then we have the evaluation. So evaluation is primarily setting up evals for correctness and then ensuring that the model is assessing the right output because at every stage we need to implement evaluation using the rubrics that helps the model to have its capability more efficient. In that way, we do not run into any production issues or failures.
And the retries and fallback is essential here because we are making use of APIs and we are also making use of tool calls. So APIs might timeout, this might also fail. So in that case, how do we gracefully degrade the AI agent? So that's very essential for us to define it and pre-define it very explicitly during the creation of agent.
And finally one is cost and latency. So AI agent is really very expensive because it makes use of a lot of tool calls, tokens, and there is LLMs that stands at its core of execution. So cost and latency must be taken into consideration while developing and scaling any AI agent project. With this, I would like to summarize the key takeaways of this session.
So always start simple. That is, start with one agent, one tool, and one well-defined task. So once you identify what the problem is and then start to start to assemble each component and adding memory and drag is not really essential because if drag is just providing you with grounded document search and memory is just providing you with continuation.
So identify if your problem necessities. So identify if your problem necessitates the use of memory and drag and then add it only when necessary. And adding human review or human in the loop is very essential for us to approve the high stake or high risk tasks. So implementing the right guardrails, evaluation strategies, and adding human in the loop wherever necessary is very critical.
And finally, multi-agents is not really essential because it has specialist agents and it is needed only when the agent is too small for the task that it cannot handle a complex or very ambiguous task. And it really demands a specialist agent. So because multi-agent always comes with the higher cost and latency. So it is always incremental. I would like to wrap it up with one thought.
AI agent is not giving autonomy on day one. It is about building intelligence system that has the ability to reason, observe, evaluate, and iterate on its own. So that's what makes production AI agents more reliable, robust, and greater to the production scale. With that, we'll be wrapping up. And there are resources that relates to the GitHub. And if you want to have any questions that you want to be addressed, you can scan this QR code and you can have all the resources attached to this.
Yeah. And we are at the end of the session. Thank you so much for attending. Let me look through if there's any questions that I need to answer. Sunita, thank you so much. Yeah. I'm residing a trally. Happy to connect with you. Okay. Thank you all for attending the session. Um, you can reach out. Thank you.
Transcribed automatically; names checked against the speaker record. Select a time to jump there.
Article based on this talk
Ce presupune construirea unui agent AI în care poți avea încredere în producție
Swarnamalya Mohan arată de ce agenții au nevoie de instrumente, memorie, aprobare umană și disciplină și de ce autonomia trebuie să vină la final.
Pe scurt
Swarnamalya Mohan, Senior Full Stack Developer la FedEx, susține că un agent AI este mult mai mult decât un model lingvistic: este un sistem de raționament învelit în instrumente, instrucțiuni, memorie, context și un flux de lucru controlat. Sfatul ei este să pornești de la problemă, să începi cu pași mici și să adaugi autonomie, memorie, regăsire de informații și agenți suplimentari doar atunci când sarcina o cere. Ea își susține ideile cu demonstrații live în LangGraph, de la un simplu agent meteo la un asistent Gmail care se oprește pentru aprobare umană.
Idei principale
Înțelegeți arhitectura de bază a agenților AI inteligenți și modul în care aceștia permit raționamentul în mai mulți pași.
Aflați cum folosesc agenții planificarea, memoria, regăsirea și orchestrarea instrumentelor pentru a rezolva sarcini complexe.
Urmăriți un demo live al unui agent AI care trece de la raționament la execuție într-un caz de utilizare real.
Explorați modele practice de design pentru construirea unor sisteme de agenți fiabile, scalabile și pregătite pentru producție.
Obțineți idei pentru aplicarea conceptelor de agenți AI în aplicații enterprise și orientate spre dezvoltatori.
De la răspunsuri la acțiuni
Mohan deschide prin a compara chatboții cu agenții. Un chatbot este reactiv: răspunde la întrebări, dar nu poate vedea ce se află în sistemul tău, nu îți poate interoga logurile și nu observă ce s-a stricat. Exemplul ei este o implementare eșuată. Un model generativ poate oferi doar sfaturi generice de depanare, în timp ce un agent poate inspecta logurile sistemului, verifica incidentele anterioare și deduce cauza principală.
Ea evită să supraliciteze o definiție unică. „Tot ce pot spune este că este mai mult decât un simplu LLM.” (5:28) Enumeră cinci componente: modelul ca creier, instrumente precum funcții Python sau wrappere de API, instrucțiuni sub formă de prompturi de sistem, memorie pe termen scurt și lung și un flux de lucru care rulează totul într-un mediu controlat. Acestea se reunesc în bucla agentului: observă sarcina utilizatorului, raționează asupra a ceea ce este necesar, acționează prin apeluri de instrumente și răspunde, repetând până la finalizarea sarcinii.
Începe cu problema, apoi alege autonomia
Înainte de a clasifica tipurile de agenți, Mohan întoarce narațiunea spre o abordare centrată pe problemă, pentru că nu orice problemă are nevoie de AI. „Și dacă poți rezolva fără AI, cu atât mai bine, pentru că economisești costul, latența și complexitatea.” (8:59)
Când AI-ul este justificat, alegerea esențială de design este compromisul dintre autonomie și controlul uman. Ea descrie patru categorii: sisteme bazate pe reguli, cu logică fixă de tip if-then și fără AI; agenți de tip workflow, care urmează o secvență predefinită, precum un procesor de documente care extrage și rezumă; agenți semi-autonomi, care raționează dinamic, dar se opresc pentru aprobare umană la sarcinile cu miză mare; și agenți autonomi, care au nevoie de un input minim, dar pot efectua acțiuni ireversibile. Ea consideră agenții semi-autonomi un bun punct de plecare pentru companii.
În arhitectura ei, LLM-ul se află în centru, dar nu lucrează singur. „Deci LLM-ul este un creier, dar tot ce determină rezultatul final sunt instrumentele, memoria și contextul.” (13:18)
Demo-uri live: de la instrumentul meteo la asistentul Gmail
Demo-urile folosesc LangGraph ca mediu de rulare. Un agent introductiv obține vremea pentru un oraș printr-un instrument Python decorat, iar saver-ul în memorie integrat în LangGraph și un ID de thread mențin conversația, astfel încât o întrebare ulterioară despre New York funcționează fără a repeta contextul. Apoi adaugă o schemă de răspuns structurat, un apel către Open-Meteo API pentru temperaturi reale și un al doilea instrument, arătând cum agentul alege ce instrument să apeleze.
Demo-ul principal este un asistent Gmail implementat cu Streamlit. Acesta triază fiecare email ca ignorare, răspuns sau notificare, apoi folosește instrumente de calendar și Gmail pentru a verifica disponibilitatea, a programa o întâlnire și a răspunde. Un newsletter este ignorat corect. În versiunea human-in-the-loop, agentul se oprește înainte de trimitere; Mohan schimbă apelul propus de 45 de minute la 30 de minute, iar agentul își actualizează argumentele instrumentului înainte de a acționa. „Și acest lucru este foarte util în scenariile enterprise, pentru că nu putem lăsa agentul AI să se descurce singur.” (33:21) O a treia versiune stochează preferințele în memoria pe termen lung. În rularea live, agentul a propus totuși 45 de minute într-un thread nou, iar ea a explicat că ar trebui să preia preferința de 30 de minute.
Proiectarea fiecărei componente cu disciplină
Mohan trece apoi prin fiecare componentă. Descrierile instrumentelor trebuie să fie precise: „Deci descrierile vagi ale instrumentelor sau tiparele ori definițiile foarte vagi ale instrumentelor sunt foarte dăunătoare, pentru că agentul AI va determina ce instrument să apeleze și când pe baza descrierilor instrumentelor.” (40:21) Prompturile pot fi statice, dinamice sau personalizate la rulare, iar ea recomandă să începi cu cele statice, pentru că generează mai puțină ambiguitate. Și contextul are nevoie de inginerie: „Și, din nou, supraîncărcarea contextului este foarte periculoasă, pentru că o cantitate mare de conținut aruncată la grămadă este clasificată drept zgomot de agentul AI.” (43:13)
Ea abordează și memoria delimitată la nivel de utilizator, sesiune și proiect; planificarea, prin care un agent împarte o sarcină complexă în pași gestionabili; și RAG-ul agentic, în care regăsirea devine un instrument pe care agentul îl poate apela de mai multe ori cu interogări rafinate. Sistemele multi-agent, cu un supervizor care deleagă către agenți specializați în cercetare, cod și redactare, sunt puternice, dar aduc cost, latență și erori greu de urmărit.
Construirea încrederii și drumul spre producție
Pentru că agenții dețin privilegii reale, Mohan enumeră guardrails precum filtrarea inputului și a outputului, validarea înainte de acțiune, aprobarea umană pentru pașii cu risc ridicat și permisiunile potrivite pentru instrumente, cu fiecare apel logat. Pentru producție, ea tratează agenții ca pe orice sistem distribuit: logging, observabilitate cu LangSmith, evaluări pe baza unor rubrici, reîncercări și soluții de rezervă elegante, plus atenție la cost și latență. Concluzia ei este directă: „Așadar, începeți întotdeauna simplu. Adică începeți cu un agent, un instrument și o sarcină bine definită.” (52:23) Iar gândul final: „Un agent AI nu înseamnă să dai autonomie din prima zi. Înseamnă să construiești un sistem inteligent care are capacitatea de a raționa, observa, evalua și itera singur.” (53:47)
Urmăriți prezentarea
Architecting Intelligent Agents: Multi-Step Reasoning with Live Demo, Swarnamalya Mohan, 55 de minute: https://www.womentech.net/video/architecting-intelligent-agents-multi-step-reasoning-live-demo
Despre vorbitoare
Swarnamalya Mohan este Senior Full Stack Developer la FedEx, concentrată pe construirea de aplicații enterprise scalabile și soluții tehnologice inteligente pentru operațiunile logistice. Are experiență în dezvoltare full-stack, sisteme distribuite, tehnologii cloud și aplicații bazate pe AI și este pasionată de proiectarea unor soluții practice care îmbunătățesc eficiența și experiența utilizatorilor.
Întrebări la care răspunde prezentarea
Prin ce diferă AI-ul agentic de AI-ul generativ?
Care sunt componentele de bază ale unui agent AI?
Câtă autonomie ar trebui să aibă un agent enterprise?
Când ar trebui adăugate memorie, RAG sau mai mulți agenți?
Ce face ca un agent AI să fie pregătit pentru producție?
Redactat cu AI pe baza transcrierii prezentării. Revizuirea editorială este în așteptare.
Frameworks and ideas mentioned
ReAct (reasoning and acting)
Agent loop (observe, reason, act, respond)
Problem-first approach
Autonomy versus control classification (rule-based, workflow, semi-autonomous, autonomous agents)
Human in the loop
Retrieval-augmented generation (RAG)
Agentic RAG
Supervisor multi-agent pattern
Context engineering
Resources mentioned
Speaker's GitHub repository with the demo code (shared via QR code)
LangGraph
LangSmith
Streamlit
Open-Meteo API
Cite this talk
Swarnamalya Mohan. "Architecting Intelligent Agents: Multi-Step Reasoning with Live Demo." WomenTech Network, 2026. https://www.womentech.net/video/architecting-intelligent-agents-multi-step-reasoning-live-demo