Singapore's FM Publishes His AI Second Brain Blueprints

Singapore FM Vivian Balakrishnan published his personal AI architecture - a Raspberry Pi second brain connecting WhatsApp, Gmail, and a persistent knowledge graph.

Singapore's FM Publishes His AI Second Brain Blueprints

A Raspberry Pi 4 - the hardware running Singapore FM Vivian Balakrishnan's personal AI assistant. Source: Wikimedia Commons

"The diplomat who learns to work with AI will have a meaningful edge. I think that edge is now."

Vivian Balakrishnan, Singapore's Foreign Minister, published something unusual on Saturday: the full architecture of his personal AI assistant, written up in the style of a developer README.

It runs on a Raspberry Pi. It reads his WhatsApp and Gmail. It transcribes voice notes locally via Whisper. It builds a persistent knowledge graph of every speech, article, and conversation he ingests. It drafts responses and briefings on demand. He says he doesn't dare switch it off.

That last detail is the tell. When a tool becomes load-bearing infrastructure for a working diplomat, the design decisions behind it start to matter to more people than just the person who built it.

TL;DR

  • Singapore FM Vivian Balakrishnan published the full architecture of his personal AI assistant, built on a Raspberry Pi and running Claude via the Anthropic API
  • The system connects WhatsApp, Gmail, and voice notes; builds a persistent knowledge graph; drafts speeches and briefings automatically
  • It's composed from four open-source pieces: NanoClaw (agent framework, 28k+ GitHub stars), Mnemon (knowledge graph), OneCLI (credential proxy), and Karpathy's LLM Wiki pattern
  • His core thesis: sharing the blueprint boosts the edge - the specific composition will be obsolete in months, but the builder's ability to compose the right pieces is the durable advantage

The Claim

Balakrishnan published a GitHub gist titled "NanoClaw - Personal Claude Assistant (second brain for a diplomat)" that reads less like a political brief and more like a senior engineer's architecture doc. The writeup covers system design, hardware choice, security model, and the reasoning behind each component - including what the standard LLM approach gets wrong.

His central argument: standard AI assistants are stateless, and the typical fix - RAG over a document store - retrieves chunks of raw text rather than synthesised knowledge. His system does three things instead. It extracts discrete facts from raw documents into a graph database. It synthesises those facts into human-readable wiki pages. And it runs semantic recall automatically on every query, injecting relevant graph entries as context before Claude responds.

He calls it his second brain. The key word is "second" - it isn't replacing his judgment, it's building up context so his judgment runs on more complete information.

Vivian Balakrishnan, Singapore's Foreign Minister, speaking at a public event Vivian Balakrishnan has served as Singapore's Foreign Minister since 2021. He is also a trained ophthalmologist and has been a vocal advocate for technology in governance. Source: wikimedia.org

The Evidence

The hardware choice is deliberate

Running a diplomatic AI assistant on a Raspberry Pi is not about cost. At the level Balakrishnan operates, a cloud subscription is a rounding error. It's about sovereignty.

Voice notes transcribed locally via Whisper.cpp never leave the device. Vector embeddings for semantic search are produced on-device using Ollama with nomic-embed-text. The knowledge graph lives in SQLite on local storage. Every sensitive document stays inside hardware he controls physically.

This is the same logic driving data sovereignty concerns among diplomats across governments. The architecture is an engineering answer to a political question: who can read what. Singapore is simultaneously one of the most connected nations in Southeast Asia and one of the most deliberate about where sensitive data flows - a posture that now applies to the Foreign Minister's personal toolstack.

The four open-source pieces

What Balakrishnan composed is his. The components he composed it from aren't. He's explicit about this: none of the four pieces were built by him, and he published the composition precisely because the value is in the assembly, not the individual parts.

NanoClaw GitHub repository page showing 28,100 GitHub stars NanoClaw, the agent orchestrator central to Balakrishnan's system, has over 28,000 GitHub stars and is maintained by an active open-source contributor community. Source: github.com

The orchestrator is NanoClaw, a Node.js/TypeScript agent framework that manages the message loop, routes between channels (WhatsApp, Gmail, web), and runs Claude inside isolated Docker containers per conversation group. It handles multimodal inputs - voice notes are transcribed before Claude sees them, images are resized and passed as multimodal content. With 28,100 GitHub stars it's not a side project, it's an established open-source tool with an active contributor community.

The memory layer is Mnemon, a Go CLI tool that maintains a SQLite-backed knowledge graph with graph traversal and semantic retrieval. Each entry carries content, category, importance score, tags, timestamp, and graph edges to related entries. The design choice that matters: Mnemon stores structured facts extracted from raw documents, not the raw documents themselves. On every agent invocation, it runs a semantic query using the user's message as input and injects relevant entries automatically. The agent never has to decide to look something up - recall is a system property, not an agent behavior.

OneCLI solves the API key problem that plagues containerised AI setups. Docker containers in NanoClaw's architecture never see raw credentials. OneCLI intercepts HTTPS traffic from containers and injects API keys at request time via a HTTP proxy running on the host. The keys live on the Pi, not inside any container.

The fourth piece is a pattern rather than a repository: Andrej Karpathy's LLM Wiki approach, which compiles structured knowledge into human-readable narrative wiki pages. Balakrishnan's system synthesises Mnemon facts into pages organised into entities/, concepts/, and timelines/ subdirectories, browsable in Obsidian on macOS and iOS. The wiki is the output layer - readable by a human, cross-referenced, navigable without querying the AI.

ComponentPurposeSource
NanoClawAgent orchestrator, channel routing, Docker isolationgithub.com/qwibitai/nanoclaw
MnemonKnowledge graph, semantic recall, fact extractiongithub.com/mnemon-dev/mnemon
OneCLIAPI credential proxy for containersgithub.com/onecli/onecli
LLM Wiki patternSynthesis into navigable wiki pagesKarpathy, X/Twitter

What the Blueprint Doesn't Show

The gist is a developer README, not an operational manual. Several important questions are answered implicitly or not at all.

The WhatsApp integration relies on an unofficial protocol. NanoClaw uses Baileys, a library that builds the WhatsApp Web protocol without Meta's business API. This works - and has worked for a long time - but it operates outside Meta's terms of service and is subject to breakage whenever WhatsApp updates its client protocol. The gist notes this but doesn't quantify the operational maintenance it requires.

The knowledge graph quality depends on curation discipline. Mnemon extracts facts from documents the operator ingests. The system learns as fast as the operator feeds it high-quality input and monitors its output. A knowledge graph that builds up uncritically reviewed facts becomes noise rather than signal over time. The architecture is sound; the operating discipline it requires isn't visible in the README.

Replication isn't beginner-accessible. The writeup is written for a developer audience that's comfortable with Docker, systemd, SQLite, and API configuration. A diplomat without that background would need meaningful technical support to stand up the same stack. The composability is real; the accessibility is limited.

The LLM dependency is explicit. Everything routes through Claude via the Anthropic API. Pricing changes, capability restrictions, or API availability affect the entire system.

The Sharing Thesis

The more interesting claim in the gist isn't about what the system does. It's about what Balakrishnan decided to do with it. He did not keep it internal as Singapore's edge. He didn't spin it into a product. He wrote it up and put it on GitHub.

Publishing isn't giving away your edge. It's doubling down on it.

His reasoning follows a specific logic: the specific composition will be obsolete in months. The durable edge isn't the system - it's the ability to build it. Publishing the blueprint makes you a beacon. Other people working on the same problems find you. They share improvements and point at things you didn't know existed. You learn faster. You stay in the center of where things are happening.

This logic is well-established in open-source software. NanoClaw itself has 28,000 stars precisely because someone published rather than sat on an early version. Linux, Git, and the entire ML toolchain exist because researchers published rather than competed on secrecy. The half-life of any specific AI configuration is measured in months. The value compounds in the people who keep building, not in the configuration they protect.

For AI agents specifically, this is particularly true. The field is moving fast enough that today's clever composition is tomorrow's default starting point. A diplomat who builds a second brain and publishes the architecture is in a better position twelve months from now than one who treats it as a competitive secret - not because the system is permanent, but because publishing is how you stay current as it evolves.

Singapore has already drawn attention for its scale of AI investment in infrastructure. What Balakrishnan published Saturday is something different: not infrastructure, but individual practice. One person, building for their own use, making the work visible. The infrastructure bets are made at the ministry level. The second brain is a personal choice.


The verdict on the claim holds. The blueprint will be obsolete. The sharing was right.

Sources: Vivian Balakrishnan GitHub gist | NanoClaw on GitHub | Mnemon on GitHub | OneCLI on GitHub

Elena Marchetti
About the author Senior AI Editor & Investigative Journalist

Elena is a technology journalist with over eight years of experience covering artificial intelligence, machine learning, and the startup ecosystem.