DEV Community

Cover image for I Built a Single-File AI Agent in Go — Zero Dependencies, Double-Click to Run
Jason Huang
Jason Huang

Posted on

I Built a Single-File AI Agent in Go — Zero Dependencies, Double-Click to Run

Hey DEV community! 👋

I'm an undergrad developer who spent the last few months hacking on something I'm excited to share: OpenAgent — a local AI Agent that ships as a single binary. No Docker. No Node.js. No Python environments. Just download the .exe and double-click.

GitHub: github.com/the-open-agent/openagent


The Problem I Was Trying to Solve

Like many of you, I've been experimenting with AI Agents for everything from code generation to automating tedious tasks. But I kept hitting the same friction:

# Typical "getting started" experience
npm install -g some-agent
# 847 packages installed...
# Oh, you need Python 3.9+ too
pip install ...
# Also Docker for the vector DB
docker-compose up
# 12 minutes later...
# Wait, why is this 400MB?
Enter fullscreen mode Exit fullscreen mode

Sound familiar? I wanted something that felt more like:

# Download openagent.exe (23MB)
# Double-click
# Done ✅
Enter fullscreen mode Exit fullscreen mode

So I built it.


What Makes OpenAgent Different

Single Binary, Zero Runtime Dependencies

I wrote OpenAgent in Go with a specific constraint: everything must compile into one executable. The React frontend gets embedded at build time. The backend is pure Go. One process, one port (14000), one file.

The result:

  • 23 MB executable (vs 400MB+ for typical setups)
  • ~2.7s cold start (vs 30s for alternatives)
  • ~110 MB idle memory

It's Not Just "Hello World"

Despite being a single file, OpenAgent packs real capabilities:

Feature Details
🤖 Models 30+ providers: OpenAI, Claude, DeepSeek, Gemini, Mistral, Grok...
🌐 Browser Real browser automation (navigation, clicks, forms, screenshots)
🖥️ Shell Local command execution with PTY support
📄 Office Read/write Word, Excel, PowerPoint
🔗 MCP Plug-and-play with any MCP-compatible server
📚 RAG PDF/Word/Excel → automatic chunking, embedding, indexing
Workflows BPMN-style visual orchestration
📊 Dashboard Token usage, activity logs, tool management

Why Go Instead of Python?

"But isn't AI/ML Python's domain?"

Here's the thing: Agent performance is bottlenecked by LLM API calls, not language execution speed. The magic happens in the architecture — how you orchestrate tools, manage state, handle concurrency.

Go gives me:

  • Static compilation → single distributable binary
  • Goroutines → efficient concurrency without the memory bloat
  • Cross-platform → Windows/Mac/Linux from one codebase
  • No runtime → users don't install anything

For a "personal local Agent," these trade-offs beat Python's dynamic flexibility.


Quick Start

Windows (easiest):

  1. Download openagent_Windows_x86_64.exe from Releases
  2. Double-click
  3. Open http://localhost:14000

macOS/Linux:

curl -fsSL https://raw.githubusercontent.com/the-open-agent/openagent/master/scripts/install.sh | bash
Enter fullscreen mode Exit fullscreen mode

Configure your model:
The UI has a one-click setup for OpenAI, Claude, DeepSeek, or any OpenRouter-compatible provider.


The Engineering Decisions I'm Proud Of

1. Shell with Guardrails

Shell access is powerful but dangerous. In tool/shell.go, I built in:

  • Default 30s timeout (max 300s)
  • Session-based poll/write/submit flow
  • Optional PTY for interactive programs
  • Audit logging for every command

It's designed as a production tool, not a foot-gun.

2. Memory-Conscious Concurrency

I ran an 80-concurrent health check stress test. Memory grew by 10 MB. Go's goroutine + channel model makes this trivial compared to the memory curves I've seen in Node.js-based agents.

3. Frontend Embedded, Not Served

The React build gets embedded into the binary with Go's embed package. No separate static files to manage, no path resolution issues, no "where did my assets go" bugs.


Real Talk: What's Not Perfect

I want to be transparent about where we stand:

Metric OpenAgent OpenClaw
Lighthouse Score 45 87
Health Check P50 ~33ms ~20ms

Our frontend loading needs work. The Lighthouse gap is real — we're optimizing it. The health check difference is milliseconds, but still.

If you find cases where we're slower or more expensive, file an issue. I genuinely want to know.


Who This Is For

  • Developers who want a Claude Code alternative that runs locally with their own API keys
  • Privacy-conscious users who don't want data leaving their machine
  • Resource-limited setups where running multiple agents used to be impossible
  • Security folks who need audit trails and controlled shell access

Get Involved

OpenAgent is Apache 2.0 licensed. The code is on GitHub, and I review issues/PRs within 12 hours.

If the project helps you, a ⭐ means a lot. If you want to contribute, there are plenty of good first issue labels waiting.

GitHub: github.com/the-open-agent/openagent

Discord: discord.gg/5rPsrAzK7S


The Bigger Picture

I believe personal AI Agents should be lighter, not heavier. One file. Double-click. Done.

No 400MB installs. No dependency hell. No "it works on my machine."

Just an Agent that does the job and gets out of your way.

That's OpenAgent.


Built with Go, caffeine, and the stubborn belief that software should just work.

Top comments (0)