<?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 Albin Amat on Medium]]></title>
        <description><![CDATA[Stories by Albin Amat on Medium]]></description>
        <link>https://medium.com/@albin.amat?source=rss-ce96a1c46225------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qd_YTwW4K5smFZ3ivPZMHg.jpeg</url>
            <title>Stories by Albin Amat on Medium</title>
            <link>https://medium.com/@albin.amat?source=rss-ce96a1c46225------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 05:59:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@albin.amat/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[Im so tired of context windows and tokens]]></title>
            <link>https://medium.com/@albin.amat/im-so-tired-of-context-windows-and-tokens-92d777d5c49c?source=rss-ce96a1c46225------2</link>
            <guid isPermaLink="false">https://medium.com/p/92d777d5c49c</guid>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[token]]></category>
            <dc:creator><![CDATA[Albin Amat]]></dc:creator>
            <pubDate>Wed, 15 Apr 2026 09:25:42 GMT</pubDate>
            <atom:updated>2026-04-15T09:25:42.276Z</atom:updated>
            <content:encoded><![CDATA[<h3>My problem with the vast toolset Claude offers is most of the time theres is this ton of mds and configuration and skills and super powers loaded upfront without really great usage in all sessions. Problem with knowledge base is that u want Claude to remember what id did 10 days ago in a prev session it would have to search in a journal or load a more mds to get what it needs within the pile of garbage.</h3><h3>That’s why I’m finding my approach here</h3><h3><a href="https://www.linkedin.com/safety/go/?url=https%3A%2F%2Flnkd%2Ein%2FezR6-iCK&amp;urlhash=iQJm&amp;mt=JD6CRCK-VIk6DTIrvwDexfrGkDqmXczb9RJSMg60iCAwHqJt1uMjz6M0Q1mvWCmLoqtqhhBV4LTS8yDXCENeAazMhjNqafOaX0y-S78RCZvzvRvk5DfDWZC0Ng&amp;isSdui=true">https://lnkd.in/ezR6-iCK</a></h3><h3>More and more useful for my case everyday. shared memories across several projects and servers. a single Redis DB for rapid access and key values format of records. and instruct the agent can access it at any point in time and store meaningful memories. what it makes it very usable is that keys are embedded as vectors using nomic-embed-text model so the agent doesn’t need to know the exact key just a ballpark and the mcp will return the closest memory ordered by recency.</h3><h3>Less context, just what it needs, in the momet that it needs it. tho searching and token consumption in calls overhead. but yeah. that’s my 20 cents</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92d777d5c49c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I wrote conversational AI CPAP agent]]></title>
            <link>https://medium.com/@albin.amat/i-wrote-conversational-ai-cpap-agent-df4eefe22ef1?source=rss-ce96a1c46225------2</link>
            <guid isPermaLink="false">https://medium.com/p/df4eefe22ef1</guid>
            <category><![CDATA[cpap]]></category>
            <category><![CDATA[conversational-ai]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Albin Amat]]></dc:creator>
            <pubDate>Wed, 18 Mar 2026 21:33:00 GMT</pubDate>
            <atom:updated>2026-03-18T21:33:00.377Z</atom:updated>
            <content:encoded><![CDATA[<p>Developing conversational AI agents inside services is one of the most interesting and complex topics right now, because of the sheer number of approaches you can take to implement them.</p><p>I asked Claude Code to check my sleep therapy PostgreSQL database and summarize the trend of my Central Apneas over the past 3 months. It connected to the server, indexed the schema structure, searched the metadata of the tables closest to the therapy sessions I asked about, and wrote the appropriate SQL to interpret and make an assessment.</p><p>And while its approach was thorough, it also could have been leaner and more direct. It generated raw SQL against my production database, which meant it had to discover column names, guess at join conditions, and hope the query was correct. One hallucinated column name and the whole thing would fall apart silently and it had to repeat the step again.</p><p>So when I decided that a conversational AI agent was in order for my CPAP service, I went with Agentic Tool-Use for the execution layer.</p><p>Gave me several pros that i liked:</p><p>It puts me in control. Each tool has a clear contract: typed parameters with JSON Schema validation. The LLM decides which tool to call and what arguments to pass, but it never writes SQL. The parameterized queries are configurable in the application. When a column gets renamed, I fix the tool definition and the service catches it.</p><p>It abstracts the database from the LLM. The model never sees table names, column names, or schema details. It sees tool descriptions like “Get recent therapy sessions with metrics” and parameters like `days` and `limit`. Can’t hallucinated field names. No disparated joins or SELECTs from a table that doesn’t exist.</p><p>Multi-step reasoning is native. The tool-use loop lets the LLM call multiple tools iteratively. “How does last night compare to my weekly average?” becomes two tool calls one for last night’s data, one for the weekly comparison, and the LLM synthesizes both results.</p><p>Seven tools cover my entire domain. Sessions, daily summaries, trend data, period comparisons, vitals, statistics, and detailed event breakdowns. Each one maps to a hardcoded parameterized SQL query. The LLM picks the right tool for the question, and the application handles the rest.</p><p>Conversation memory makes it compound. Past conversations are embedded with pgvector (I went with local nomic-embed-text, 768-dim) and retrieved via cosine similarity on each new query. Ask about your AHI today, and next week when you ask a similar question, the agent already has context from the prior conversation injected into its system prompt. Threads carry full message history. The agent doesn’t just answer questions but it builds an understanding of the therapy over time.</p><p>As a result I got conversational CPAP therapy assistant that runs on a Raspberry Pi, queries PostgreSQL with zero SQL injection surface, reasons across multiple tool calls, and remembers what I asked last week.</p><p>How would you go about it?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df4eefe22ef1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I use AI summarized context for all my apps now]]></title>
            <link>https://medium.com/@albin.amat/i-use-ai-summarized-context-for-all-my-apps-now-b2d3c289cf5e?source=rss-ce96a1c46225------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2d3c289cf5e</guid>
            <dc:creator><![CDATA[Albin Amat]]></dc:creator>
            <pubDate>Sat, 14 Mar 2026 12:47:31 GMT</pubDate>
            <atom:updated>2026-03-14T12:47:31.582Z</atom:updated>
            <content:encoded><![CDATA[<p>I ship AI contexts with my services now.</p><p>As a general rule of thumbs if it gathers frequent data, it can be summarized and really nice insights an be extracted.</p><p>This is inherently true whether is cpap data extraction from a medical device or energy collection from UPS nodes, a weather station streaming to the local server or your network router upstream and downstream connection health.</p><p>I get every morning, compacted, already analyzed and well distributed local info that helps me to evaluate the performance of my home.</p><p>And in an event driven system this is also used to trigger automations based on semantic conditions derived from real data. A higher level of just looking at the raw data.</p><p>AI just rocks</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*iB34vYmyDCBGK7Hvljyj5Q@2x.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2d3c289cf5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I just gutted my Home Assistant and moved all my devices to mqtt and automations to N8N]]></title>
            <link>https://medium.com/@albin.amat/i-just-gutted-my-home-assistant-and-moved-all-my-devices-to-mqtt-and-automations-to-n8n-657d0a992b68?source=rss-ce96a1c46225------2</link>
            <guid isPermaLink="false">https://medium.com/p/657d0a992b68</guid>
            <category><![CDATA[home-assistant]]></category>
            <category><![CDATA[home-automation]]></category>
            <category><![CDATA[n8n]]></category>
            <dc:creator><![CDATA[Albin Amat]]></dc:creator>
            <pubDate>Mon, 09 Mar 2026 03:48:24 GMT</pubDate>
            <atom:updated>2026-03-09T03:48:24.057Z</atom:updated>
            <content:encoded><![CDATA[<p>Spent the Sunday gutting my KVM instance of Home Assistant. Moved initially my Amcrest cameras into a tiny c++ service that listens to events and outputs mqtt. Then moved tuya devices into tinytuya2mqtt bridge, tplinks into kasa2mqtt, ups nut into tiny nut2mqtt services. I had already moved previously all zwave and zigbees into z wave js ui and zigbee2mqtt outside of Home Home assistant and even moved the SQLite db into Postgres outside. Then when everything was mqtt based started migrating all my automations to n8n.</p><p>I’m still keeping HA but I’m killing the kvm in favor of a HA Docker container to use it for my dashboards and notifications and because I already have setup a rathole tunnel for exterior access.</p><p>I still have to migrate my esphome devices to mqtt but I think is just a one liner into the yaml.</p><p>But yes got a little tired of the constant disconnecting when I updated iOS 26.4 beta. After I was in the migration heard just changing the companion app to the mDNS host name would solve the issue. But by that time it was too late. I’m deep already into this architecture</p><p>Curious about other similar experiences</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=657d0a992b68" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I built a persistent memory system for Claude Code]]></title>
            <link>https://medium.com/@albin.amat/i-built-a-persistent-memory-system-for-claude-code-a1f2f43c2d55?source=rss-ce96a1c46225------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1f2f43c2d55</guid>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[i-dont-know-what-im-doing]]></category>
            <dc:creator><![CDATA[Albin Amat]]></dc:creator>
            <pubDate>Sat, 07 Mar 2026 17:40:51 GMT</pubDate>
            <atom:updated>2026-03-07T17:40:51.402Z</atom:updated>
            <content:encoded><![CDATA[<p>I in the process building and perfecting a custom small system that gives Claude persistent memory across sessions that Claude code can use organically when needed and avoid loading a big context upfront</p><p>I use Claude Code heavily for development, debugging and infrastructure work across multiple servers and repositories.</p><p>The idea is simple:</p><p>Claude sessions automatically store important observations (decisions, fixes, discoveries). Future sessions can retrieve relevant context on demand.</p><p>Repo:</p><p><a href="https://github.com/hms-homelab/hms-claude-mem">https://github.com/hms-homelab/hms-claude-mem</a></p><p>I use it for things like:</p><ul><li>debugging C++ services</li><li>infrastructure/network troubleshooting</li><li>remembering design decisions</li><li>tracking bug investigation paths</li><li>working across multiple servers/directories</li></ul><p>It’s been surprisingly effective because Claude stops repeating the same exploration paths and remembers V certain solutions were chosen.</p><p>Things I’m thinking about next:</p><ul><li>better memory ranking</li><li>cross-repo context linking</li><li>failure pattern detection</li><li>architecture decision tracking</li></ul><p>Key quality is everything — keys are sentence-like descriptions, not database IDs.</p><p>The key gets embedded as a vector, so better keys = better</p><p>recall.</p><p>Embeddings use “{category): {key}” as input, so semantic search naturally weights by domain. Searching “deploy to Pi” finds a memory keyed as “hms-cpap deploy process to raspberry pi” via cosine similarity no exact word matching needed.</p><p>Recency decay (1%/day) keeps old memories from drowning out fresh ones. Pin critical facts that never fade.</p><p>Disclosure: as in all my recent apps I used Claude Code heavily for coding this MCP.</p><p>Text stack used C++, Redis 8+ Ollama with nomic-embed-text model for embeddings</p><p>Curious what other people think about this</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1f2f43c2d55" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I wanted my CPAP data to just show up alongside the rest of my home sensors the same way my…]]></title>
            <link>https://medium.com/@albin.amat/i-wanted-my-cpap-data-to-just-show-up-alongside-the-rest-of-my-home-sensors-the-same-way-my-db6fc1979ac9?source=rss-ce96a1c46225------2</link>
            <guid isPermaLink="false">https://medium.com/p/db6fc1979ac9</guid>
            <category><![CDATA[cplusplus]]></category>
            <category><![CDATA[home-assistant]]></category>
            <category><![CDATA[home-automation]]></category>
            <category><![CDATA[cpap-machine]]></category>
            <dc:creator><![CDATA[Albin Amat]]></dc:creator>
            <pubDate>Fri, 06 Mar 2026 10:56:49 GMT</pubDate>
            <atom:updated>2026-03-06T10:56:49.351Z</atom:updated>
            <content:encoded><![CDATA[<h3>I wanted my CPAP data to just show up alongside the rest of my home sensors the same way my thermostat or my weather station does</h3><p>No intervention, no remembering to check, no pulling cards. And I that way I could setup automations based on when the system detected the sleep session started or ended and the data associated to it.</p><p>You set it up once and never touch it again. Every 2 minutes (configurable) while you’re using the machine:</p><ol><li>It connects to the SD card over WiFi (via an ezShare adapter, the cpap doesn’t even know it’s there)</li><li>Detects if the machine is actively writing a file before downloading (so it doesn’t grab a half-written checkpoint)</li><li>Groups the checkpoint files into sessions using 2-hour gap detection</li><li>Parses everything using the same algorithms OSCAR uses, breath detection, flow analysis, tidal volume, minute ventilation, flow limitation scoring</li><li>Saves to PostgreSQL and publishes to MQTT with Home Assistant auto-discovery</li></ol><p>As a result You go to sleep. You wake up. Your dashboard already has the full session: AHI breakdown, leak percentiles, respiratory metrics, SpO2 trends, usage hours. 46 sensors, all populated automatically. No manual efforts.</p><p>And something i love is the structure of the code allows for querying te data further for the pressure adjustment, for behavior at specific times of the night or even tied that to other home events.</p><p>When the machine stops writing (session ends), it also grabs the STR.edf file, ResMed’s own daily summary with the official AHI, Cheyne-Stokes percentage, mask on/off timestamps, and cumulative lifetime hours. Stuff you can’t get from the breathing files alone.</p><p>After the first post, several people asked about running this without buying the WiFi SD card hardware. Maybe you already have your data somewhere, just copy the card to a NAS, or mount it via SMB, or just dump it to a folder on your PC periodically.</p><p>So now there are three ways to run it:</p><p>1.ezShare + Pi fully automatic zero intervention</p><p>The original setup. Pi Zero 2 W with a USB WiFi dongle one interface stays on your home network, the other connects to the ezShare card inside the machine. Data flows continuously while you sleep. You never touch the SD card.</p><ol><li>Local directory semi automatic no special hardware</li></ol><p>Point it at a folder containing your DATALOG directory. Could be an SMB mount, a USB card reader that stays plugged in, or just a folder you occasionally copy files to. It polls for changes by file size and picks up new data automatically.</p><p>Two environment variables in the system config would changee to support this:</p><pre>CPAP_SOURCE=local</pre><pre>CPAP_LOCAL_DIR=/path/to/your/DATALOG</pre><ol><li>One shot reparse good for bulks historical data.</li></ol><p>Already have months of data sitting on a drive? Load it all in one command:</p><p>hms_cpap — reparse /path/to/DATALOG 2025–01–01 2026–03–01</p><p>It scans every date folder in the range, groups files into sessions, and saves parsed data to the database. Good for backfilling history or fixing bad data.</p><p>For docker (easiest way to get started)</p><pre>docker run -d \</pre><pre>-v /path/to/your/DATALOG:/data/DATALOG \</pre><pre>-e CPAP_SOURCE=local \</pre><pre>-e CPAP_LOCAL_DIR=/data/DATALOG \</pre><pre>-e CPAP_DEVICE_ID=cpap_resmed_YOURSERIAL \</pre><pre>-e DB_HOST=your-postgres \</pre><pre>-e MQTT_BROKER=your-mqtt \</pre><p><a href="http://ghcr.io/hms-homelab/hms-cpap:latest">ghcr.io/hms-homelab/hms-cpap:latest</a></p><p>Image on GHCR, builds for amd64 and arm64.</p><p>It shows 46 sensors in Home Assistant</p><ul><li>Realtime: (while machine is on): flow, pressure, leak, SpO2, heart rate, respiratory rate, tidal volume, minute ventilation, session active indicator</li><li>Session summary (after you turn it off): AHI with full breakdown (obstructive/central/hypopnea/RERA/clear airway), avg</li></ul><p>and max event duration, pressure and leak percentiles, usage hours and percentage of 8h target, OSCAR-calculated breathmetrics</p><ul><li>STR daily (official ResMed data): real AHI + delta vs calculated, Cheyne-Stokes minutes, mask on/off count, cumulative lifetime hours, device settings</li></ul><p>OSCAR is the best tool for sitting down and analyzing a specific night zooming into waveforms, looking at individual events, adjusting your therapy. HMS-CPAP is for the other 364 days when you just want to glance at a dashboard and see that everything looks normal. Continuous monitoring vs deep analysis. They complement each other.</p><p>Thinking about adding ML for pattern detection (predict bad nights from early session data, flag anomalies in trends) and already have a working model of a different extractor hardware that doesn’t require a pi, a dual esp32 bundle, cheaper and smaller.</p><p>Repo: <a href="https://github.com/hms-homelab/hms-cpap">GitHub — hms-homelab/hms-cpap: ResMed CPAP data collection service for Home Assistant. Collects therapy data via ez Share WiFi SD card with OSCAR-compatible metrics. · GitHub</a></p><p>Built and tested against AirSense 10 but the EDF format should be the same across the lineup.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db6fc1979ac9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I just shipped semantic search for my DIY security camera timeline.]]></title>
            <link>https://medium.com/@albin.amat/i-just-shipped-semantic-search-for-my-diy-security-camera-timeline-a5c7868b4fc7?source=rss-ce96a1c46225------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5c7868b4fc7</guid>
            <category><![CDATA[semantic-search]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[diy]]></category>
            <dc:creator><![CDATA[Albin Amat]]></dc:creator>
            <pubDate>Wed, 04 Mar 2026 21:38:22 GMT</pubDate>
            <atom:updated>2026-03-04T21:38:22.653Z</atom:updated>
            <content:encoded><![CDATA[<p>Here’s the backstory: I run YOLO11s detection on my home cameras via a C++ service (ONNX Runtime + RTX 3050, ~30ms inference). On motion, it records the event, saves a snapshot, and passes it to a local LLaVA 7b model on Ollama for a natural language scene description. These show up as rich notifications in Home Assistant.</p><p>The descriptions are great. Most of the time. Except LLaVA keeps insisting my</p><p>60 pound Husky is a cat lounging in the backyard. I don’t own a cat. And my big guy would be deeply offended.</p><p>The real problem? Hundreds of events piling up in PostgreSQL with no good way to find anything. Want that one time a package was left at the front door last Tuesday? Good luck scrolling pages or remembering the exact date.</p><p>So why not take those AI descriptions already in Postgres and turn them into</p><p>vector embeddings?</p><p>The implementation:</p><p>a) nomic-embed-text via Ollama generates 768-dim embeddings from each scene description</p><p>b) Stored in PostgreSQL with pgvector. no separate vector DB needed</p><p>c) Backfilled ~1,900 existing descriptions in about 3 seconds</p><p>d) C++ backend (Drogon) converts queries to embeddings for cosine similarity search</p><p>e) Angular frontend search bar returns instant results when type “dog on patio” and get every match with thumbnails and recordings</p><p>Then I thought. what about gaps between motion events? So I added periodic</p><p>snapshots every 5 minutes. Each gets a LLaVA description, embedded into</p><p>pgvector, and becomes searchable across the entire day.</p><p>Went from a paginated list of recordings to full natural language search.</p><p>”Person with package at front door,” “car in driveway at night” and is all instant.</p><p>Runs as a Home Assistant add-on with ingress support. accessible as a native dashboard panel from anywhere. Multi-stage Docker build compiles C++ and Angular from source, pushes to GHCR.</p><p>All local. No cloud APIs. Just a mid-range GPU, some C++, and a Husky that’s</p><p>definitely not a cat.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5c7868b4fc7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I made my cheap DIY Tuya WiFi breakers locally controlled forever]]></title>
            <link>https://medium.com/@albin.amat/how-i-made-my-cheap-diy-tuya-wifi-breakers-locally-controlled-forever-b1eba8e0a9d0?source=rss-ce96a1c46225------2</link>
            <guid isPermaLink="false">https://medium.com/p/b1eba8e0a9d0</guid>
            <category><![CDATA[diy]]></category>
            <category><![CDATA[home-assistant]]></category>
            <category><![CDATA[home-improvement]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Albin Amat]]></dc:creator>
            <pubDate>Tue, 03 Mar 2026 15:01:23 GMT</pubDate>
            <atom:updated>2026-03-03T15:01:23.575Z</atom:updated>
            <content:encoded><![CDATA[<h2>Hard problems make for the best solutions.</h2><p>I bought some cheap DIY Tuya WiFi breakers on AliExpress to automate a few switches around the house.</p><p>What I didn’t account for? The “cheap” part.</p><p>Turns out these devices silently drop their WiFi connection after being idle for some time. No reconnection logic. No watchdog. No self-healing. Once disconnected, the only fix is a power cycle.</p><p>To make things worse:</p><p>They are heavily cloud-dependent.</p><p>Local workarounds require blocking cloud access.</p><p>Blocking cloud access prevents security config updates.</p><p>And none of that fixes the WiFi drop issue.</p><p>At that point I had two options:</p><p>Throw them away.</p><p>Go down the rabbit hole.</p><p>I chose insomnia.</p><p>After months of experimenting, multiple Android HCI snooping sessions, BLE packet analysis, and more Claude-assisted code than I’d like to admit, I discovered the breakers use Bluetooth as a fallback when WiFi dies.</p><p>The BLE protocol is heavily protected and not designed to be friendly to reverse engineering. But eventually I managed to:</p><p>Flash a coin-sized ESP microcontroller</p><p>Build a BLE proxy firmware</p><p>Bridge Bluetooth → WiFi → MQTT</p><p>Add a tiny embedded web server for diagnostics</p><p>Fully decouple control from Tuya cloud</p><p>Now I have:</p><p>A truly local breaker controller</p><p>Full MQTT integration</p><p>Device introspection via web UI</p><p>Zero cloud dependency</p><p>All for the price of a coffee and several nights of sleep</p><p>I’m releasing the solution publicly so the next person doesn’t have to lose theirs.</p><p>Sometimes the best solutions are born from hardware that refuses to behave.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b1eba8e0a9d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Dumping 1,000 Entities into an LLM: I Rebuilt My Home Assistant Voice Stack]]></title>
            <link>https://medium.com/@albin.amat/stop-dumping-1-000-entities-into-an-llm-i-rebuilt-my-home-assistant-voice-stack-93a40e7f99e2?source=rss-ce96a1c46225------2</link>
            <guid isPermaLink="false">https://medium.com/p/93a40e7f99e2</guid>
            <category><![CDATA[home-assistant]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[vector-embeddings]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Albin Amat]]></dc:creator>
            <pubDate>Sat, 28 Feb 2026 22:24:07 GMT</pubDate>
            <atom:updated>2026-02-28T22:24:07.702Z</atom:updated>
            <content:encoded><![CDATA[<p>I say stuff like this all the time:</p><p>“Turn off the sala lights, restart the coffee maker, and play some jazz.”</p><p>And every assistant I’ve tried handles it the same way:</p><p>It does one thing.<br> Maybe two if it’s feeling generous.<br> The rest? Gone. Evaporated.</p><p>After years of breaking commands into pieces and repeating myself like I’m talking to a goldfish, I stopped blaming the assistant and started blaming the architecture.</p><p>Because this isn’t an AI problem.</p><p>It’s a design problem.</p><h3>The Single-Intent Trap</h3><p>Most assistants are built on a one-utterance → one-intent model.</p><p>That’s not laziness. It’s deliberate.</p><p>It keeps routing simple.<br> It keeps ambiguity low.<br> It keeps cloud bills predictable.</p><p>But it also means multi-command voice control is basically an afterthought.</p><p>Amazon added routines.<br> Google added similar workarounds.<br> But routines are static.</p><p>You predefine them.</p><p>You don’t generalize them.</p><p>“Turn off sala and restart the coffee” isn’t a routine.</p><p>So the assistant picks the most confident action and drops the rest like it never heard you.</p><p>Not a bug.</p><p>Architecture.</p><h3>Home Assistant’s LLM Approach</h3><p>When HA introduced LLM-backed Assist, I was excited.</p><p>Finally, natural language without cloud dependency.</p><p>Then I looked closer.</p><p>Every request sends the entire entity list to the LLM.</p><p>In my case:<br> ~1,100 entities<br> ~400 automations</p><p>Every single request.</p><p>You’re asking a model to sift through thousands of tokens to find light.sala_1 every time someone says “turn on the sala.”</p><p>That creates three problems fast:</p><ol><li>Latency</li><li>Token bloat</li><li>Precision loss as context grows</li></ol><p>Even a strong model slows down when you throw your whole house at it.</p><p>And I kept thinking:</p><p>Why are we using a probabilistic model to search a database?</p><p>That’s not what databases are for.</p><h3>So I Rebuilt It</h3><p>I split the system into tiers.</p><p>Because different problems need different tools.</p><h3>Tier 1 — Deterministic and Fast</h3><p>Regex patterns for common commands.</p><p>Turn on/off X<br> Lock Y<br> Pause Z</p><p>If it matches and the entity exists, execute immediately.</p><p>No embeddings.<br> No GPU.<br> No inference.</p><p>This handles the bulk of daily commands under 5ms.</p><h3>Tier 2 — Vector Search for Scale</h3><p>When phrasing gets fuzzy:</p><p>“Brighten the sala.”<br> “Apaga el café.”<br> “Dim the room a bit.”</p><p>Every entity is embedded into pgvector.</p><p>Incoming command gets embedded.<br> Cosine similarity search finds the closest match above threshold.</p><p>It’s retrieval.</p><p>Not reasoning.</p><p>It doesn’t degrade at 1,100 entities.<br> It doesn’t care how big your house is.<br> It doesn’t send your entire entity list to an LLM.</p><p>And it runs in ~200–400ms.</p><h3>Tier 3 — LLM as a Splitter, Not a Resolver</h3><p>Here’s the important part.</p><p>The LLM never sees your entity list.</p><p>Its only job is to split compound commands and detect sequencing.</p><p>“Turn off coffee and then turn it back on and tell me a joke.”</p><p>It returns structured sub-commands.</p><p>Each sub-command goes back through Tier 1 and Tier 2.</p><p>Entity resolution stays deterministic.<br> The LLM just understands language structure.</p><p>That’s it.</p><p>No giant prompts.<br> No 15,000-token context windows.<br> No GPU required for daily life.</p><h3>The Result</h3><ul><li>95% of commands execute under 500ms</li><li>6MB C++ binary</li><li>Runs on a Raspberry Pi 5</li><li>LLM is fallback, not dependency</li></ul><p>Parallel + sequential execution works cleanly.</p><p>Independent commands fire together.<br> Dependent ones wait 500ms for physical settling.</p><p>Coffee cycles properly.<br> Lights turn off together.</p><p>It feels like an assistant instead of a demo.</p><h3>The Bigger Point</h3><p>We’ve gotten into this habit of throwing LLMs at everything.</p><p>But not everything is a language problem.</p><p>Entity resolution is retrieval.<br> Execution ordering is state logic.<br> Device matching is indexing.</p><p>Once each layer does what it’s good at, the system becomes:</p><ul><li>Faster</li><li>Cheaper</li><li>More predictable</li><li>Actually scalable</li></ul><p>And ironically… smarter.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93a40e7f99e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I’m Benchmarking the OpenClaw Hype from a Distance (For Now)]]></title>
            <link>https://medium.com/@albin.amat/why-im-benchmarking-the-openclaw-hype-from-a-distance-for-now-c40165bfc20e?source=rss-ce96a1c46225------2</link>
            <guid isPermaLink="false">https://medium.com/p/c40165bfc20e</guid>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[openclaw]]></category>
            <category><![CDATA[home-assistant]]></category>
            <dc:creator><![CDATA[Albin Amat]]></dc:creator>
            <pubDate>Sat, 28 Feb 2026 12:37:29 GMT</pubDate>
            <atom:updated>2026-02-28T12:37:29.988Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve been seeing the “Mac mini + OpenClaw” setup taking over my feed lately. As someone with homelab and GPU setups and passion for automation, I should be the target audience for this.<br>But I’m sitting this one out. Here’s why:<br>The “Hallucination” Tax is Too High. <br>Even with grounded models like Claude Opus or GPT-5, hallucinations aren’t just a quirk. They are a core mechanic of LLMs. When a chatbot hallucinates, it’s a funny screenshot. But I’m not risking any of that shenanigans especially not automated ones near my source code.<br>The “Agent Tax” isn’t just the tokens you burn; it’s the risk you’re willing to accept when the AI decides it “thinks” it has permission to run a shell command it shouldn’t.<br>2. Determinism / Autonomy for Mission Critical Tasks<br>I already run a complex home lab and server monitoring setup using n8n. Is it “AI-first”? No. But it is deterministic.<br>• When my server goes down, n8n fires a precise alert.<br>• It doesn’t “reason” about why the server is down; it follows the logic I built.<br>For 24/7 infrastructure, I’ll take a reliable flowchart over a “thinking” agent that might get distracted by a CSS selector or a prompt injection any day.<br>3. Latency is the Real Killer<br>For voice pipelines and “snappy” home assistance, I’m aiming for sub-2-second response times. Giving an agent “full control” to loop through thoughts and research jobs in the background is great for async tasks, but it’s the opposite of what I want for a fast, responsive home. A C++ vector-db based API to get near entity ids from an intent precisely to avoid the 5-second “thought loops” that define current agentic platforms, is the actual best tool for this use case. <br>4. Security Architecture Matters<br>Running an unvetted “gateway” that blends untrusted web instructions with my valid credentials on my main workstation? Hard pass. Running it in a strictly isolated sandbox (Docker/VM) with zero access to the primary resources would be the best approach but it beats the purpose of an all around intern monitoring the systems.<br>The Verdict:<br>Agents are amazing for long-running, non-critical thinking tasks. But until the reliability gap closes, no funny business around my workflows, deterministic jobs that I actually control with a little AI flavor.<br>Thank you. And good day👇<br><a href="https://www.linkedin.com/search/results/all/?keywords=%23ai&amp;origin=HASH_TAG_FROM_FEED">hashtag#AI</a> <a href="https://www.linkedin.com/search/results/all/?keywords=%23openclaw&amp;origin=HASH_TAG_FROM_FEED">hashtag#OpenClaw</a> <a href="https://www.linkedin.com/search/results/all/?keywords=%23homeautomation&amp;origin=HASH_TAG_FROM_FEED">hashtag#HomeAutomation</a> <a href="https://www.linkedin.com/search/results/all/?keywords=%23selfhosted&amp;origin=HASH_TAG_FROM_FEED">hashtag#SelfHosted</a> <a href="https://www.linkedin.com/search/results/all/?keywords=%23cybersecurity&amp;origin=HASH_TAG_FROM_FEED">hashtag#CyberSecurity</a> <a href="https://www.linkedin.com/search/results/all/?keywords=%23n8n&amp;origin=HASH_TAG_FROM_FEED">hashtag#n8n</a> <a href="https://www.linkedin.com/search/results/all/?keywords=%23llm&amp;origin=HASH_TAG_FROM_FEED">hashtag#LLM</a> <a href="https://www.linkedin.com/search/results/all/?keywords=%23automation&amp;origin=HASH_TAG_FROM_FEED">hashtag#Automation</a> <a href="https://www.linkedin.com/search/results/all/?keywords=%23n8n&amp;origin=HASH_TAG_FROM_FEED">hashtag#n8n</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c40165bfc20e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>