Skip to content

JayceDugan/Nemo-Agent

Repository files navigation

Nemo Agent

A minimal AI agent framework in Go with zero external dependencies tested with unsloth/Nemotron-3-Nano-30B-A3B-GGUF. It talks to any OpenAI-compatible API endpoint and features parallel tool execution, recursive sub-agent delegation, and a tmux-based IDE that gives you full visibility into what the agent is doing.

Preview

What is this?

This is a raw thought experiment exploring what an AI agent IDE could look like when built from scratch with no frameworks, no TUI libraries, and no dependencies beyond Go's standard library.

The core idea: tmux is the IDE. Instead of building a custom terminal UI, the agent takes over a tmux session and uses panes as first-class UI primitives — a main REPL, a live stats sidebar, and dynamically spawning sub-agent panes that run tasks in parallel. You can watch the agent think, delegate, and execute all at once.

It's also an experiment in sub-agent parallelism. The agent can spawn child agents (up to 3 levels deep), each running in their own tmux pane with independent context. Ask it to "create country files for 25 countries" and it fans out the work across parallel sub-agents, each visible in the bottom pane area. The parent agent stays focused while the children do the heavy lifting.

UX

  1. Run ./agent — it automatically launches a tmux session and sets up the IDE layout
  2. Type at the You: prompt
  3. The agent reasons, calls tools in parallel, and spawns sub-agents as needed
  4. The stats sidebar updates in real-time showing context usage, LLM calls, tool calls, and active sub-agents
  5. Sub-agent panes appear at the bottom with task titles, rebalancing as they come and go
  6. When done, the agent replies and waits for your next input
  7. Ctrl-C tears down the entire session

Layout

┌──────────────────────────────────────┬──────────────┐
│                                      │ Agent Stats  │
│  Main REPL                           │              │
│  (interactive input/output)          │ Model: ...   │
│                                      │ Context: 45% │
│                                      │ LLM calls: 6 │
│                                      │ Tool calls: 8│
│                                      │ Sub-agents:  │
│                                      │   3/15       │
├──────────┬──────────┬────────────────┼──────────────┤
│ sub-agent│ sub-agent│  sub-agent     │              │
│ task A   │ task B   │  task C        │              │
└──────────┴──────────┴────────────────┴──────────────┘
  Status bar: [user] [cwd] [git branch]   [ctx: 45%] [model]

Build & Run

go build -o agent .
./agent

Expects an OpenAI-compatible API at http://workstation:8080/v1/chat/completions.

Flags

Flag Description
--no-layout Disable tmux IDE layout (plain REPL)
--context-window N Token limit (default 131072)
--task-file PATH Run as sub-agent with task from file
--output PATH Write sub-agent output to file
--depth N Recursion depth (set internally)

Architecture

The agent runs a read-eval-loop: read user input, send the conversation to the LLM, execute any tool calls in parallel, feed results back, and repeat until the model returns a plain text reply.

main.go          → Entry point, CLI, tool registration, tmux lifecycle
agent.go         → Agent struct: LLM communication, parallel tool-call loop
spawn_agent.go   → Sub-agent delegation via tmux panes
layout.go        → IDE pane management and rebalancing
sidebar.go       → Real-time stats display
stats.go         → Metrics tracking with atomic JSON persistence
tmux.go          → Low-level tmux command wrappers
prompt.go        → System prompts for agents and sub-agents
tools/tool.go    → Tool interface (name, description, JSON schema)
tools/create_file.go → File creation tool

Key design decisions

  • Zero dependencies — only Go stdlib (net/http, encoding/json, os/exec, etc.)
  • Parallel tool execution — all tool calls from a single LLM response run concurrently via goroutines
  • Recursive sub-agents — agents spawn child agents up to depth 3, each with independent context and their own tmux pane
  • Tmux as UI — pane splitting, titles, status bar, and layout rebalancing replace a TUI framework
  • Atomic stats — metrics persist via temp file + rename, read by the sidebar every second

Adding a tool

  1. Create tools/my_tool.go implementing the Tool interface
  2. Register in main.go: agent.Register(tools.MyTool{})
type Tool interface {
    Definition() Definition
    Execute(params json.RawMessage) (string, error)
}

About

This is a raw thought experiment exploring what an AI agent IDE could look like when built from scratch with no frameworks, no TUI libraries, and no dependencies beyond Go's standard library.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages