ubiquity-mesh 0.1.1

Unix socket mesh for zero-port agent communication
Documentation

ubiquity-mesh

Unix socket mesh for zero-port agent communication in the Ubiquity ecosystem.

Overview

ubiquity-mesh enables consciousness-aware agents to communicate without using network ports:

  • Zero configuration - No port conflicts or firewall issues
  • Automatic discovery - Agents find each other via filesystem
  • Low latency - Direct memory-mapped communication
  • Secure - Unix file permissions for access control

Features

  • Auto-connection - Agents automatically join the mesh
  • Message routing - Direct agent-to-agent communication
  • Broadcast support - Send to all agents in the mesh
  • Health monitoring - Automatic dead agent detection
  • Hot reload - Add/remove agents without restart

Usage

use ubiquity_mesh::{ConsciousnessMesh, MeshMessage};
use ubiquity_core::agent::AgentRole;

// Create mesh node
let mesh = ConsciousnessMesh::new("agent-1", AgentRole::Architect).await?;

// Join the mesh
mesh.join().await?;

// Send directed message
mesh.send_to("agent-2", MeshMessage::new("Hello")).await?;

// Broadcast to all
mesh.broadcast(MeshMessage::new("Status update")).await?;

// Receive messages
while let Some(msg) = mesh.receive().await? {
    println!("From {}: {}", msg.sender, msg.content);
}

Architecture

┌─────────────┐     ┌─────────────┐
│   Agent 1   │────│   Agent 2   │
└──────┬──────┘     └──────┬──────┘
       │                   │
    ┌──┴───────────────────┴──┐
    │   Unix Socket Mesh      │
    │  /tmp/ubiquity/*.sock   │
    └─────────────────────────┘

Zero-Port Benefits

Unlike traditional TCP networking:

  • No port allocation needed
  • No firewall configuration
  • No network interface binding
  • Works in containers without privileges
  • Survives network changes

Security

The mesh uses Unix filesystem permissions:

  • Only the user who created the mesh can access it
  • Agents verify identity through filesystem
  • No network exposure

License

This project is licensed under the Fair License.