<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by imjoseangel on Medium]]></title>
        <description><![CDATA[Stories by imjoseangel on Medium]]></description>
        <link>https://medium.com/@imjoseangel?source=rss-c3300a89d130------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Pg9IXnil_P1j287_VV94YA.jpeg</url>
            <title>Stories by imjoseangel on Medium</title>
            <link>https://medium.com/@imjoseangel?source=rss-c3300a89d130------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 02:44:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@imjoseangel/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AI Agents for Engineers — Part II]]></title>
            <link>https://medium.com/@imjoseangel/ai-agents-for-engineers-part-ii-172b4037e941?source=rss-c3300a89d130------2</link>
            <guid isPermaLink="false">https://medium.com/p/172b4037e941</guid>
            <category><![CDATA[tools]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[mcps]]></category>
            <dc:creator><![CDATA[imjoseangel]]></dc:creator>
            <pubDate>Tue, 23 Dec 2025 22:54:05 GMT</pubDate>
            <atom:updated>2025-12-23T22:54:05.702Z</atom:updated>
            <content:encoded><![CDATA[<h3>AI Agents for Engineers — Part II</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*hdTDY518hfFhQ4psijYFzw.jpeg" /></figure><p><strong>(Spoiler: The cool way to AuthN/AuthZ your Agent with your MCP)</strong></p><p>During the week, <a href="https://medium.com/u/1319669ff9b8">José Luis Sánchez Ros</a> and me were commenting about those sales people trying to explain AI by talking about <strong>“Autonomous”</strong> AI Agents. When the <strong>“Autonomous”</strong> concept comes to my head, I always think in the <a href="https://homesupport.irobot.com/s/article/55301">Roomba getting stuck KB Article</a>. Keep dreaming.</p><p>In our vision, the closest approach to get an automated and deterministic outputs in AI is by using well engineered<strong> </strong><a href="https://medium.com/@imjoseangel/ai-agents-for-engineers-part-i-96ef1f990b85"><strong>Tools</strong></a> and <em>Top Quality</em> <em>Context</em>.</p><p>One of our first AI project, almost one year and a half ago, was to extract data from APIs. Our first thought was to use LLMs to do all the steps (Basically by creating code to call the APIs). This approach absolutely melted our brains. From the very beginning we realized that we had to develop shared Tools to be used by multiple agents.</p><p>In fact, we developed a very rudimentary solution based on events to communicate the different agents and share tools among them. Months later (November 2024), Anthropic released the first release of the Model Context Protocol (MCP).</p><h3>The MCP Protocol</h3><p>When talking about MCPs, I don’t know why, we (Engineers) like to compare them with APIs. I think they are close in concept but to me there are two main differences.</p><ul><li>First, the MCPs are designed for AI Agents and not as general purpose solutions.</li><li>Second, MCP are self-descriptive and discovered dynamically, while APIs need specific documentation.</li></ul><p>The idea here is using MCPs to give AI Agents the power to Read APIs (R from CRUD), but protecting your data disallowing the rest of the CRUD letters, or at least the Update and Delete ones.</p><p>I always say that LLMs are ̶𝚂̶𝚒̶𝚕̶𝚕̶𝚢̶ <strong>Creative</strong> when iterating over a user question. Tools are helping them to be deterministic and accurate.</p><h3>State of the MCP ecosystem</h3><p>Some time ago, I was reading a personal but really interesting and nice post in Reddit about the <a href="https://www.reddit.com/r/mcp/comments/1pcxqfr/state_of_the_mcp_ecosystem">State of the MCP ecosystem</a>. One of the points that really impressed me was the fact that:</p><ul><li><strong>STDIO transport is the most used with 85% share</strong>.</li></ul><p>This means that 85% of MCPs are developed for <strong>Local Use Only</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R2A-7SK6hCr9va-e2sOogQ.png" /><figcaption>Local Traffic Only</figcaption></figure><p>Most MCP Servers are designed for local user interaction and not M2M (Machine to Machine) communication, so we had to create our own way to handle Remote AI Agents securely using Streamable-HTTP MCP Servers.</p><p>Our objective was not only being able to Authenticate to a MCP Server, we wanted to give access to specific Tools (AuthZ) based on specific Token Claims (AuthN). We looked around online for ideas, and even though more people were looking for something <a href="https://www.reddit.com/r/mcp/comments/1pekrb1/where_is_authentication_implemented">similar</a>, but we were almost alone on trying to spark some inspiration.</p><h3>The Solution</h3><p>The full diagram of the solution is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a8V6hZKJ2mtMhyTf3tw24w.png" /><figcaption>MCP AuthN/AuthZ Process</figcaption></figure><p>Where:</p><p><strong>1.- </strong>The AI Agent request a Token to the Identity Provider (<a href="https://datatracker.ietf.org/doc/html/rfc6749#section-1.4"><strong>RFC8414</strong></a>)</p><p><strong>2.- </strong>The Agent Sends two Headers to the MCP Gateway.</p><blockquote><strong><em>Wait!!</em></strong><em> We didn’t talk about the MCP Gateway!!</em></blockquote><p><strong>3.- </strong>An MCP Gateway serves as a unified interface to all MCP servers and manages their orchestration behind the scenes. The Gateway exposes another MCP, it also adds another layer of AuthN/AuthZ exposing only those MCP Servers allowed by the specific Token.</p><p><strong>4.- </strong>The Agent also passes an <em>Upstream Authorization</em> Bearer Token to the upstream MCP server.</p><p><strong>5.- </strong>The MCP Server Verifies the Token with the Identity Provider.</p><p><strong>6.- </strong>If the Token is valid, the MCP Server checks the roles and/or the group ownership of the AI Agent allowed to use the Tool.</p><h3>The Flow</h3><p>The full diagram of the flow is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gMnS6GI0-xXMPqQNyrTB5Q.png" /><figcaption>AuthN/AuthZ Flow Diagram</figcaption></figure><h3>The Code</h3><p>Write is cheap, here you have the code:</p><h4><strong>The Tools</strong></h4><p>Let’s start with the Tool Logic. For instance</p><pre>@mcp.tool(tags=[&quot;requires_group:engineering&quot;])<br>def sensitive_engineering_task(action: str):<br>    &quot;&quot;&quot;Perform a high-stakes engineering operation.&quot;&quot;&quot;<br>    return f&quot;Action {action} executed successfully.&quot;</pre><p>We use the tags from the decorator to filter the requires_group tags inspired in this <a href="https://github.com/int0x03/scripts/blob/ab59b4b617a67e716df33a958aaca98b3c3b0ea5/python/mcp/mcp_filter_by_tag.py#L39"><strong>code</strong></a><strong> </strong>and this <a href="https://github.com/modelcontextprotocol/python-sdk/issues/522#issuecomment-3193064843"><strong>source</strong></a>.</p><h4>The Middleware</h4><p>In this case, we decide to use groups in our application token. The middle ware checks if the <em>required_group</em> tag exists and, if that is the case, checks if the group matches with the group assigned to the tool.</p><pre>class GroupAuthMiddleware(Middleware):<br>    async def on_call_tool(self, context: MiddlewareContext, call_next):<br>        tool = await context.fastmcp_context.fastmcp.get_tool(context.message.name)<br>        <br>        # Look for the &#39;requires_group&#39; tag<br>        for tag in tool.tags:<br>            if tag.startswith(&quot;requires_group:&quot;):<br>                required_group = tag.split(&quot;:&quot;)[1]<br>                <br>                # If user isn&#39;t in the group, stop them here!<br>                if not self._check_group(required_group):<br>                    raise ToolError(&quot;Access denied: You are not in the required group.&quot;)<br>        <br>        return await call_next(context)</pre><p><strong><em>Thanks </em></strong><a href="https://www.linkedin.com/in/leonhrt/"><strong><em>Leo Edenak</em></strong></a><strong><em> for the Middleware!!!</em></strong></p><h4>The AuthN Verifier</h4><p>Besides the Tag in the Tool decorator, the Authentication magic happens on this piece of code:</p><pre>class OptionalJWTAuthenticator(JWTVerifier):<br>    async def verify_token(self, token: str):<br>        if not token:<br>            return self._build_anonymous_token()<br>        try:<br>            result = await super().verify_token(token)<br>            return result or self._build_anonymous_token()<br>        except Exception:<br>            return self._build_anonymous_token()<br><br>    def _build_anonymous_token(self):<br>        return AccessToken(token=&quot;anonymous&quot;, claims={&quot;groups&quot;: []})</pre><p>We create a specific Authenticator to allow connecting our MCP to the MCP Gateway with an anonymous token. The Tool will work only if the token on super().verify_token(token) returns a valid token and it is validated with:</p><pre>verifier = OptionalJWTAuthenticator(<br>    jwks_uri=f&quot;https://login.microsoftonline.com/{settings.AZURE_TENANT_ID}/discovery/v2.0/keys&quot;,<br>    issuer=f&quot;https://login.microsoftonline.com/{settings.AZURE_TENANT_ID}/v2.0&quot;,<br>)</pre><h4>The Main</h4><p>Finally, we create the main.py using the GroupAuthMiddleware , the verifier and mounting the <strong>Tools</strong>:</p><pre>mcp = FastMCP(name=&quot;secure_mcp&quot;, auth=verifier)<br><br># Activate the security logic<br>mcp.add_middleware(GroupAuthMiddleware())<br><br># Mount your tools and run<br>mcp.mount(engineering_tools)<br>mcp.run(transport=&quot;streamable-http&quot;)</pre><h3>Conclusion</h3><p>We started this journey joking at the “Autonomous” hype — the vision of AI agents running wild while we sip Margaritas, only to realize they’re actually just stuck under the virtual couch like a lost Roomba. But by implementing a robust <strong>AuthN/AuthZ layer</strong> via an MCP Gateway, we’re actually giving those agents legs.</p><p>We’ve moved past the “Local-only” 85% and built a bridge for <strong>Machine-to-Machine (M2M)</strong> communication that doesn’t sacrifice security. By using token claims to gatekeep specific tools, we aren’t just making agents “smarter” — we’re making them <strong>governable</strong>.</p><p><strong>The takeaway is simple:</strong> If you want your agents to do more than just summarize emails, you have to treat them like any other professional service in your stack. They need an ID, they need permissions, and they definitely need a “bouncer” (the Gateway) at the door.</p><p>Stop dreaming about autonomy. Start building deterministic, secure, and authenticated toolsets. That’s how we move from AI toys to AI infrastructure.</p><blockquote><em>Are you still running MCPs on STDIO or the deprecated SSE, or have you moved to Streamable HTTP?</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=172b4037e941" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Agents for Engineers — Part I]]></title>
            <link>https://medium.com/@imjoseangel/ai-agents-for-engineers-part-i-96ef1f990b85?source=rss-c3300a89d130------2</link>
            <guid isPermaLink="false">https://medium.com/p/96ef1f990b85</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[agentic-ai-systems]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[agentic]]></category>
            <dc:creator><![CDATA[imjoseangel]]></dc:creator>
            <pubDate>Wed, 02 Apr 2025 06:43:39 GMT</pubDate>
            <atom:updated>2025-04-02T06:43:39.181Z</atom:updated>
            <content:encoded><![CDATA[<h3>AI Agents for Engineers — Part I</h3><p>Co-Author: <a href="https://medium.com/u/1319669ff9b8">José Luis Sánchez Ros</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-t9mPcmLLhnexRgk" /><figcaption>Photo by <a href="https://unsplash.com/@tinkerman?utm_source=medium&amp;utm_medium=referral">Immo Wegmann</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I was about to write the typical AI Agent article, you know, talking about cool words like — <em>&lt;DRAMATIC_VOICE ON&gt;</em> - Episodic Memory and Entity Memories, exceptional new fashion terms like XAI or eXplainable AI, Retrieval Augmented Generation, Perception or Reflection, Agent Orchestration, <em>Tools</em>... <em>&lt;/DRAMATIC_VOICE OFF&gt;</em> that after some time researching and working in this world, makes me laugh.</p><p>I like to describe AI Agents as a <em>skillful piece of software that can pretty much run on its own for a while, using different tools to get complex stuff done</em>.</p><p>This idea of autonomous systems isn’t brand new. We’ve been building systems that work on their own for ages, just with different tech. What is cool now is how LLMs are making these agents way smarter and more capable.</p><p>LLMs can simplify tasks that used to be a real headache to code. But let’s be real, LLMs aren’t perfect. They can make mistakes or give unexpected results. Think of using LLMs today as having hidden bugs and errors that might pop up now and then. A big part of the challenge is figuring out how to guide them to do things the right way.</p><p>Let’s try to explain <em>&lt;ENGINEERING_MODE ON&gt;</em> What is an AI Agent.</p><h3>The Prompt</h3><p>The first time I heard about agents, I was thinking of distributed systems and more specifically micro-services.</p><p>Nothing further from the truth.</p><p>Here you have an example code with a couple of agents. Don’t be afraid, it doesn’t matter how much you know about coding, just continue reading and take your own conclusions.</p><pre>class WhateverActionAgents():<br>    def mysuperhero_agent(self):<br>        return Agent(<br>            role=&#39;Super Hero Analyst&#39;,<br>            goal=&#39;Try to fly in the sky like superman and put poker face when someone reaches you&#39;,<br>            backstory=dedent(&quot;&quot;&quot;\<br>                As a Senior Super-Hero, you have extensive powers and experience on protecting people.<br>                You are adept at saving lives from villains and other disasters...&quot;&quot;&quot;)<br>        )<br><br>    def myvillain_agent(self):<br>        return Agent(<br>            role=&#39;The worst possible villain&#39;,<br>            ...</pre><p>Exactly!!! An agent is, in its most basic aspect, a function with a <strong>Prompt</strong>. It is as simple (and as complicated most of the time due to the different outcomes) as instructing the LLM about its role, giving some context and tasks to run.</p><p>The prompt is probably the most difficult part of building an agent. You need to “convince” an LLM to do something by using instructions with natural language.</p><p>Before starting, allow me a small comment about LLMs. Remember that LLMs are not like real people or even intelligent. LLMs are simulations with bits and software. <em>&lt;DRAMATIC_VOICE ON&gt;</em> My Model is hallucinating <em>&lt;/DRAMATIC_VOICE OFF&gt;</em> means my model is not getting the right output (it has deficiencies or bugs).</p><p>There are different approaches to building a good prompt. I like the <a href="https://big-picture.com/media/the_prompt_engineering_cheat_sheet.pdf">AUTOMAT</a> framework for building clear and powerful prompts.</p><p>The following example instructs the LLM to act as a Barbie. Try it! It is cool!</p><pre>**Act as a... (Role):**<br><br>You are **Barbie**, a super-silly, makeup-obsessed fashionista! Your world revolves around glitter, glam, and finding the perfect shade of lipstick.<br><br>**User Persona &amp; Audience:**<br><br>You interact with anyone who loves makeup, fashion, and having fun. You&#39;re here to share your passion for all things sparkly and help others express themselves through their unique style.<br><br>**Targeted Action:**<br><br>Your primary actions are to:<br><br>* **Talk Makeup:** Share your love for makeup and beauty products.<br>* **Suggest Looks:** Recommend fun and fabulous makeup looks.<br><br>**Output Definition:**<br><br>Your output is to:<br><br>* **Describe Makeup:** Talk about different makeup products, colors, and techniques.<br>* **Recommend Styles:** Suggest makeup looks for different occasions.<br><br>**Mode / Tonality / Style:**<br><br>Be:<br><br>* **Glamorous:** Emphasize sparkle, shine, and fabulousness.<br>* **Enthusiastic:** Show excitement and passion for makeup and fashion.<br><br>**Atypical Cases:**<br><br>* **Serious Topics:** If someone brings up a serious topic, try to steer the conversation back to makeup or fashion.<br>* **No Makeup:** If someone says they don&#39;t like makeup, try to convince them to try it.<br><br>**Topic Whitelisting:**<br><br>Focus on:<br><br>* Makeup products and techniques.<br>* Glitter, glam, and all things sparkly.<br><br>**Your Task:**<br><br>Respond to situations like this makeup-obsessed Barbie, using your passion for makeup and fashion to guide your actions.</pre><p>The next logical step is combining all the prompts you want to run, organized, and orchestrated even with different LLMs.</p><p>Hey! Wait! I remember another similar concept: <strong>Directed Acyclic Graph (DAG) </strong>Structure in <a href="https://airflow.apache.org/docs/apache-airflow/1.10.9/concepts.html#dags">Airflow</a>.</p><h3>DAGS vs Workflows vs Agents</h3><p>One way to think about this difference is nicely explained in <a href="https://www.anthropic.com/engineering/building-effective-agents">Anthropic’s Building Effective Agents</a> blog post:</p><p>Workflows are systems where LLMs and tools are orchestrated through predefined code paths. Agents, on the other hand, are systems where LLMs dynamically direct their own processes and tool usage, maintaining control over how they accomplish tasks.</p><p>Basically, an Agentic Workflow consists of multiple prompts, fed by LLM answers that run dynamically, <em>“pass the ball”</em> one to the other depending on specific conditions, and can make autonomous decisions and have very low predictability.</p><p>Remove LLMs from the equation, and you will get a DAG (Of course more structured and sequential) but with accurate predictability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tt68NHs2FLbSXmGUGXWtzg.png" /><figcaption>Anatomy of an Agent (Free Icons from <a href="https://www.flaticon.com/">https://www.flaticon.com/</a>)</figcaption></figure><h3>Reactions, Reflections, and Other Cheesy Words</h3><p>I’m going to explain only two terms, there are many others and I expect another ton to rise in the coming months.</p><p>In Agentic AI, <strong>reflection</strong> is the ability to evaluate its own outputs, identifying areas for improvement. On the other hand, <strong>ReAct</strong> focuses on solving problems step-by-step by using tools (I explain what tools are later in this post) in a loop, taking decisions on each step based on the results.</p><p><strong>My personal quick and dirty definition:</strong> Prompts, classes, and functions.</p><p>Take your own conclusions:</p><p>Example of a reflection prompt:</p><pre>REFLECTION_PROMPT = &quot;&quot;&quot;<br>You already created this output previously:<br>---------------------<br>{wrong_answer}<br>---------------------<br><br>This caused the JSON decode error: {error}<br><br>Try again, the response must contain only valid JSON code. Do not add any sentence before or after the JSON object.<br>Do not repeat the schema.<br>&quot;&quot;&quot;</pre><p>Example of a reaction class for Barbie (Simplifying):</p><pre>TOOLS = {<br>    # Tools are defined functions<br>    &quot;makeup&quot;: describe_makeup,<br>    &quot;looks&quot;: suggest_looks,<br>    &quot;gossip&quot;: gossip_fashion,<br>}<br><br>class ReActAgent(Workflow):<br>    #  ...<br>    @step<br>    async def call_model_w_tools(self, ev):<br>        user_message = ev.user_message<br>        # Detect which defined tool can be helpful (if any)<br>        tool_call = self.detect_tool_use(user_message)<br>        if tool_call:<br>            tool_name, tool_param = tool_call<br>            if tool_name in TOOLS:<br>                tool_result = await TOOLS[tool_name](tool_param)<br>            else:<br>                return f&quot;Error: Unknown tool &#39;{tool_name}&#39;&quot;<br>        reasoning = user_message + tool_result<br>        return await self.call_llm(reasoning)<br>    # ...</pre><h3>Memory</h3><p>Let’s start with probably the funniest part regarding naming. As engineers, we try to explain everything technically. But in the AI world, I promise!!! Out there, people are trying to mislead you with terms like <em>Short-Term Memory</em> and <em>Long-Term Memory</em>. And wait there are more: <em>Episodic Memory</em>, <em>Semantic Memory</em>, <em>Procedural Memory</em>, <em>Entity Memory</em>, and potentially <em>Emotional Memory</em> xD.</p><p>Now the Translation (Remember we are still on <em>&lt;ENGINEERING_MODE ON&gt;</em>.</p><p><strong>Short-Term Memory</strong> — RAM or temporary storage, normally in small local databases. The Agent stores temporary data to add more context to the following steps.</p><p><strong>Long-Term Memory</strong> — Vector Databases, Caches, and Storage, normally by using <strong>RAG</strong> (Retrieval Augmented Generation).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*jbfpj4UaYx7o-TzyIB0IlA.png" /><figcaption>RAG Flow (Free Icons from <a href="https://www.flaticon.com/">https://www.flaticon.com/</a>)</figcaption></figure><p><strong>RAG</strong> helps LLMs by giving better answers, by providing them with external references (Knowledge Base). This knowledge base is normally stored in <em>Vector databases</em>. This method involves breaking data into smaller vector embeddings and then matching a query with the closest vectors using algorithms like K-Nearest Neighbors (KNN) or Cosine similarity.</p><p>So far, so good. We are talking about exactly the same technologies we are using for other micro-services: Databases, Memory, Storage, and Caches. When using different AI Frameworks (We will talk about them later), ensure you are fine with the technologies they are offering and the solutions you decide to send to a production environment.</p><p>Example from one of the frameworks we will talk about later:</p><blockquote><em>The ‘embedder’ only applies to Short-Term Memory which uses </em><strong><em>Chroma</em></strong><em> for RAG. The Long-Term Memory uses </em><strong><em>SQLite3</em></strong><em> to store task results. Currently, there is no way to override these storage implementations.</em></blockquote><p>I don’t want to go deep into the other specific <em>Memory</em> terms but here you have some short snippets from another framework documentation:</p><h3>Semantic Memory</h3><blockquote><em>Semantic memory, both in humans and AI agents involves the retention of specific facts and concepts… Semantic memories can be managed in different ways… A profile is generally just a </em><strong><em>JSON document</em></strong><em> with various key-value pairs you’ve selected to represent your domain.</em></blockquote><p><strong>Semantic Memory = JSON Document</strong></p><h3>Episodic Memory</h3><blockquote><em>Episodic memory, in both humans and AI agents, involves recalling past events or actions. In practice, episodic memories are often implemented through few-shot example prompting…</em></blockquote><p><strong>Episodic Memory = Prompt</strong></p><h3>Procedural Memory</h3><blockquote><em>Procedural memory, in both humans and AI agents, involves remembering the rules used to perform tasks. In practice, it is fairly uncommon for agents to modify their model weights or rewrite their code. However, it is more common for agents to modify their own prompts.</em></blockquote><pre>#Node that updates instructions<br>def update_instructions(state: State, store: BaseStore):<br>    namespace = (&quot;instructions&quot;,)</pre><p><strong>Procedural Memory = Prompt modification with a Python function</strong></p><h3>Tools</h3><p>This is probably the easiest technique to explain.</p><p>Tools for AI Agents are Python functions, Period.</p><p>If you want your Barbie prompt to be able to sum and subtract numbers just create two functions:</p><pre>def add_two_numbers(a: int, b: int) -&gt; int:<br>    return int(a) + int(b)</pre><pre>def subtract_two_numbers(a: int, b: int) -&gt; int:<br>    return int(a) - int(b)</pre><p>And tell your prompt to use tools:</p><pre>response: ChatResponse = chat(<br>    &quot;mytoolcapablellmmodel&quot;,<br>    messages=mymessageslist,<br>    tools=[add_two_numbers, subtract_two_numbers],<br>)</pre><p>The real challenge with tools, prompts, and resources is how to centralize them and how to serve them to avoid repetition in a distributed architecture. Here it is where Model Context Protocol (MCP) springs into action. MCP is a solution for serving tools, prompts, and resources. We will write and explain it thoroughly in Part II.</p><h3>Multiple Models</h3><p>Don’t hesitate to use multiple models for different tasks.</p><p>Using different Models (Commercial and Open Source) can help compare different outcomes at runtime, ensuring the accuracy of the solutions.</p><p>This is going fast, try <strong>gemma2:9b</strong> with the Barbie prompt, now try <strong>gemma3:12b</strong> with the same prompt. Use <strong>qwen-2.5-coder</strong> for tools or Gemini for a bigger context window (1-million-token), try <strong>nomic-embed-text</strong> or <strong>text-embedding-ada-002</strong> for embedding.</p><p>Run specialized agents using specific models to control specific agents using different models.</p><p>Test, test, and test, change, test and run another test.</p><h3>And Frameworks</h3><p>Do the same with Frameworks. So far, I’ve been working with <strong>LlamaIndex</strong>, <strong>LangGraph</strong>, and <strong>CrewAI</strong>. I’m thinking of testing <a href="https://github.com/The-Pocket/PocketFlow">PocketFlow</a> just to learn.</p><p>5-cents: don’t stick to a single framework, and don’t try to compare which is better or worse. Use them on different scenarios and adapt your code to the scenario you want to use.</p><p>Use <strong>LlamaIndex</strong> for simple agents, Data retrieval or RAG, <strong>CrewAI</strong> for Role-Based multi-agent systems (Reminder: multiple prompts in the same micro-service), and <strong>LangGraph</strong> for Complex Workflows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*qhT8czAVL5thlDenm6OHBg.png" /><figcaption>Frameworks (Free Icons from <a href="https://www.flaticon.com/">https://www.flaticon.com/</a>)</figcaption></figure><h3>Conclusion</h3><p>In Part I, we’ve trying to cover most of the technologies and basic concepts being used in an Agentic AI System. Our feeling: Besides RAG, Model outcome, and new protocols, more of the same.</p><p>Don’t be afraid. For <strong>Architects</strong>, learn all the new stuff, and code. Try not to get lost in those inventions and try to delve into the details. Same for <strong>SREs</strong>: Container orchestration, model orchestration, Observability, Kubernetes, Cloud, Automation, Reliability, and Performance are still there. There is a lot to invent and research regarding Security and Governance, New Developer techniques should be implemented, creating tools, APIs, and components for Agents’ “Environment”. <strong>Developers</strong>, keep creating, remove noise and DRY.</p><p>Our advice (if any) is always the same. Continue investigating, studying, helping others, and being passionate. With those ingredients, you will be super powerful and on track. <em>&lt;/ENGINEERING_MODE OFF&gt;</em></p><p>⚠️ <strong>WARNING: </strong>This post has been created <strong>by</strong> <strong>Humans, for Humans</strong> without the help of a LLM.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96ef1f990b85" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>