Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Observatory + Agent Integration

The NeuAIs Observatory provides 3D visualization of all agents, services, and infrastructure generated from the manifest system.

Architecture

CSV Manifest → Perfection Generator → generated.manifest.json
                                            ↓
                                    Observatory API (3003)
                                            ↓
                                    WebSocket (3004)
                                            ↓
                                    3D Visualization

Components

1. Observatory API Server

Location: observatory.neuais.com/api/server.js
Port: 3003 (HTTP), 3004 (WebSocket)

Purpose:

  • Reads generated.manifest.json from Perfection system
  • Transforms manifest data into Observatory-compatible format
  • Serves REST API endpoints
  • Broadcasts real-time updates via WebSocket

Endpoints:

GET  /api/manifest          - Full system data
GET  /api/agents            - All agents
GET  /api/agents/:id        - Specific agent details
GET  /api/services          - All services
GET  /api/infrastructure    - All infrastructure
GET  /health                - API health check

2. Live Data Client

Location: observatory.neuais.com/js/observatory-data-live.js

Purpose:

  • Connects to Observatory API
  • Establishes WebSocket for real-time updates
  • Handles reconnection logic
  • Exposes agent control methods (start/stop)

Usage:

const client = new ObservatoryDataClient();
await client.connect();

// Listen for updates
client.on('data_update', (data) => {
    // Refresh visualization
});

client.on('agent_status', (update) => {
    // Update specific agent
});

// Control agents
client.startAgent('anomaly-detector');
client.stopAgent('code-reviewer');

3. Live Visualization

Location: observatory.neuais.com/index-live.html

Features:

  • Loads data from API instead of hardcoded file
  • Updates visualization when manifest changes
  • Shows connection status indicator
  • Real-time particle flows between connected nodes
  • Interactive node selection

Data Flow

Initial Load

  1. User opens http://localhost:3003/index-live.html
  2. observatory-data-live.js connects to API
  3. API reads latest generated.manifest.json
  4. Data transformed to Observatory format
  5. 3D nodes created for each agent/service/infrastructure
  6. Particle flows created based on dependencies

Real-time Updates

  1. Perfection generates new manifest
  2. Observatory API detects file change
  3. API broadcasts update via WebSocket
  4. All connected clients receive update
  5. Visualization rebuilds with new data
  6. Stats counters update

User Interactions

  1. User clicks 3D node
  2. Detail card appears with agent info
  3. User clicks “Start” button
  4. WebSocket sends start_agent command
  5. API forwards to agent runtime (future)
  6. Status updates via WebSocket
  7. Node visual updates (color, pulse)

Data Format

Manifest Format (Perfection)

{
  "agents": [{
    "name": "anomaly-detector",
    "language": "rust",
    "template": "ric-integrated-agent",
    "lm_provider": "openai",
    "lm_model": "gpt-4",
    "dependencies": [
      {"type": "service", "name": "ric"},
      {"type": "service", "name": "smo"}
    ]
  }]
}

Observatory Format (Transformed)

{
  "agents": [{
    "id": "anomaly-detector",
    "name": "Anomaly Detector",
    "status": "active",
    "cpu": 12,
    "mem": "24MB",
    "connections": ["ric", "smo"],
    "metadata": {
      "language": "rust",
      "template": "ric-integrated-agent",
      "lm_provider": "openai",
      "lm_model": "gpt-4"
    }
  }]
}

Visual Design

Color Scheme (NeuAIs Brand)

  • Agents: White (#FFFFFF) to light grey (#CCCCCC)
  • Services: Medium grey (#666666) to grey (#999999)
  • Infrastructure: Dark grey (#1a1a1a) to dark grey (#333333)
  • Particles: Match source node color
  • Background: Pure black (#000000)

Node Sizes

  • Infrastructure: 0.8 units (largest)
  • Services: 0.5 units (medium)
  • Agents: 0.4 units (smallest)

Animations

  • Pulse: Nodes breathe (scale 0.85-1.0)
  • Glow: Emissive intensity oscillates
  • Particles: Flow along bezier curves between nodes
  • Rotation: Auto-rotate entire system (optional)

Scaling to 1000 Agents

Performance Optimizations

Current: 30 nodes (9 agents + 19 services + 3 infra)
Target: 1000+ agents

Strategies:

  1. Level of Detail (LOD)

    • Distant nodes: Simple spheres
    • Close nodes: Detailed geometry with labels
  2. Frustum Culling

    • Only render nodes in camera view
    • Improves performance by 40-60%
  3. Instancing

    • Reuse geometry for similar nodes
    • Reduces draw calls from 1000 to ~10
  4. Particle Pooling

    • Reuse particle objects
    • Limit max particles to 5000
  5. Update Throttling

    • Update positions at 60 FPS
    • Update metrics at 1 FPS
    • Reduces CPU usage by 70%

Integration with Control Panel

Both interfaces work together:

Control Panel (port 3002):

  • List view of all components
  • Table-based management
  • Detail panels
  • Start/stop buttons

Observatory (port 3003):

  • 3D spatial view
  • Visual connections
  • System architecture
  • Real-time flows

Users can use either or both depending on preference.

Usage

Start Observatory

cd neuais.com/hub.neuais.com/observatory.neuais.com
./start-observatory.sh

Opens at: http://localhost:3003/index-live.html

Generate New System

cd neuais.com/automation
./cli/perfection generate manifest/neuais-complete.csv

Observatory automatically updates when manifest changes.

Monitor Live

  • Open Observatory in browser
  • Watch connection status indicator (top-right)
  • Green = Connected and receiving updates
  • Grey = Disconnected or loading

Future Enhancements

  1. Real SMO/RIC Status

    • Poll actual agent health from SMO
    • Show real CPU/memory from metrics endpoints
  2. Interactive Controls

    • Right-click node → Start/Stop/Restart
    • Drag between nodes → Create connection
    • Double-click → Open in IDE
  3. Advanced Filtering

    • Search agents by name
    • Filter by language, status, LM provider
    • Group by capability or policy
  4. Workflow Visualization

    • Show task flows as animated particles
    • Click particle to see task details
    • Trace task path through system

Testing

# Terminal 1: Generate system
cd neuais.com/automation
./cli/perfection generate manifest/neuais-complete.csv

# Terminal 2: Start API
cd observatory.neuais.com
./start-observatory.sh

# Terminal 3: Check API
curl http://localhost:3003/api/agents | jq
curl http://localhost:3003/api/manifest | jq '.agents | length'

# Browser: Open Observatory
open http://localhost:3003/index-live.html

Expected result:

  • See all 9 agents as white/grey nodes
  • See all 19 services as medium grey nodes
  • See 3 infrastructure components as dark grey nodes
  • Particles flowing between connected nodes
  • Stats showing 9/19/3 counts

Known Limitations

  1. Status is simulated - Not yet querying real agent processes
  2. Metrics are estimated - CPU/memory values are placeholders
  3. Start/Stop is stubbed - Sends WebSocket message but doesn’t actually start agents
  4. No filtering yet - Shows all nodes always

These will be addressed when real agent runtime is implemented.


The integration architecture is complete and ready. The 3D visualization now pulls live data from your manifest system.