Skip to content

Architecture

EleAgent uses a distributed architecture with a controller node that serves the web UI and orchestrates queries across a pool of worker containers.

System Diagram

Components

Controller

The controller is a lean Node.js container that serves the web frontend and API. It does not have Python or Tesseract installed — all AI query execution is delegated to workers.

Responsibilities:

  • Serve the React frontend (built by Vite)
  • Expose Express REST API and WebSocket endpoint
  • Manage authentication (JWT + API keys)
  • Session slot management (SQLite-backed, max 5 concurrent)
  • Route queries to available workers via WebSocket
  • Relay streaming responses back to the browser

Workers (x5)

Each worker is a heavier container with the full analysis toolchain. Workers receive queries from the controller, execute them via the Claude Agent SDK, and stream results back.

Responsibilities:

  • Execute AI queries using @anthropic-ai/claude-agent-sdk
  • Run Python scripts for IFC, PDF, and Excel analysis
  • Perform OCR via Tesseract
  • Write generated artefacts (CSV, summaries) to the shared volume

Pre-installed tools:

  • claude CLI (globally installed)
  • Python 3 venv with: ifcopenshell, openpyxl, pandas, pdfplumber, PyMuPDF, pytesseract
  • System tools: ripgrep, jq, sqlite3, tesseract-ocr, git

Egress Proxy

A Squid HTTP proxy on the internal network controls all outbound traffic from workers. Only HTTPS connections to Anthropic API and auth endpoints are permitted.

Allowed destinations:

  • *.anthropic.com (API calls)
  • *.claude.com (OAuth / platform authentication)

All other outbound traffic is denied. See Security for details.

Networks

NetworkScopeMembers
internalPrivate, no external routingController, Workers, Egress Proxy
externalBridge to host networkController (port 3001), Egress Proxy

Workers cannot reach the internet directly. All external traffic is routed through the egress proxy on the internal network.

Technology Stack

ComponentTechnology
BackendNode.js 22 (ESM), Express 4
FrontendReact 18, Vite, Tailwind CSS
AI Integration@anthropic-ai/claude-agent-sdk 0.2.56
DatabaseSQLite (better-sqlite3) with WAL mode
WebSocketws library
Container Basenode:22-bookworm-slim
Egress ProxyUbuntu Squid
AuthJWT tokens, bcrypt password hashing

Docker Build Targets

The Dockerfile uses a multi-stage build with three targets:

TargetPurposeIncludes PythonIncludes Tesseract
builderCompile native addons (node-pty, better-sqlite3, bcrypt)NoNo
controllerWeb UI + API serverNoNo
workerAI query executionYes (venv)Yes