Skip to main content

RXON (Reverse Axon) - Lightweight Inter-node Reverse Communication Protocol.

Project description

RXON (Reverse Axon) Protocol

EN | ES | RU

License: MPL 2.0 Python 3.11+ PyPI version

RXON (Reverse Axon) is a lightweight reverse-connection inter-service communication protocol designed for the HLN (Hierarchical Logic Network) architecture.

It serves as the "nervous system" for distributed multi-agent systems, connecting autonomous nodes (Holons) into a single hierarchical network.

🧬 The Biological Metaphor

The name RXON is derived from the biological term Axon (the nerve fiber). In classic networks, commands typically flow "top-down" (Push model). In RXON, the connection initiative always comes from the subordinate node (Worker/Shell) to the superior node (Orchestrator/Ghost). This is a "Reverse Axon" that grows from the bottom up, creating a channel through which commands subsequently descend.

✨ Key Features

  • Pluggable Transports: Full abstraction from the network layer. The same code can run over HTTP, WebSocket, gRPC, or Tor.
  • Generic Event System: Unified signaling mechanism for progress updates, custom alerts, and real-time metrics.
  • Zero Trust Identity Chain: Built-in support for hierarchical event bubbling with origin_worker_id and bubbling_chain to prevent spoofing in multi-layer holarchies.
  • Universal Resource Telemetry: Heartbeats include granular usage metrics for CPU, RAM, and any hardware devices (GPU, TPU, Sensors, Robots) via extensible properties and metrics.
  • Task Prioritization & Deadlines: Built-in support for task priority and execution deadline (timestamp) to enable smart local scheduling and auto-cancellation of stale tasks.
  • Zero Dependency Core: The protocol core has no external dependencies (standard transports use aiohttp and orjson).
  • Strictly Typed Contracts: All messages (tasks, results, heartbeats) define their data structures via JSON Schemas, enabling automated validation and smart dispatching.
  • Blob Storage Native: Built-in support for offloading heavy data via S3-compatible storage (rxon.blob).

🏗 Architecture

The protocol is divided into two main interfaces:

  1. Transport (Worker side): Interface for initiating connections, retrieving tasks, emitting events, and sending results.
  2. Listener (Orchestrator side): Interface for accepting incoming connections and routing messages to the orchestration engine.

High-Signal Telemetry (Heartbeats)

RXON Heartbeats provide the Orchestrator with a detailed view of the Holon's health:

  • ResourcesUsage: Real-time CPU and RAM consumption.
  • DeviceUsage: Per-device load and custom metrics (e.g., temperature, memory, battery level) for any hardware.
  • hot_cache: List of artifacts/models currently loaded in memory.
  • hot_skills: Detailed info about skills currently ready for immediate execution.

Skill Contracts

Every skill declared in RXON can now include:

  • input_schema: JSON Schema for parameters.
  • output_schema: JSON Schema for results.
  • events_schema: Mapping of event names to their JSON Schemas.
  • output_statuses: List of valid logic outcomes (e.g., success, retry_later).

🛡️ Error Handling

RXON uses a dedicated exception hierarchy grounded in RxonError. It also defines standardized error codes for task results:

  • CONTRACT_VIOLATION_ERROR: The worker's output does not match its declared schema.
  • DEPENDENCY_MISSING_ERROR: A required dependency (artifact, file, service) is missing.
  • RESOURCE_EXHAUSTED_ERROR: Physical resources (RAM, VRAM, CPU) are exhausted.
  • LIMIT_EXCEEDED_ERROR: Logical limits (Quotas, Rate limits, Context windows) exceeded.
  • TIMEOUT_ERROR: The worker could not finish in time (or the deadline has passed).
  • LATE_RESULT: (Response) The orchestrator refused the result because the deadline has passed.

🧪 Testing

The library includes a MockTransport to simplify testing Workers in isolation without running a real Orchestrator.

from rxon.testing import MockTransport

# Use standard factory with mock:// scheme
transport = create_transport("mock://", "test-worker", "token")
await transport.connect()

# Inject tasks directly
transport.push_task(my_task_payload)

📜 License

The project is distributed under the Mozilla Public License 2.0 (MPL 2.0).


Mantra: "The RXON is the medium for the Ghost."

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rxon-1.0b5.tar.gz (32.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rxon-1.0b5-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

Details for the file rxon-1.0b5.tar.gz.

File metadata

  • Download URL: rxon-1.0b5.tar.gz
  • Upload date:
  • Size: 32.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Gentoo","version":"2.18","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for rxon-1.0b5.tar.gz
Algorithm Hash digest
SHA256 017d9bb5323299460b52e858ba79e3b4b51d8517fa8725ee33c7a22c3bb229d4
MD5 7adf5b694a5e0a3dbcc3816e7c626a2d
BLAKE2b-256 ce41f0f1b7d8a56df91861ad754afaf4810e093e51fa090101ffc72555c15a31

See more details on using hashes here.

File details

Details for the file rxon-1.0b5-py3-none-any.whl.

File metadata

  • Download URL: rxon-1.0b5-py3-none-any.whl
  • Upload date:
  • Size: 30.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Gentoo","version":"2.18","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for rxon-1.0b5-py3-none-any.whl
Algorithm Hash digest
SHA256 69b68c5ad3feda8cd54b10c9622864a47779a2ce3591cd6c69a37335fe7811b5
MD5 9917706141d8903c3a4d5150c1b4822a
BLAKE2b-256 c59ffcbaee5583ab526ef56fcc6f966447e1cc0c5d817229e705c29e1201e9b9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page