Singapore Foreign Minister Vivian Balakrishnan has built an AI-powered "second brain for a diplomat" using open-source tools and a Raspberry Pi, offering a glimpse into how the city-state is positioning itself at the intersection of statecraft and artificial intelligence.
The system, called NanoClaw, runs on a Raspberry Pi 5 and functions as a persistent AI assistant with memory capabilities across messaging platforms including WhatsApp and Gmail. Balakrishnan detailed the technical architecture in a GitHub gist that reveals sophisticated design choices prioritizing sovereignty, privacy, and control.
The minister will keynote AI Engineer Singapore alongside Gavriel Cohen, creator of the NanoClaw framework, where he'll share his experience experimenting with open-source AI tools and building the workflow, alongside broader reflections on how AI may reshape global dynamics.
Ten countries, 700 million people, one region - and Singapore is making a bet that the future of diplomacy runs on edge computing and knowledge graphs, not cloud dependencies.
The technical architecture reveals priorities that align closely with government-grade AI governance. The system uses Claude Agent SDK with container-isolated instances per group, SQLite-backed knowledge graphs for persistent memory, and local embeddings via Ollama and nomic-embed-text to keep sensitive documents on-device rather than in cloud infrastructure.
Crucially, the system includes what Balakrishnan's documentation calls a "credential proxy" - an HTTP proxy that intercepts container HTTPS traffic and injects credentials at request time, ensuring that Docker containers never see raw API keys. Combined with sender allowlists, per-group namespace isolation, and mount blocklists for sensitive paths like .ssh and .aws directories, the architecture demonstrates security-first thinking.
The knowledge system employs a three-layer design: raw sources like speech transcripts and articles stored immutably; a SQLite-backed graph database where each entry includes content, category, importance score, tags, timestamp, and edges to related entries; and synthesized wiki pages organized by entities, concepts, and timelines. On every agent invocation, semantic recall queries the graph and auto-injects relevant facts as system context.
For a diplomat whose work involves tracking complex multi-party negotiations, treaty provisions, and bilateral relationships across dozens of countries, this architecture effectively creates an always-available research assistant with perfect recall - one that never forgets a conversation from six months ago or which minister said what at which ASEAN meeting.
The choice to run everything on a Raspberry Pi 5 rather than cloud infrastructure is particularly revealing. While cloud AI services offer convenience and scale, they also create dependencies on foreign providers and potential surveillance vectors. By running the system locally, Balakrishnan ensures that sensitive diplomatic context never leaves Singaporean control.
This reflects Singapore's broader approach to digital sovereignty. The city-state has invested heavily in building domestic AI capabilities through initiatives like AI Singapore and the National AI Strategy, which emphasize trustworthy AI development and deployment. The government has also been explicit about the strategic risks of over-reliance on technology providers from any single country.
The use of open-source tools throughout the stack - from Node.js and TypeScript to Baileys for WhatsApp protocol and whisper.cpp for voice transcription - also signals a preference for transparency and auditability over proprietary black boxes.
Political observers note this isn't just about Balakrishnan's personal productivity. Singapore has long punched above its weight in diplomacy through meticulous preparation, institutional memory, and sophisticated understanding of complex multi-party dynamics - precisely the areas where AI-augmented knowledge management offers leverage.
If senior ministers are building and refining these systems themselves rather than just commissioning them, it suggests Singapore views AI fluency as a core competency for statecraft, not just a technical support function.
The system's synchronization with Obsidian vaults via iCloud and rsync also reveals practical considerations - diplomats need their knowledge bases accessible across devices, but iOS git client limitations required workarounds. These details suggest real-world usage rather than demonstration projects.
For the broader region, Balakrishnan's public sharing of the technical architecture via GitHub is itself notable. Rather than treating the system as a state secret, he's positioned it as a contribution to open-source AI governance practices - consistent with Singapore's strategy of shaping global norms while building domestic capabilities.



