<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>teoruiz.com</title>
    <link>https://teoruiz.com/posts/</link>
    <description>Recent content on teoruiz.com</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-gb</language>
    <lastBuildDate>Wed, 13 May 2026 00:03:00 +0000</lastBuildDate><atom:link href="https://teoruiz.com/posts/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Findegil: an open source ecommerce search engine</title>
      <link>https://teoruiz.com/posts/findegil/</link>
      <pubDate>Wed, 13 May 2026 00:03:00 +0000</pubDate>
      
      <guid>https://teoruiz.com/posts/findegil/</guid>
      
      <description>&lt;h2 id=&#34;software-unlocked&#34;&gt;Software unlocked&lt;/h2&gt;
&lt;p&gt;My two obsessions that led to the &lt;a href=&#34;https://teoruiz.com/now/2026-04-23/#2701-labs&#34;&gt;launching&lt;/a&gt; of &lt;a href=&#34;https://2701.ai&#34;&gt;2701 Labs&lt;/a&gt; are (a) how do software products change in nature when incorporating LLMs; and (b) how software development is totally unlocked with coding agents.&lt;/p&gt;
&lt;p&gt;This is a story about the latter.&lt;/p&gt;
&lt;p&gt;I have been a software engineer for 25 years, working on projects big and small, in teams of one and teams of a hundred. However, I feel I can move and create software faster than ever before.&lt;/p&gt;
&lt;p&gt;When I read &lt;a href=&#34;https://www.gemba.es/p/como-construimos-nuestro-buscador&#34;&gt;Mercadona Tech&amp;rsquo;s CTO detailed post&lt;/a&gt; on their quest to &lt;del&gt;vibecode&lt;/del&gt; build a search engine that worked for them, I decided to build a clean room, reference implementation as open source, something I would have never been able to do before. Today I am introducing &lt;a href=&#34;https://findegil.dev&#34;&gt;&lt;strong&gt;Findegil&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Full disclosure&lt;/strong&gt; I don&amp;rsquo;t work at Mercadona Tech but I have history with the project, since &lt;a href=&#34;https://vernonteam.com&#34;&gt;we&lt;/a&gt; helped them build their initial team, back in 2017. Also, Jose, their CTO, is a very good friend of mine.&lt;/p&gt;
&lt;h2 id=&#34;why-mercadona-built-their-own-search&#34;&gt;Why Mercadona built their own search&lt;/h2&gt;
&lt;p&gt;For those outside Spain: &lt;a href=&#34;https://www.mercadona.es&#34;&gt;Mercadona&lt;/a&gt; is the country&amp;rsquo;s largest supermarket chain, like by &lt;a href=&#34;https://info.mercadona.es/en/current-affairs/mercadona-achieves-turnover-of-e41858-million-up-8-and-net-profit-of-e1729-million/news&#34;&gt;&lt;strong&gt;a lot&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In their post, Jose detailed why, after years using a commercial, SaaS search engine service, they decided to build their own.&lt;/p&gt;
&lt;p&gt;Their main point is that they were happy to put up with a generic search engine, which is not necessarily the best fit for groceries (small title, description, etc.), even while seeing a significant amount (~4%) of queries return no results, and paying a steep cost for their search volume. They were happy putting up with it, until they weren&amp;rsquo;t.&lt;/p&gt;
&lt;p&gt;They got their confidence to make a switch while making a vibe coded experiment during a weekend, building out from there and reaching a &lt;strong&gt;bespoke architecture that worked for them&lt;/strong&gt;, at a fraction of the cost, with significantly more flexibility.&lt;/p&gt;
&lt;p&gt;In a world where &lt;strong&gt;advanced coding agents&lt;/strong&gt; are readily available, they could use their intuition and experience to build something they couldn&amp;rsquo;t, or wouldn&amp;rsquo;t, do before.&lt;/p&gt;
&lt;p&gt;The beautiful thing is that they publicly documented their algorithms, tech stack and, critically, their governance rules. With that blueprint, I decided to build &lt;a href=&#34;https://findegil.dev&#34;&gt;Findegil&lt;/a&gt;, a clean room, reference implementation of their search engine.&lt;/p&gt;
&lt;h2 id=&#34;findegil-at-10000-feet&#34;&gt;Findegil at 10,000 feet&lt;/h2&gt;
&lt;p&gt;Findegil is a &lt;strong&gt;small, fast, transparent&lt;/strong&gt; e-commerce search engine. It is an open-source package built on a simple premise: the vast majority of e-commerce catalogs fit comfortably in the &lt;strong&gt;RAM of a single CPU machine&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;It executes a four-stage process (as per the Mercadona playbook):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Normalize&lt;/strong&gt; the query.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Run two retrievers&lt;/strong&gt; in parallel (BM25 and &lt;a href=&#34;https://huggingface.co/intfloat/multilingual-e5-small&#34;&gt;&lt;code&gt;e5-small&lt;/code&gt;&lt;/a&gt; embeddings).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fuse the results&lt;/strong&gt; with Reciprocal Rank Fusion (RRF) and filter by a tenant bitset (if applicable).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rerank&lt;/strong&gt; the final candidates with &lt;a href=&#34;https://catboost.ai&#34;&gt;CatBoost&lt;/a&gt; YetiRank, a Learning-To-Rank algorithm.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The headline feature is &lt;strong&gt;extreme efficiency without sacrificing relevance&lt;/strong&gt;. It delivers sub-15ms p99 latency on a single CPU core while keeping top-tier ranking quality (0.922 MRR@10 on the WANDS dataset). There are no GPUs, no external clusters, and no vector databases. To be clear about what this is not: it is not a general-purpose document search, it&amp;rsquo;s tailored for a &lt;strong&gt;specific set of use cases&lt;/strong&gt; around e-commerce and online groceries stores.&lt;/p&gt;
&lt;h2 id=&#34;deep-dive-and-drifts-from-the-original-playbook&#34;&gt;Deep dive and drifts from the original playbook&lt;/h2&gt;
&lt;p&gt;The implementation closely follows the original playbook, adapted and generalised for an open source project.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Normalization:&lt;/strong&gt; I enforce strict NFKC unicode normalization, casefolding, and whitespace collapse. This runs on the exact same code path at &lt;strong&gt;index time and query time&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lexical and Semantic Layers:&lt;/strong&gt; For the lexical layer, I use &lt;a href=&#34;https://github.com/quickwit-oss/tantivy-py&#34;&gt;&lt;code&gt;tantivy-py&lt;/code&gt;&lt;/a&gt; embedded in-process. There is a slight forced drift here: &lt;code&gt;tantivy-py&lt;/code&gt; does not expose BM25 parameters and they are fixed at &lt;code&gt;(k1=1.2, b=0.75)&lt;/code&gt;, which is not necessarily great for short documents, but we can probably fix it in the future. For semantic search, I use the wonderful &lt;a href=&#34;https://huggingface.co/intfloat/multilingual-e5-small&#34;&gt;&lt;code&gt;e5-small&lt;/code&gt;&lt;/a&gt; exported to &lt;a href=&#34;https://onnxruntime.ai&#34;&gt;ONNX INT8&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Where Findegil diverges:&lt;/strong&gt; The biggest difference is data. Mercadona had years of private click logs, which I did not have when building this. Findegil ships with a synthetic click pipeline derived from Amazon ESCI labels, running an Inverse Propensity Weighting (IPW) recovery test to assert that a model trained on these synthetic clicks matches a model trained on perfect labels.&lt;/p&gt;
&lt;p&gt;Findegil&amp;rsquo;s golden set evaluation uses the public &lt;a href=&#34;https://github.com/wayfair/WANDS&#34;&gt;WANDS dataset&lt;/a&gt;, which is basically the benchmark for this type of project.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s important to note that the YetiRank LTR layer is wired but disabled by default, because in reality what users will want is to ingest their own data.&lt;/p&gt;
&lt;h2 id=&#34;vibecoding-or-agentic-engineering&#34;&gt;Vibecoding or agentic engineering&lt;/h2&gt;
&lt;p&gt;I would say 99% of the code for Findegil has been written by either Claude Code (Opus 4.7) or Codex (GPT 5.5). But I would not say this was a vibecoded software, I prefer to use &lt;a href=&#34;https://simonw.substack.com/p/agentic-engineering-patterns&#34;&gt;Simon&amp;rsquo;s take on agentic engineering&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I used Mercadona&amp;rsquo;s original playbook as a starting point and built the project in phases, with their original &lt;code&gt;CLAUDE.md&lt;/code&gt; as a kind of &lt;em&gt;constitution&lt;/em&gt; on latency budgets, external dependencies and complexity. And if the agent wants to change an architectural rule, it must write an Architecture Decision Record (ADR) first. You can see the &lt;a href=&#34;https://github.com/2701/findegil&#34;&gt;full repo&lt;/a&gt; history, too!&lt;/p&gt;
&lt;p&gt;Some tips and lessons from the last couple of weeks building Findegil:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Writing architectural decisions down up front&lt;/strong&gt; is definitely worth it. These are the foundations of the project. Steering them with experience and intuition is not as easy as people online try to convey.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tight feedback loops via CI gates&lt;/strong&gt; (latency tests, golden set regressions and clear metrics) are like super powers for the agent, because it can iterate by itself until done with something.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;I followed a phased roadmap&lt;/strong&gt; (Phase 0 through 4) with evaluation files at the end of each phase. I wonder if this was the fastest way to reach my end goal and the next time I will probably build an end to end PoC and then grow from there.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;I can&amp;rsquo;t really decide if I like Codex or Claude Code more&lt;/strong&gt;, yet. I use them in a pretty barebones fashion: no skills, no plugins, just the harness and the model. We&amp;rsquo;ll see if I stick to one of them or I move towards using &lt;a href=&#34;https://pi.dev&#34;&gt;Pi&lt;/a&gt; and switching between models.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;whats-next&#34;&gt;What&amp;rsquo;s next&lt;/h2&gt;
&lt;p&gt;I would love to see Findegil being used and improved for retail and other use cases out there. At the moment it&amp;rsquo;s kind of a research preview, but there is a lot of potential for these type of small, bespoke-ish projects and I am dying to see where we go from here.&lt;/p&gt;
&lt;p&gt;If you have a real catalog, I would love to see you clone the repository and report back, especially with real click-log data we can use to train the LTR model!&lt;/p&gt;
&lt;p&gt;What a fun few weeks!&lt;/p&gt;
</description>
      
    </item>
    
  </channel>
</rss>
