Kioku
A personal memory API for one owner. PostgreSQL holds my writing, work history, photographs, mail, finance and health; this site reads a public-only view of it, and my own AI clients reach the rest through a separate tool surface with its own credential and its own database role.
One source of truth about me, two ways in, and neither borrows the other’s permissions.
Every product I use keeps its own copy of me, and every copy drifts. Kioku is where the copy that counts lives: one PostgreSQL database, written by scheduled workers and my own captures, read by everything else. A visitor asking a question at /ask and my own assistant searching my notes meet the same data — but the visitor’s path runs through a database role that cannot see a private row, and that is decided by PostgreSQL, not by a prompt.
- Stack
- Python
- FastAPI
- PostgreSQL
- pgvector
- TypeScript
- MCP
- Category
- Platform
Why It Exists
Owning my own contextModels get better every few months, and every new conversation still starts with me explaining who I am. The facts an assistant would need — what I built, what I wrote, how I work — are spread across a dozen products, each holding its own projection of me and each slowly treating that projection as the source. Pasting a profile into a prompt is one more copy. Kioku started as the database behind this site and grew into the place those facts are owned: career, writing, photographs, music, code activity, places, and the private domains — mail, finance, health — that will never be public. It is a mirror as much as an origin: most of it is pulled in from the services that produced it. But there is one copy now, and everything else, including this website, is derived from it.
How It Fits Together
Sources → workers → one database → three surfacesWorkers pull from the services that produce my data, on PostgreSQL job leases so a crashed run is picked up rather than repeated; the iOS companion posts from the phone, through an outbox that reposts until the server answers. Everything lands in one PostgreSQL with pgvector. Above it sits one FastAPI application with three surfaces — public reads, an authenticated admin API, and MCP tools — and each surface reads through its own database role. The web console and the companion app are clients of the same API; the console is built on the same design system as this site.
Where the Boundary Lives
Enforced below the conversationKeeping Retrieval Fresh
Incremental index · hybrid searchThe index diffs on a content hash and re-embeds only what moved, which is what makes capturing something every day affordable. Visibility is part of the hash, so flipping a note to public re-syncs it even though not one word changed, and a renamed page drops its old identity before the new one is indexed. A full rebuild still exists, as a repair path rather than the way a small edit reaches search. Search itself runs two halves — literal matching for an exact name or phrase, embeddings for related meaning — and fuses them by rank, because a cosine score and a text match share no scale. A bilingual golden set, including questions that try to coax out private facts, gates every pull request.
Two AI Interfaces
Shared data, separate authorityThe public /ask path answers questions about my published work: it retrieves from the public view, runs a bounded agent loop of at most three tool rounds, calls the model through a replaceable gateway, and streams the answer with citations back to the page. When there is not enough public evidence, it says so. The private path is MCP: my own AI clients get tools to search everything, query exact records — a count or a total should come from a query, not from a model estimating over similar passages — capture a note, propose links between entries, and start jobs. That client acts for me but is not me. It holds its own revocable credential and database role, every tool declares whether it reads, writes or starts work, and it cannot publish or delete — because between that credential and the data sits a model that may have just read a web page.
What It Powers Here
The site is a clientEvery list on this site is a read from Kioku’s public API: the projects, the experience timeline and the projects under each role, the photography archive, the blog, the agent-skills catalogue. /ask is a stream from it, and the contact form posts to it. The site keeps only what is specific to a website — rendering and caching, a per-visitor burst limit in front of /ask, and checking that traffic arrived through the expected edge — while Kioku owns the daily cost ceiling, because it is the component that actually pays the model providers. When something changes, Kioku sends one event naming the collection that changed; turning that into cache tags is this site’s decision, so Kioku does not know the site caches anything. The page you are reading hangs off a project record in Kioku, too.
Decisions and Trade-offs
Each one has a dated recordSplit out of the website into its own repository
Python and FastAPI, with Alembic owning the schema
One search door instead of two
Links are proposed, never guessed into the graph
Data may tighten access, never widen it
Models behind a gateway, named by job
Where It Stands
A mirror, not yet an originBuilding it showed me where the problem actually sits. Storing was never the hard part; the origin is. Most of what Kioku holds still starts in somebody else’s system, so when a platform changes its export, my side breaks, and what a platform never recorded never reaches me. Centralising also widens the blast radius — which is why the effort went into least privilege, auditing and backups rather than into collecting more. The semantic index can still miss the right passage and a streamed answer can still fail halfway; the point is that each of those risks has a visible boundary, a fallback and a test, rather than an “AI” label in front of it.
Want the full walkthrough?
Happy to talk through the architecture, the decisions, and the trade-offs behind this build.
More work
EFFICIENT System
A multi-tenant wheels and tyres ERP and commerce platform — one Django backend, a shared React UI kit, seven web portals, a storefront, nine Apple and three Android apps, and a Rust CLI with an MCP server. My layer is the one underneath: a shared engineering contract, with agent workflows that hold its repositories to that contract.

INOVIT Dealer Portal
A B2B e-commerce platform replacing a legacy .NET ERP — 49 API endpoints, 4-region database routing, cross-repo OpenAPI type generation, and zero-downtime migration on a shared production SQL Server.


Personal Website
A bilingual portfolio with an AI assistant grounded in the site's own content, privacy-first analytics, blog, photography gallery, and WCAG AAA colour contrast — self-hosted on my own Docker stack, all solo-built.