<?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 Miguel Fiandor Gutiérrez on Medium]]></title>
        <description><![CDATA[Stories by Miguel Fiandor Gutiérrez on Medium]]></description>
        <link>https://medium.com/@miguel.fiandor.gutierrez?source=rss-5c86f695f188------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lj2-v_cuJscKsGd_iGlztg.png</url>
            <title>Stories by Miguel Fiandor Gutiérrez on Medium</title>
            <link>https://medium.com/@miguel.fiandor.gutierrez?source=rss-5c86f695f188------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 15:51:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@miguel.fiandor.gutierrez/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[Intro to my Agentic Text-to-SQL with CrewAI and MLFlow setup]]></title>
            <link>https://medium.com/@miguel.fiandor.gutierrez/intro-to-my-agentic-text-to-sql-with-crewai-and-mlflow-setup-ca2db6cacfeb?source=rss-5c86f695f188------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca2db6cacfeb</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[crew-ai]]></category>
            <category><![CDATA[mlflow]]></category>
            <category><![CDATA[llm-applications]]></category>
            <dc:creator><![CDATA[Miguel Fiandor Gutiérrez]]></dc:creator>
            <pubDate>Fri, 24 Oct 2025 12:01:33 GMT</pubDate>
            <atom:updated>2025-10-24T12:01:33.009Z</atom:updated>
            <content:encoded><![CDATA[<p>I set out to build a Text-to-SQL system as a learning project and portfolio piece. But once getting SQL out by LLMs, the challenge was something different, it was systematically evaluating which LLM and agent framework would work best.</p><p>I started with CrewAI due to its clean setup of the crew, agents, and tools. Picked a 3-agent architecture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B-grXfkuuENooXsC75YyRw.png" /></figure><p>What would be a good database to test against?. I thought that a good business case for many entrepeneurs and small business owners would be, even for some coworking mates, to query their ecommerce database with natural language, so the <a href="https://www.kaggle.com/datasets/terencicp/e-commerce-dataset-by-olist-as-an-sqlite-database">Kaggle Ecommerce sqlite</a> fit seemed a good fit.</p><p>Then plugged Streamlit to have a simple UI, but soon I wanted to run multiple queries, models, llm providers (…). So, I created a click CLI on top of CrewAI to run batches and multiple configurations of the crew. In the future also, I would like to compare how providing different prompts, tools, or agent strategies impact the performance of the whole crew.</p><p>CrewAI let me build the agent crew quickly and easy to understand and adapt. But here’s the next challenge: How do I compare GPT-4 vs Claude vs Gemini for MY specific Text-to-SQL use case?. I needed something to track results with all running config details. So, I set up MLFlow to wrapping my crew-sql runs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*slrOoEkUT60VuL4S5jym6g.png" /></figure><p>Six metrics I track per query run:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*jkzJZDlrRsagFbF-qyGEMA.png" /></figure><p>At the beginning I found it quite difficult to know what specific LLM/Agentic setup was better, because the combination of scenarios is huge. You have different LLM providers, models, prompts, tools, agent configurations, plus agent architectures and frameworks to try out. So, having a systematic way to run experiments and track results is key, and MLFlow, although I recently started using it, seems a great fit for this. See some screenshots of the MLFlow UI with my experiments.</p><h3>List of evaluations ran</h3><p>I ran a few examples against gpt4o, claude sonnet, and local ollama models gemma3 and llama3.2. Notice that <a href="https://mlflow.org/docs/3.1.3/genai/mlflow-3/genai-agent/">MlFlow already has already a custom GenAI experiment</a> type on top.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h8RF3HfzSPv-H2K9Q3l54A.png" /></figure><h3>GPT-4o Overview</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oS6SnNvhk7lVW45KnSYAHg.png" /></figure><h3>GPT-4o Metrics</h3><p>It successfully ran the generated SQL but it was not exactly the expected one, so accuracy<em>exact is 0, neither return the same results, so accuracy_</em>semantic is also 0.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d2Nxoo4eMvvNa58ctk4P_A.png" /></figure><h3>GPT-4o Results</h3><p>I added the following custom MLFlow artifact to my code with detailed per-query results, showing the generated SQL, expected SQL, execution results, errors, etc. Very useful to debug and understand where things went wrong.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ay3RhlqdnjL1Ew1mLM7VVQ.png" /></figure><h3>Conclusion</h3><p>Now I can run a lot of experiments, locally free, but also against main LLM providers, and have a systematic way to compare them. Tweaking CrewAI agent prompts, tools, strategies, and see how that impacts the final results. I can even change the target database and see how the same crew and LLM works against different schemas and data.</p><p>That’s it for a first intro. If you’re building LLM-powered systems or evaluating agentic solutions, I’d love to share notes.</p><p>Connect with me: <a href="https://github.com/miguelfg">Github</a> | <a href="https://www.linkedin.com/in/mfiandor/">Linkedin</a> | <a href="https://x.com/mfiandor">Twitter</a></p><p>Tags: #AI #CrewAI #MLFlow #AgenticAI</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca2db6cacfeb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A new side project — Toyota Used Car Dashboard]]></title>
            <link>https://medium.com/@miguel.fiandor.gutierrez/a-new-side-project-toyota-used-car-dashboard-0ee13a2790a6?source=rss-5c86f695f188------2</link>
            <guid isPermaLink="false">https://medium.com/p/0ee13a2790a6</guid>
            <category><![CDATA[etl]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[streamlit]]></category>
            <category><![CDATA[toyota]]></category>
            <category><![CDATA[dashboard]]></category>
            <dc:creator><![CDATA[Miguel Fiandor Gutiérrez]]></dc:creator>
            <pubDate>Tue, 27 May 2025 13:04:03 GMT</pubDate>
            <atom:updated>2025-05-27T13:14:04.373Z</atom:updated>
            <content:encoded><![CDATA[<h3>A new side project — Toyota Used Car Dashboard</h3><h3>Unlocking the Toyota Used Car Market in Spain: with Python Streamlit Dashboard on Google Cloud</h3><h3>Introduction</h3><p>I built <a href="https://toyota-ocasion-stats-891726790351.europe-southwest1.run.app/">this dashboard</a> to provide some hidden insights about the used car market in Spain. Toyota is probably the most sold brand of the country, and this dashboard allows users to explore Toyota’s used car listings through an interactive web application. The dashboard is built using Python and Streamlit, providing a user-friendly interface for data analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V_JdUugELhshZbPxFJWmzA.png" /></figure><h3>Exploring the Dashboard</h3><p>The dashboard is divided into the following sections: geo, counts, price vs mileage, and price ranges. Each section provides python seaborn visualizations and filters to drill down into the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BF27AiogNN3krPL5ItZIHQ.png" /></figure><p>It currently contains close to 5000 used Toyota cars listed in Spain, with data sourced from the <a href="https://www.toyota.es/coches-segunda-mano">Toyota España website</a>. Some of the car’s attributes are: model, year, mileage, transmission, fuel, eco badge, price, and dealer location.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TESu1ecZH8Etnj2gOJsmjA.png" /></figure><p>It maps the dealers’ locations, allowing users to see where the cars are being sold and how many. The dashboard also provides various statistics and analytics, such as the number of cars registered per year, the most common car packages, and the distribution of prices by model and package.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TV24NlrxzPwz2JKmZcu8yg.png" /></figure><h3>Technology Stack</h3><p>The project is divided into two modules:</p><ol><li>The ETL (Extract, Transform, Load) module, which scrapes the Toyota España website to gather used car data, clean and transform it, to store it in a local SQLite database.</li><li>The dashboard Streamlit app, which provides Python seaborn data visualizations and extensive filtering capabilities.</li></ol><h3>The ETL Module</h3><p>Here I used the Python requests library to scrape the Toyota España website, extracting data on used cars. After it is converted into a Pandas DataFrame, it is cleaned and transformed to ensure data quality. The cleaned data is then stored in a local SQLite database for easy access by the dashboard.</p><h3>The Dashboard Module</h3><p>The dashboard is built using Streamlit, a powerful framework for creating interactive web applications in Python. It provides a user-friendly interface for exploring the used car data, with various filters and visualizations to help users gain insights into the market.</p><p>It has enabled a simple Authentication using the streamlit_authenticator extension.</p><pre>User/pass: demo/cars</pre><p>It is deployed on Google Cloud Run with a repository type. This eases the deployment process by automatically building the container image from the source code in the repository with any updates on the main branch.</p><p>The ETL is scheduled to run on Tuesdays and Fridays with Github Actions, thanks to the workflow file that runs the full ETL process and updates the local SQLite database with the latest data, and finally pushes the new db to Github.</p><h3>Conclusion: Empowering Your Used Toyota Search</h3><p>This dashboard empowers users with data-driven insights understanding the market trends in Spain. It provides a comprehensive view of the used car listings, allowing future car buyers to make a better deal based on various factors such as price, mileage, car status, and dealer location.</p><p>You can find me on:</p><ul><li><a href="https://www.linkedin.com/in/mfiandor/">LinkedIn</a></li><li><a href="https://github.com/miguelfg">GitHub</a></li><li><a href="https://twitter.com/mfiandor">X / Twitter</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0ee13a2790a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Time saving tips for web scraping]]></title>
            <link>https://medium.com/@miguel.fiandor.gutierrez/https-medium-com-miguel-fiandor-gutierrez-time-saving-tips-for-data-web-scraping-83372016737b?source=rss-5c86f695f188------2</link>
            <guid isPermaLink="false">https://medium.com/p/83372016737b</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[etl]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[web-scraping]]></category>
            <dc:creator><![CDATA[Miguel Fiandor Gutiérrez]]></dc:creator>
            <pubDate>Wed, 05 Dec 2018 18:26:00 GMT</pubDate>
            <atom:updated>2018-12-05T18:26:00.943Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_pRv4eFSLwh3J9cP" /><figcaption>Photo by <a href="https://unsplash.com/@the_alp_photography?utm_source=medium&amp;utm_medium=referral">Andrik Langfield</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I would like to break the ice by sharing a collection of tips gathered after scraping quite a few websites and files for many years already. We can find already many posts and all kind of information (tutorials, videos, etc) about webscraping, here I want to share additional and not easy-to-find tips about this process.</p><p>While I am a daily Python developer, this post is language and libraries agnostic. I’ll try to keep it short:</p><ol><li><strong>Best scraper is the non-scraper.</strong> What’s the most efficient transportation to go to work? =&gt; remote work. The same thing happens when you try to harvest data. Some “modern” websites actually send to your browser the HTML code and data already separated in 2 different responses. Hence, you only have to notice about this in the Google Developer Window &gt; Network tab, and get that raw well-structured data response and play with it. Our <a href="https://www.icij.org/investigations/panama-papers/the-power-players/">Panama Papers ‘Power Player’</a> app in the <a href="https://www.icij.org/">ICIJ.org</a> does that.</li><li><strong>Distinguish between crawling/requesting and scraping/parsing</strong>. To me web scraping is divided into 2 different steps, visiting the target web pages (or even local files), and transforming those into your desired structured format. So don’t run the whole process mixed up in the same portion of code, separate it into at least 2 different functions, classes or files. You should have 2 different commands for each step. There are many reasons for this, and this actually generates the following advice.</li><li><strong>Always, always, almost always save locally the raw responses from your requests.</strong> Web scraping is a try&amp;error task, iterating on it until insanity levels, therefore is not efficient nor smart to be requesting to a target server more than what you should. There are exceptions for this, when your process, tool, script, business requirementss demand real-time processing, and then the source and data you are gathering might change veeeery often. So don’t follow this advice for stock prices, but consider it for almost all kind scenarios.</li><li><strong>List and Detail pages</strong>. Many many websites are often made by two kind of pages, a list page (general view) with a few attributes of the data you are looking for. You can click on those items and be forwarded to a detailed page with all the info you need. Hence, think and code that way, usually a dataset requires <strong>at least 2 crawlers and 2 parsers. You will download 2 datasets a general one and a detailed one. </strong>And it’s likely that your second crawler will need as input your parsed out data from your first parser. Welcome to the ETL world!</li><li><strong>Build your own custom CLI command</strong>. Take the little time that requires to add parameters to your script, so you make it more flexible and powerful. You will be executing it many times, you will need different running scenarios. Agnostic allows recommendations, specially the not so popular ones, so here my 5 cents for python devs, <a href="https://click.palletsprojects.com/en/7.x/">Click</a>, a lean library to build your own command.</li><li><strong>Add always a ‘limit’ + ‘skip’ parameters</strong> to your script. So you can run your scraper with ‘-li 100’, and just deal with the first 100 pages or files you find. Where 100 could conveniently be 0 (all), 10, or 2000 too, at the different stages of your processing.</li><li><strong>Sort your requests before you run them</strong>, why this?. Imagine you have to scrape a million pages, with ids that go from 1 to 1M. If you don’t control the order that you are requesting and at some point your execution breaks (the server blocked you, or whatever the reason is), when you want to restart the process again it’s very likely that you will have to restart from the very beginning and redo all the work. <em>If you have your requests sorted, some of them already saved locally, and a skip parameter, you then have the ingridients and the homework done to not repeat yourself</em>.</li><li><strong>Parse html files in two steps too. </strong>I usually scrape every item I need for a page, and save that into an intermediary structured format of the file, as json in my case. In the second phase, I deal with the real transformations, for instance cleaning texts, stripping undesired chars, formatting dates, and so on. When I re-run the parser it has to look first for the intermediary file, if doesn’t exist, creates it. If it does read you just read a friendly format.</li><li><strong>Crawl asynchronously. </strong>Be aware of non run too many queries, and always try to not get banned. To me it does worth to wait a few minutes more for your spider to eat the meal, than to wait you don’t know how much until you manage to query again the website. Obviously you can find ways to pretend that you are not the same one as before, but this also take time too unless you are an expert on these practices.</li><li><strong>Transform asynchronously too. </strong>At least you would probably have 4 cores, so try to spare the load. While this is not usually a computation bound problem, you will benefit if you split the parsing among n processes or threads.</li><li><strong>Other handy parameters to play with are: </strong>sleeping time between requests, requests timeouts, size of request batches, overriding intermediary files. You will need this last one if you start saving intermediary status of you process, because you might end up adding new functionality, getting more attributes, performing new transformations when you already have generated some of those intermediary files. So, a handy parameter would be to ignore those files even if they exists, hence you would generate them again with the your last changes.</li><li><strong>Add a date timestamp to your generated structured file</strong>, if it is not going to end in a database (or even if you are doing it so). Why?, imagine you are shaping your parser, it takes quite a few minutes to complete, you do some tweaks and you re-run it but you did any mistake, it breaks, whatever but it writes with the same file as before. So you just have overwritten a non-perfect previous result which could have been handy for you to keep it.</li><li><strong>Consider to cook a huge source HTML file.</strong> This tip I learnt it from a colleague at <a href="https://www.elconfidencial.com/">El Confidencial</a>, a Spanish newsroom, he helped us scraping our files in the Paradise Papers project for the Aruba registry. He did a very smart thing, since you might run the parser no less than 10 or 20 times until you have a sharp tool, why don’t you take a complete loop and extract + append all HTML body sections into one huge file. So, next time you run your parser, if that huge file exists, instead of opening thousands of small files you just read a big one. This is especially interesting for scenarios with the range of 5K files or more, and the desired content is not too big.</li><li>Before coding the crawler part, when you found the request that you want in Firebug or the equivalent Developer Tool at Chrome, copy this request as ‘curl’ or other command line and try it out in your console. So you request the target URL from curl command for instance, and see if you get the same response as in the browser. Hopefully yes, sometimes cool browsers do fancy stuff behind the scenes, and you might start writing some code on a expected HTML response that is not the one you are going to get.</li></ol><p>And that’s it, while I also have suggestions on Python and all its ecosystem to do web scraping, this part is widely shared out there. I wanted to focus on the general practice of the special ETL case of a web scraper, and the lessons that I learned over many years, promoting the last three at <a href="http://icij.org/">ICIJ.org</a> since dealing with the Panama+Paradise Papers and other stuff had a big influence on my work.</p><p>I’d be very happy to see any ideas, comments and suggestions from you about these tips.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83372016737b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>