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 isnexus_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
Bridge an existing framework agent
Wrap a LangChain, CrewAI, AutoGen, or LlamaIndex agent without changing a line of it — it becomes discoverable and receives delegated tasks like a native Nexus agent:
from nexus_sdk.adapters.langchain import NexusLangChainAdapter
agent = NexusLangChainAdapter(my_agent_executor, name="analyst", capabilities=["market_analysis"])
await agent.connect()
Orchestrate multiple agents
from nexus_sdk import NexusPipeline
pipeline = (
NexusPipeline(orchestrator)
.step("Translate", capabilities=["translate"])
.step("Calculate", capabilities=["calculate"],
input_fn=lambda prev: {"expression": prev["translated_text"]})
)
result = await pipeline.run({"text": "compute forty two doubled"})
fan_out(orchestrator, branches, capabilities=...) runs independent branches in
parallel instead. Full guide: docs/AGENT-INTEGRATION.md.
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 CLI —
nexus 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
- Agent integration — adapters and orchestration
- RFC-001 — Core protocol specification
- Security and encryption model
- API reference
License
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nexus_mesh-0.2.0.tar.gz.
File metadata
- Download URL: nexus_mesh-0.2.0.tar.gz
- Upload date:
- Size: 43.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e9aa571c0ef86a9e614c18c372dd8c54dc7eced21ecd2a4c66d7d6ec959f24e
|
|
| MD5 |
824e2db2a9312848bd1cd050c3c5b8ef
|
|
| BLAKE2b-256 |
21aac5dac18b78f6a1d7643089228bd726e618da9589e95632c344c4b5d61d2c
|
File details
Details for the file nexus_mesh-0.2.0-py3-none-any.whl.
File metadata
- Download URL: nexus_mesh-0.2.0-py3-none-any.whl
- Upload date:
- Size: 51.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af995b191a926d92d8a0cf4a27ff636f48de5187270508f02380f529ff5f79c1
|
|
| MD5 |
96a74a486ce8ebdd8a09110aef941428
|
|
| BLAKE2b-256 |
bdc1f8dc915faaca45c14789fddea527e18b5137d04f56a9262f644255cf6ff5
|