Skip to main content

Nexus Mesh — Python SDK

The official Python SDK for Nexus Protocol, the universal open-source coordination protocol for AI agents.

Nexus lets agents — regardless of language, framework, or vendor — discover each other, communicate with end-to-end encryption, and collaborate on distributed tasks.

pip install nexus-mesh

The distribution is named nexus-mesh; the import module is nexus_sdk.


Quick start

Start the coordination hub:

nexus hub

Write a worker agent:

import asyncio
from nexus_sdk import NexusAgent

async def compute(input_data, task):
    return {"result": input_data["a"] + input_data["b"]}

async def main():
    agent = NexusAgent(
        name="calc_bot",
        capabilities=["calculate"],
        roles=["worker"],
    )
    agent.on_task(compute)
    await agent.connect()
    await asyncio.Future()   # stay online

asyncio.run(main())

Delegate work from an orchestrator:

from nexus_sdk import NexusAgent

orchestrator = NexusAgent(name="lead", roles=["admin"])
await orchestrator.connect()

# Find an agent by capability, then hand it a task
found = await orchestrator.discover(capabilities=["calculate"])
result = await orchestrator.submit_task(
    title="Add two numbers",
    assignee=found["agents"][0]["name"],
    input_data={"a": 20, "b": 22},
)
# {"result": 42}  — encrypted end-to-end in transit

Features

  • End-to-end encryption — RSA-2048-OAEP + AES-256-GCM. The hub routes ciphertext it cannot read.
  • Verifiable identity — SHA-256 fingerprints over roles, permissions, and capabilities.
  • JWT authentication — every message after registration carries a hub-signed token.
  • Role-based access control — per-agent policies enforced at the hub.
  • Discovery — locate agents by capability, role, metadata, or name.
  • Distributed tasks — async lifecycle: pending → running → completed / failed.
  • Federation — hub-to-hub peering across organizations, encryption preserved end to end.
  • Immutable audit log — Merkle-chained events; retroactive edits break the chain.
  • Rate limiting — token-bucket throttling per agent.
  • Developer CLInexus hub | discover | ping | ask | task | keygen | dashboard | docs.

API summary

Method Purpose
connect() Open the connection and obtain a JWT
send(to, content) Fire-and-forget encrypted message
ask(to, content) Encrypted request, awaits the reply
discover(...) Find agents by capability, role, or metadata
submit_task(title, assignee, input_data) Delegate a task and await its result
who_is(name) Fetch an agent's certified identity and public key
on_message / on_request / on_task Register inbound handlers

Full reference: docs/API-REFERENCE.md


Documentation

License

Apache 2.0

Download files

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

Source Distribution

nexus_mesh-0.1.1.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

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

nexus_mesh-0.1.1-py3-none-any.whl (25.6 kB view details)

Uploaded Python 3

File details

Details for the file nexus_mesh-0.1.1.tar.gz.

File metadata

  • Download URL: nexus_mesh-0.1.1.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.4

File hashes

Hashes for nexus_mesh-0.1.1.tar.gz
Algorithm Hash digest
SHA256 50ad8f26c7d9b31cc5af920be52e73100499e48d8597a319cee26ddbeafd6824
MD5 b064a3c3b5e4ac630fd984ef9bf3ffa3
BLAKE2b-256 b9906581afaf9e50d9f2e133ff10918301a59c2221d4bb44d0047e4cddc2e42e

See more details on using hashes here.

File details

Details for the file nexus_mesh-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: nexus_mesh-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 25.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.4

File hashes

Hashes for nexus_mesh-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3b56e9481f7482a575d11eb7b424a4daa3a43e41adc0c48dd4bed32564a80384
MD5 d1156da4bb44c678d2fa8804a189fba8
BLAKE2b-256 b93f16aaf72b9fb5a28765c90d7151abd658b52f1967fc471c5fa89dd9b4d7e8

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.0

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page