Skip to main content

Architecture

One Node.js service owns accounts, agents, tools, memory and automation; every app, chat platform and device is a client of it.

Clients Flutter apps · messaging platforms · task webhooks · wearable
│
Edge Express routes · Socket.IO · WebSocket gateways
│
Services agent engine · tasks · integrations · messaging · memory · voice
│
Runtimes cloud computer · desktop companion · Android over ADB · MCP servers
│
State SQLite and files under NEOAGENT_HOME

Repository layout​

PathContents
server/index.jsEntry point: HTTP server, Socket.IO, gateways, service startup
server/http/Middleware, route table (routes.js), Socket.IO setup, static files, error handler
server/routes/One thin Express router per domain
server/services/Business logic, one directory per domain
server/db/SQLite connection, base schema, HTTP session store
server/guest_agent.jsHTTP agent that runs inside the cloud computer
lib/neoagent CLI (manager.js, cli/), setup engine (setup/), schema migrations
runtime/Runtime paths, env parsing, release channel
bin/neoagent.js (CLI) and neoagent-bootstrap.js (standalone CLI entry)
flutter_app/Flutter client for web, Android, macOS, Windows and Linux
firmware/ESP32-S3 wearable firmware (ESP-IDF)
landing/Landing page at / and status page at /status
scripts/Release, runtime staging and signing helpers
test/Backend, security, contract, e2e, WebSocket, Flutter and install tests

Startup sequence​

  1. Runtime home. runtime/paths.js sets a private umask, migrates legacy in-repo data and creates the runtime directories.
  2. Environment. dotenv loads the checkout's .env, then NEOAGENT_HOME/.env with override.
  3. Database. server/db/database.js opens SQLite, applies migrations and marks runs left by a dead process as interrupted.
  4. HTTP edge. Middleware, session store, Socket.IO, API routes, static routes and the error handler are registered.
  5. Gateways. The display, desktop-companion and wearable WebSocket gateways attach to the HTTP server.
  6. Listen. The server listens on PORT (default 3333), then calls startServices().
  7. Services. server/services/manager.js builds the service graph, restores messaging and MCP connections, starts the task runtime and resumes interrupted runs.

Service graph​

startServices() creates each long-lived service once and stores it on app.locals.

app.locals keyModule (server/services/)Owns
agentEngineai/engine.jsAgent runs, subagents, delegation
runtimeManagerruntime/manager.jsCloud and local computers, control leases, Android controllers
taskRuntimetasks/runtime.jsSchedules, triggers, task runs and result delivery
messagingManagermessaging/manager.jsMessaging platform adapters and the inbound queue
integrationManagerintegrations/manager.jsOfficial integrations, OAuth, integration tools
memoryManagermemory/manager.jsMemories, facts, recall, core memory
memoryIngestionServicememory/ingestion.jsBackground ingestion from connected accounts
mcpClientmcp/client.jsRemote MCP server connections and their tools
skillRunnerai/toolRunner.jsSkills loaded from agent-data/skills
skillLearningServiceskills/learning_service.jsSkills learned from completed runs
toolPolicyService, approvalGateServicesecurity/Tool permissions and approval prompts
credentialBrokercredentials/broker.jsBitwarden-backed credential use
voiceRuntimeManagervoice/runtimeManager.jsLive voice sessions
wearableServicewearable/service.jsWearable sessions and firmware updates
teachServiceteach/service.jsTeach Mode recordings

Real-time channels​

ChannelPathCarries
Socket.IO/socket.iorun:*, tool:approval_*, tasks:*, messaging:*, voice:*, computer:status
Display gateway/api/computer/display-wsnoVNC stream of the cloud computer
Desktop companion/api/computer/local/wsCommands to a desktop app acting as the computer
Wearable gateway/api/wearable/wsPush-to-talk voice for the ESP32-S3 wearable
  • Session-bound. Every channel authenticates with the HTTP session cookie.
  • Per-user rooms. Socket.IO emits into user:<id>, so one account never sees another's events.

Execution backends​

Each user picks a computer provider (computer_provider in user_settings); the server picks the cloud backend with TERMINAL_ENV.

ProviderBackendIsolation
cloudTERMINAL_ENV=qemu (default): persistent Debian VM per userVM; needs KVM, HVF or WHPX
cloudTERMINAL_ENV=docker: per-user container with a named home volumeContainer
cloudTERMINAL_ENV=host: the server's own OS sessionNone
localDesktop companion: a signed-in macOS, Windows or Linux appThe user's own machine
  • Android. A separate per-user controller drives emulators or devices over ADB on the server host.
  • MCP. Only remote http(s) MCP servers are accepted; local stdio servers are disabled.

State​

  • Database. One SQLite file, data/neoagent.db, through server/db/database.js; HTTP sessions use data/sessions.db.
  • Files. Skills, workspaces, artifacts and computer disks live under NEOAGENT_HOME (default ~/.neoagent).
  • Details. See Persistence and migrations.

Subsystem guides​