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.0.tar.gz (15.2 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.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nexus_mesh-0.1.0.tar.gz
  • Upload date:
  • Size: 15.2 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.0.tar.gz
Algorithm Hash digest
SHA256 0318a42e9e94290e1c770654d118c930ee2acfec73d8d23baef2ee59c022101b
MD5 e73909172c22ae9336a10bafdd98eee2
BLAKE2b-256 50240635e753096ec6ade0f3107193476af553cfad2a462e5be685b5431016a1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nexus_mesh-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e4b3c7756c317a587b8e67251ec81531fc020352d01143479706b5966fb327a
MD5 ea0b5b2061175d3d100a2e0b8de9efdb
BLAKE2b-256 6d0edeb8b87b6c0f9bd436b1effdd69930fd9679e5c98b69086f99f393e3f2ec

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.0

2 files

0.1.1

2 files

This release

0.1.0 This release

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