Skip to main content

Aroha Protocol — Build and register agents, MCPs, and skills on the Aroha Hub. Supports FastAPI, LangChain, CrewAI, Google ADK, OpenAI SDK.

Project description

aroha — Aroha Protocol Python SDK

Build agents that register on the Aroha Hub and are callable by any client through the standard /v1/run protocol.

pip install aroha

Quick start

from aroha.agent import serve

@serve(
    name="My Agent",
    system_prompt="You are a helpful assistant.",
    provider="anthropic",
    model="claude-sonnet-4-6",
    memory="session",
)
async def my_agent(message: str, session_id: str, history: list, context: dict) -> str:
    import anthropic
    client = anthropic.Anthropic()
    resp = client.messages.create(
        model="claude-sonnet-4-6",
        max_tokens=1024,
        system="You are a helpful assistant.",
        messages=[{"role": "user", "content": message}],
    )
    return resp.content[0].text

if __name__ == "__main__":
    my_agent.start(port=8000)

This starts a FastAPI server with:

  • POST /v1/run — the Aroha Protocol invocation endpoint
  • GET /.well-known/aroha-agent.json — agent manifest
  • GET /health — liveness check
  • GET /docs — Swagger UI

Register on the Aroha Hub

import os
result = my_agent.register(
    endpoint_url="https://my-agent.fly.dev",
    api_key=os.environ["AROHA_API_KEY"],
)
print(result["didHash"])  # chat URL: https://aroha-labs.com/chat/<didHash>

Framework bridges

LangChain / LangGraph

pip install aroha[langchain]
from langchain_anthropic import ChatAnthropic
from langchain_core.prompts import ChatPromptTemplate
from aroha.bridges.langchain_v1 import from_chain

llm = ChatAnthropic(model="claude-sonnet-4-6")
prompt = ChatPromptTemplate.from_messages([
    ("system", "You are a helpful assistant."),
    ("human", "{message}"),
])
chain = prompt | llm

agent = from_chain(chain, name="LangChain Agent")
agent.start(port=8000)

CrewAI

pip install aroha[crewai]
from crewai import Agent, Task, Crew
from aroha.bridges.crewai_v1 import from_crew

researcher = Agent(
    role="Researcher",
    goal="Research the given topic thoroughly",
    backstory="Expert researcher",
    llm="anthropic/claude-sonnet-4-6",
)

def make_crew(message: str) -> Crew:
    task = Task(description=message, agent=researcher, expected_output="Research findings")
    return Crew(agents=[researcher], tasks=[task])

agent = from_crew(make_crew, name="Research Agent")
agent.start(port=8000)

Google ADK

pip install aroha[google-adk]
from google.adk.agents import LlmAgent
from google.adk.runners import Runner
from google.adk.sessions import InMemorySessionService
from aroha.bridges.google_adk import from_runner

adk_agent = LlmAgent(
    name="assistant",
    model="gemini-2.0-flash",
    instruction="You are a helpful assistant.",
)
session_service = InMemorySessionService()
runner = Runner(agent=adk_agent, app_name="my-app", session_service=session_service)

agent = from_runner(runner, name="Gemini Agent", memory="session")
agent.start(port=8000)

OpenAI SDK

pip install aroha[openai]
from openai import OpenAI
from aroha.bridges.openai_v1 import from_openai_client

client = OpenAI()
agent = from_openai_client(
    client,
    model="gpt-4o",
    system_prompt="You are a helpful assistant.",
    name="GPT Agent",
    memory="session",
)
agent.start(port=8000)

Hub client

from aroha.hub import register_agent, resolve_agent, call_agent, list_agents

# Resolve by didHash
agent = resolve_agent("abc123def")

# Call an agent by didHash (resolves endpoint automatically)
reply = call_agent("abc123def", "What is the weather in London?")
print(reply["message"])

# List all agents
agents = list_agents(limit=20)

Advanced: A2A envelope transport

The SDK also includes the full Aroha cryptographic envelope protocol for zero-trust agent-to-agent messaging:

from aroha import generate_did, ArohaServer, ArohaClient, build_envelope

/v1/run protocol

Any compliant agent must implement:

POST /v1/run
Content-Type: application/json

{
  "message":   "user message",
  "sessionId": "uuid (optional, echoed back)",
  "history":   [{"role": "user"|"assistant", "content": "..."}],
  "context":   {}
}

Response:

{
  "message":   "agent reply",
  "sessionId": "uuid",
  "artifacts": [],
  "usage":     {}
}

The @serve decorator handles all of this automatically.

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

aroha-1.1.1.tar.gz (43.2 kB view details)

Uploaded Source

Built Distribution

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

aroha-1.1.1-py3-none-any.whl (53.0 kB view details)

Uploaded Python 3

File details

Details for the file aroha-1.1.1.tar.gz.

File metadata

  • Download URL: aroha-1.1.1.tar.gz
  • Upload date:
  • Size: 43.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aroha-1.1.1.tar.gz
Algorithm Hash digest
SHA256 fa5d294597ba5b0040067ff9c3cec08a387005210c6f857bd535ffb5be805a25
MD5 749085f968f6e7e678d757c5d8eacd65
BLAKE2b-256 134761bd1be1cd612d1d687b1fcdc44fd8d488b169999bd1f4512dab01b4bf8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for aroha-1.1.1.tar.gz:

Publisher: publish-pypi.yml on projectmed99/aroha

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aroha-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: aroha-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 53.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aroha-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 02487f3d8c34ddf97dd3b9a1c7a3cdf750dccc00ec5df1362799943301a88af2
MD5 0b16dbe3e033f3797613c165d4409ac5
BLAKE2b-256 1d3244cc881aba07a079dfd89c7d4570ea98f6bc2b7895d6d24751b12f1ad43c

See more details on using hashes here.

Provenance

The following attestation bundles were made for aroha-1.1.1-py3-none-any.whl:

Publisher: publish-pypi.yml on projectmed99/aroha

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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