Engineering notes & updates

Behind the scenes of building a personal OS.

#19 — Your files, and the two questions a folder can't answer

Folders tell you where something is. They can't tell you whether you already saved it somewhere else, or what it looked like before you changed it. Those are the two things that actually go wrong.

drivefilesselfhostedproduct

#18 — Photograph a receipt, and your inventory fills itself in

Knowing what you own, where it is and what it's worth is one of those jobs everyone abandons after a week. So the work of keeping it current got moved off you: point a camera at a receipt, approve a list, done.

inventoryselfhostedproductai

#17 — Three ways to look at your money. Pick the one that's you.

The money module in Micelclaw isn't one screen trying to serve everyone. It's three: one for a person who wants to know where it went, one for a freelancer chasing invoices, and one for a company that has to file. Same data, three lenses.

financeselfhostedproductdashboard

#16 — A 45% cut, and two things I was wrong about

One of our agents stopped fitting in its own context window. Trimming the tool catalogue by 45% took two lines of deletion — but getting there meant retracting two confident conclusions and one bug that turned out not to exist.

aillmoptimizationselfhosted

#15 — Seven agents per user: delegation, and every way it broke

We gave each user seven specialist agents and one coordinator. Then we spent four months finding out that the hard part isn't the topology — it's what happens when one agent hands work to another.

aiarchitecturellmselfhosted

#14 — Deterministic agent identity: a before_tool_call hook fills the token the model kept getting wrong

Our MCP facade needs an auth_token on every tool call. The model kept mangling that 64-hex secret — and subagents spawned via sessions_spawn never got one at all, so delegated tasks failed silently ("Dalí doesn't answer"). Here's the native OpenClaw before_tool_call hook that injects each agent's token host-side, keyed by ctx.agentId, so the model never touches it.

aisecurityarchitecturellm

#13 — The MCP facade: how agents talk to the backend without curl

Our agents used to curl the Core API from inside a sandboxed container — and it failed with exit 7, every single time. Here's the MCP facade that replaced it: one typed tool per domain, dispatched through the full auth-scope-approval-audit pipeline via app.inject(), with zero business logic rewritten.

mcpai-agentsarchitecturesecurity

#12 — Building a process manager for 40 services on 8GB of RAM

Docker containers, systemd services, Ollama models, and internal workers — all in one table. How we built a unified process manager with a RAM budget engine that decides what runs, what waits, and what gets evicted.

dockerselfhostedarchitecturedevops

#11 — Designing an AI approval system: when should your agent ask for permission?

An AI agent that can send emails, delete files, and configure VPNs needs guardrails. We built a 4-level approval system with shell control, PIN verification, and configurable timeouts — without slowing down everyday operations.

aisecurityarchitectureselfhosted

#10 — PII-aware routing: how to use cloud AI and keep your sensitive data local

When your personal AI system needs cloud models for complex reasoning but handles sensitive data, you need a privacy router. Here's how we built one with regex, pseudonyms, and a routing table — no ML required.

privacyaiarchitectureselfhosted

#09 — Sleep-time compute for personal data: what your AI should do while you sleep

Most personal AI systems sit idle 95% of the time. We built a background intelligence engine that discovers cross-domain connections, learns your preferences, and pre-computes insights — all while you're not using it.

aiarchitecturepostgresqlselfhosted

#08 — Hybrid search with RRF: combining pgvector, tsvector, and a knowledge graph in one query

How we fused semantic search, full-text search, knowledge graph traversal, and heat scoring into a single search pipeline using Reciprocal Rank Fusion — all inside PostgreSQL.

postgresqlsearchpgvectorai

#07 — Your AI agent is wasting 90% of its tokens on field names

We audited our agent's token consumption and found that 25% of the context window was skills, 10% was identity files, and the actual user message was a rounding error. Here's what we did about it.

aiarchitecturellmoptimization

#06 — From JSON to compact: reducing API payloads 60% for LLM consumption

Your AI agent doesn't need pretty JSON. We built a compact response format that cuts token usage dramatically — and learned what to kill along the way.

apiaitypescriptarchitecture

#05 — Heat scoring: teaching your data to forget (gracefully)

Every record in our system has a temperature. It rises when you interact with it and decays exponentially when you don't. Here's how a simple formula changed the way search, digest, and the AI agent work with personal data.

postgresqlarchitectureaisearch

#04 — Building a personal knowledge graph with just PostgreSQL (no Neo4j needed)

How two tables, three ALTER statements, and recursive CTEs replaced what most people reach for a graph database to do. At personal scale, PostgreSQL is the graph database.

postgresqldatabaseknowledgegrapharchitecture

#02 — The 4-slot hook pipeline: how every CRUD operation feeds four systems at once

A simple post-CRUD pipeline that feeds embeddings, heat tracking, entity extraction, and the changelog — without any of them blocking each other or the user.

architecturepostgresqltypescriptai

#03 — Entity extraction with a 2B model: benchmarks from a personal knowledge graph

We benchmarked qwen3-vl (2B parameters, quantized) for NER on personal data — notes, emails, diary entries, and photos. The results surprised us, but not in the way F1 scores suggest.

ainlpollamaselfhosted

#01 — 137 migrations and counting: building a personal OS schema from scratch

How a weekend project to save contacts efficiently turned into a 147-table PostgreSQL schema powering a full personal operating system.

architecturedatabasepostgresqlselfhosted