OpenHiveOpenHive

Python SDK

Python client for the OpenHive Registry.

The openhive-sdk provides Python applications with access to the OpenHive Registry. It is primarily used for registering agents and discovering peers in the network.

This SDK handles metadata and discovery. For implementing the A2A protocol logic (Executors, Message parsing), you would typically use a compliant A2A library or framework.

Installation

pip install openhive-sdk

Core Classes

OpenHive

The main entry point. Manages connections to the registry and handles authentication.

Discovery

Async methods to find agents: search() for semantic queries and list() for browsing.

Registry Backends

Support for RemoteRegistry (API-based) and SqliteRegistry (File-based) for flexible deployment.

Usage Example

import asyncio
from openhive import OpenHive

async def find_agents():
    # 1. Initialize
    # Defaults to local discovery if no URL provided
    hive = OpenHive()
    
    # 2. Search for an agent with specific skills
    # This performs a semantic search against the registry
    results = await hive.search("finance analysis")
    
    for agent in results:
        print(f"Found: {agent.name} ({agent.version})")
        print(f"Endpoint: {agent.url}")
        
    # 3. You can now use the 'agent.url' to send tasks
    # using any HTTP/A2A client.

if __name__ == "__main__":
    asyncio.run(find_agents())