How HKUDS Built an AI Agent Framework in 4,000 Lines
University researchers built nanobot from scratch as a focused, Python-native alternative to comprehensive frameworks like OpenClaw. The 99% code reduction demonstrates how starting fresh can serve researchers and developers who need accessibility over feature completeness.

How HKUDS Built an AI Agent Framework in 4,000 Lines
When researchers at Hong Kong University's Data Intelligence Lab needed an AI agent framework, they faced a choice: fork an existing codebase or start fresh. They picked the scalpel over the Swiss Army knife.
The result is nanobot, a Python framework that delivers core AI agent functionality in roughly 4,000 lines—99% smaller than the 430,000+ lines in frameworks like Clawdbot. With over 22,000 GitHub stars as of March 2026, developers seem to appreciate transparency over feature sprawl.
Why a Research Lab Chose to Start From Scratch
HKUDS, the Data Intelligence Lab at the University of Hong Kong, built nanobot for researchers and developers who need to understand every layer of their tooling. When you're teaching agent architecture or prototyping novel approaches, a massive dependency graph gets in the way.
The team wasn't rejecting frameworks like OpenClaw—those tools handle production edge cases and enterprise requirements that most research projects never encounter. Nanobot targets the developer who wants to read the entire codebase in an afternoon, modify core behavior without navigating abstraction layers, or onboard graduate students without a week-long framework tutorial.
This philosophy of intentional limitation means faster iteration cycles for academic work and a gentler learning curve for newcomers to agent development.
The 99% Code Reduction: What Gets Cut, What Stays
The size difference reflects different design goals. OpenClaw's feature set covers production monitoring, complex deployment scenarios, and backwards compatibility—infrastructure that enterprises depend on but researchers rarely need.
Nanobot strips back to essentials: core agent loops, basic tool integration, and Python-native implementations that prioritize readability. The 4,000-line count isn't about writing clever code—it's about refusing to solve problems the target users don't have.
Where alternatives like NanoClaw emphasize container isolation for security, nanobot focuses on accessibility. The tradeoff is explicit: you sacrifice production-hardened features for a codebase you can actually hold in your head.
Python Accessibility and Community Response
Python-native implementation matters more than syntax preference suggests. For machine learning researchers already working in PyTorch or TensorFlow, staying in the same language eliminates context switching. No polyglot debugging sessions, no FFI headaches, no explaining to a PhD student why they need to learn TypeScript to modify agent behavior.
The 22,500+ stars suggest real hunger for this approach. While stars don't measure production deployments, they signal that thousands of developers appreciate having an option that prioritizes learning and experimentation over feature completeness.
The project's maintenance record shows viability beyond academic prototyping. The v0.1.3.post7 release in February 2026 addressed a WhatsApp bridge security vulnerability, binding it to localhost with optional token authentication. Responsive security patches show that minimalism doesn't mean neglect.
When to Choose Minimal Over Maximal
The framework decision depends on your constraints. Pick OpenClaw when you need battle-tested reliability, detailed logging, or features that handle production traffic at scale. That complexity exists because real-world deployments demand it.
Choose nanobot when you're teaching agent systems, prototyping research ideas, or building proof-of-concepts where understanding the stack matters more than enterprise features. If your team will modify framework internals—common in academic work—a 4,000-line codebase becomes an asset, not a limitation.
Neither approach is superior. They serve different points on the spectrum between "I need to ship this to customers" and "I need to understand how this works." The 99% code reduction isn't a verdict on other frameworks—it's proof that focus can be its own form of sophistication.