<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>José Enrique Pons</title>
<link>https://jpons.es/articles.html</link>
<atom:link href="https://jpons.es/articles.xml" rel="self" type="application/rss+xml"/>
<description>Enterprise &amp; AI architecture: agentic AI, AI governance and the engineering behind production AI.</description>
<generator>quarto-1.11.9</generator>
<lastBuildDate>Wed, 16 Jul 2025 00:00:00 GMT</lastBuildDate>
<item>
  <title>Hugging Face Agents Course</title>
  <link>https://jpons.es/posts/2025-07-16-HuggingFaceAgentsCertification.html</link>
  <description><![CDATA[ 





<section id="whats-an-agent" class="level1">
<h1>What’s an agent</h1>
<p>The first question to ask would be “What’s an agent”. Then, why do we use them, and finally what are the benefits of using an agent over a language model (LLM) with plugins.</p>
<p>I’ll try to ask all of these questions.</p>
<section id="whats-an-agent-1" class="level2">
<h2 class="anchored" data-anchor-id="whats-an-agent-1">what’s an agent?</h2>
<p>An agent is a set of at least three things: - The Brain: a large language model (LLM). Could be open source or commercial. The LLM is in charge for the planning of actions. - The heart: These tools provide the connection between the LLM and the external world. A tool could be something as simple as a calculator, but it could be more complex, something like a sheet reader or a Wikipedia article reader. - A lifecycle: Most of the agents implement the so-called <a href="https://huggingface.co/learn/agents-course/en/unit1/thoughts">ReAct approach</a> (Reasoning and Acting). This approach ask the model to think step by step providing a plan that leads to the final solution rather than a final solution.</p>
</section>
<section id="why-do-we-use-them" class="level2">
<h2 class="anchored" data-anchor-id="why-do-we-use-them">Why do we use them?</h2>
<p>There are several reasons why an agentic approach is superior to a LLM:</p>
<ul>
<li>The agent has a specific workflow. The most common pattern is ReAct (but there are others). We give the agent a task, then the agent produces a plan using the LLM, acts in the world using the tools and observe the result of the action. At the end of the cycle, the agent uses the observation to feed back the LLM, generating or updating the action plan. Once the agent considers the output to be correct, it produces a final answer.</li>
<li>Agents can use tools: Tools are functions that can interact with the real world. We can write these functions (or we can use third-party). Possibilities are endless. For example, we could develop a tool that allows the model to watch a Youtube video (by splitting the video in frames and the audio track) and then ask questions about that video. Or we could define a tool that browses the Internet and take screenshots. We can also use the MCP protocol to communicate with the outside world.</li>
<li>Token ussage: If we combine multiple agents for specific tasks, then we could reduce the context window of each of them. In other words, instead of having one single model dealing with all the information in its context window, we could use multiple agents with smaller context windows.</li>
<li>Multi-agent: An agent can communicate with others agents to resolve more complex tasks.</li>
</ul>


</section>
</section>

 ]]></description>
  <category>GenAI</category>
  <category>Agentic</category>
  <category>HuggingFace</category>
  <category>SmolAgent</category>
  <guid>https://jpons.es/posts/2025-07-16-HuggingFaceAgentsCertification.html</guid>
  <pubDate>Wed, 16 Jul 2025 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Implementing serverless databases in your architecture.</title>
  <link>https://jpons.es/posts/2023-09-15-Serverless-db.html</link>
  <description><![CDATA[ 





<p>Storing and querying data is the main job for a database. Don’t let the serverless hype to force you redesign the query component of your data!</p>
<p>In this short article, I’m going to describe my journey with serverless databases, why I started using them in the first place and what are the major issues you have to take into account when working with them.</p>
<p>I started my journey with serverless databases due to a mobile project developed in flutter: a relatively new technology developed by Google. While learning it, I discovered Firebase, the serverless suite from Google that integrates seamlessly with the <a href="https://flutter.dev/">Flutter framework</a>.</p>
<p>There are many eye-catching components in the <a href="https://firebase.google.com/">Firebase</a> suite: for instance a serverless Auth service that provides integrations with all the well-known providers like Google, Apple, Twitter, etc.</p>
<p>Among others, Firebase offers a serverless database called <a href="https://firebase.google.com/docs/firestore">FireStore</a>. It’s a document database, where you can define collections inside documents. It offers a minimal interface to insert some test documents and a part where you can define the access control rules for the database and the documents in the database.</p>
<p>The querying capabilitites are very interesting, they provide operators and functions to filter data, although there is not a proper query language (like for example in MongoDB).</p>
<blockquote class="blockquote">
<p>I discovered later the main disappointment: it is not possible to run a wildcard search on the database. You can filter by intervals, but you can’t search values inside a string. Was I reading right? It seems so. I just wanted to run a query to filter all names starting with Ba*.</p>
</blockquote>
<p>There is a solution to implement that, but it requires you to update or redesign the architecture of your serverless app. I’ll describe the details later during the post, but you can find them in the documentation of firebase.</p>
<p>Why should anyone want to migrate a database to a serverless database? There are some advantages, if you ask me: - No maintenance tasks: you don’t have access to any management console. - Planetary scale from scratch: I think this is the main selling point. You can start small and with a really small quote and scale without any upfront investment neither in your architecture nor in the infrastructure. - You pay for what you use. (this could be a double-edged sword).</p>
<p>The basic plan of Firebase is free and includes a considerable amount of requests both reads and writes.</p>
<p>The integration between Firebase products and Flutter is so good that the library handles the presentation layer in your app, the caching and even the content being available when the device doesn’t have network connection.</p>
<p>Returning back to the main issue: how do you run a wildcard search in FireStore?</p>
<p>Well, you must add another component to your architecture. An indexing engine. There are several in the market, but one of them is Algolia. Also, you need to create a trigger everytime you create / delete a new document.</p>
<p>The indexing engine is a cloud service that works like a typical index, you define a few fields that are part of the index, and in this case, it’s the responsability of the programmer to update the index. Then, you can query that index, which returns your object ID, and then asks FireBase to return that object or the list of objects.</p>
<p>The trigger part must be implemented using a serverless function (and to use that capability from Firebase you need to enable a pay plan). There are some out-of-the-box functions to create this trigger as a serverless function. I’m going to define the triggers that I’m using here.</p>
<p>The overall architecture of the solution running with this indexing system looks like the following:</p>
<p>Again, we have to choose carefully the balance between the functionals, non-functionals and the need for a serverless solution. Depending on the size of your project it might be worthy to run an old-school traditional relational database, or a document-oriented database.</p>



 ]]></description>
  <category>DB</category>
  <category>Serverless</category>
  <category>Firebase</category>
  <category>FireStore</category>
  <guid>https://jpons.es/posts/2023-09-15-Serverless-db.html</guid>
  <pubDate>Sat, 15 Jul 2023 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Using AI for programming</title>
  <link>https://jpons.es/posts/2023-07-05-using-ai-for-programming.html</link>
  <description><![CDATA[ 





<section id="my-experience-of-using-ai-assistants-for-programming-the-past-month" class="level1">
<h1>My experience of using AI assistants for programming the past month</h1>
<p>Last month, I started using two services, ChatGPT and Github Copilot to help me with my coding work. They are very different, but both share the underlying model, using <a href="https://machinelearningmastery.com/what-are-large-language-models/">Large Language Models (LLMs)</a>.</p>
<ul>
<li><a href="https://openai.com/blog/chatgpt">ChatGPT</a>: Is a generic model, that’s implemented mainly as a chat bot, but it can answer code questions of various nature.</li>
<li><a href="https://github.com/features/copilot">Github Copilot</a>: is a model based on <a href="https://openai.com/blog/openai-codex">Codex</a>, a tuned version of an LLM with the focus on code.</li>
</ul>
<p>Outside this comparison is <a href="https://aws.amazon.com/es/codewhisperer">Amazon CodeWhisperer</a> but I would like to give it a try soon. According to the demo I watched, the main difference is that Code Whisperer gives you code <em>that is actually</em> in a real open source repo.</p>
<section id="configuration" class="level2">
<h2 class="anchored" data-anchor-id="configuration">Configuration</h2>
<p>For my trial I worked with Copilot installed on Visual Studio Code as a plugin, I think this is the most productive way to work with. For ChatGPT I’m using the browser and the popular GitHub project called <a href="https://github.com/Significant-Gravitas/Auto-GPT">AutoGPT</a>, that project extends the capabilities of the chat-based interface by using the API of chatGPT and ellaborating a plan based on the user description. Among the capabilities, it can write the files to disk, it can browse the Internet, and you can extend the functionality by using plugins (that’s really a very idealistic description of how it really works).</p>
</section>
</section>
<section id="experiment-writing-code-for-a-flutter-application" class="level1">
<h1>Experiment: Writing code for a Flutter Application</h1>
<p>Yeah, <a href="https://flutter.dev/">Flutter</a> is a framework written in <a href="https://dart.dev/">Dart</a> language by Google with the idea of creating one single codebase for all your mobile / desktop applications. I’m writting a couple of apps using this technology and I have to say it’s really cool and fast to develop.</p>
<p>I want to create an activity tracker, similar to the one from the main page of GitHub, you may have seen it: <img src="https://jpons.es/posts/images/github_activity.png" class="img-fluid"></p>
<section id="using-github-copilot" class="level2">
<h2 class="anchored" data-anchor-id="using-github-copilot">Using GitHub Copilot:</h2>
<p>I create an empty file and write the comments in the header of what I want to achieve. Here the only output I get from Copilot is the list of imports and after a few of them, it loops again to the first import. <strong>In this example, Copilot wasn’t very useful</strong>.</p>
</section>
<section id="using-chatgpt" class="level2">
<h2 class="anchored" data-anchor-id="using-chatgpt">Using ChatGPT</h2>
<p>This was my prompt: “can you define a widget in flutter to create an activity tracker with squares representing each day, in the style of github front page?” And this was the code:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode dart code-with-copy"><code class="sourceCode dart"><span id="cb1-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">import</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'package:flutter/material.dart'</span>;</span>
<span id="cb1-2"></span>
<span id="cb1-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> ActivityTracker <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">extends</span> StatelessWidget <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-4">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">@override</span></span>
<span id="cb1-5">  Widget build(BuildContext context) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-6">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> GridView<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>builder(</span>
<span id="cb1-7">      gridDelegate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> SliverGridDelegateWithFixedCrossAxisCount(</span>
<span id="cb1-8">        crossAxisCount<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// 7 squares per row for each day of the week</span></span>
<span id="cb1-9">      )<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-10">      itemCount<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">365</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Total number of days in a year</span></span>
<span id="cb1-11">      itemBuilder<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> (BuildContext context<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">int</span> index) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-12">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> ActivitySquare(); <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Custom widget representing a day's activity square</span></span>
<span id="cb1-13">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">},</span></span>
<span id="cb1-14">    );</span>
<span id="cb1-15">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-16"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-17"></span>
<span id="cb1-18"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> ActivitySquare <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">extends</span> StatelessWidget <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-19">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">@override</span></span>
<span id="cb1-20">  Widget build(BuildContext context) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-21">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> Container(</span>
<span id="cb1-22">      width<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-23">      height<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-24">      margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> EdgeInsets<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>all(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-25">      decoration<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> BoxDecoration(</span>
<span id="cb1-26">        color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> Colors<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>grey<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Set the color based on activity level or data</span></span>
<span id="cb1-27">        shape<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> BoxShape<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>rectangle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-28">      )<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-29">    );</span>
<span id="cb1-30">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-31"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-32"></span>
<span id="cb1-33"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Usage example</span></span>
<span id="cb1-34"><span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">void</span> main() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-35">  runApp(MaterialApp(</span>
<span id="cb1-36">    home<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> Scaffold(</span>
<span id="cb1-37">      body<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> ActivityTracker()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-38">    )<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-39">  ));</span>
<span id="cb1-40"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span></code></pre></div></div>
<p>You can actually compile this code and with a little bit of wiring up, you can run it, if you see the picture, it’s not perfect, but it fits the description. <img src="https://jpons.es/posts/flutter_activity_chatgpt.png" class="img-fluid"></p>
<p>The solution I implemented works with a different component, and does not use any of this code, the base widgets are different, but it helped me think about the solution. <img src="https://jpons.es/posts/images/flutter_activity.png" class="img-fluid"></p>
</section>
</section>
<section id="conclusions" class="level1">
<h1>Conclusions</h1>
<p>Using Copilot for not-so-popular languages like Dart, wasn’t really useful. Maybe I have to change the way I ask to the tool. It could be that the language has fewer examples to be trained on. Or it could be just that there is a lot of interaction between different parts of the Flutter framework, which makes very complex for Copilot to write code.</p>
<p>ChatGPT, on the other hand, helped me to get something executable, and like a first iteration, but the final solution was done using a more sophisticated code.</p>


</section>

 ]]></description>
  <category>Docker</category>
  <guid>https://jpons.es/posts/2023-07-05-using-ai-for-programming.html</guid>
  <pubDate>Wed, 05 Jul 2023 00:00:00 GMT</pubDate>
</item>
</channel>
</rss>
