Skip to main content

Official Python SDK for building, deploying, and managing HIPAA-compliant AI agents on the Hikigai healthcare platform. Supports Google ADK agent types (LLM, Sequential, Parallel, Loop), MCP connector integration, BYOK model configuration, and one-line Cloud Run deployment.

Project description

hikigai-agentsdk

Python SDK for deploying and managing AI agents on the Hikigai platform.

Installation

Note: The Hikigai SDKs are currently published to Test PyPI while in early access. Do not run the SDK from the repository source directly — the hikigai.core namespace package must be installed to resolve correctly. Always install via the commands below.

# Using pip
pip install \
  --index-url https://test.pypi.org/simple/ \
  --extra-index-url https://pypi.org/simple/ \
  hikigai-agentsdk==0.0.1

This will automatically install hikigai-core (the shared namespace dependency) alongside hikigai-agentsdk.

Once released on the main PyPI index, installation will simplify to:

# Future release (main PyPI)
pip install hikigai-agentsdk

Quick Start

from hikigai.agentsdk import AgentClient, AgentConfig, InputSchema, OutputSchema, StringField

# Initialize client
client = AgentClient(
    api_key="your-api-key",
   project_id="your-project-id"
)

# Deploy an agent
agent = client.deploy(AgentConfig(
    name="my-agent",
    display_name="My AI Agent",
    description="A helpful AI assistant",
    instruction="You are a helpful assistant that answers questions",
    model="claude-3.5-sonnet",
    input_schema=InputSchema(fields={"message": StringField(required=True)}),
    output_schema=OutputSchema(fields={"response": StringField()}),
    tools=[],
    timeout=60,
    memory_mb=512,
    version="1.0.0"
))

print(f"Agent deployed! ID: {agent.id}")

Direct API Methods (Alternative Approach)

For custom integrations or when you need direct HTTP control, you can call the API endpoints directly:

Authentication Flow

Step 1: Exchange API Key for Session Token

curl --location --request POST 'http://localhost:8000/api/v1/auth/exchange' \
--header 'X-API-Key: your_api_key_here' \
--header 'Content-Type: application/json'

Step 2: Deploy Agent via API

Python Example:

import requests
import os
from datetime import datetime, timedelta

class HikigaiAPIClient:
    def __init__(self, api_key: str, base_url: str = "http://localhost:8000"):
        self.api_key = api_key
        self.base_url = base_url
        self.access_token = None
        self.token_expiry = None
    
    def exchange_api_key(self):
        """Exchange API Key for session token."""
        headers = {"X-API-Key": self.api_key, "Content-Type": "application/json"}
        response = requests.post(
            f"{self.base_url}/api/v1/auth/exchange",
            headers=headers
        )
        response.raise_for_status()
        data = response.json()
        
        self.access_token = data["access_token"]
        self.token_expiry = datetime.utcnow() + timedelta(seconds=data["expires_in"] - 300)
        return data
    
    def ensure_token_valid(self):
        """Refresh token if needed."""
        if not self.access_token or datetime.utcnow() >= self.token_expiry:
            self.exchange_api_key()
    
    def deploy_agent(self, config: dict) -> dict:
        """Deploy an agent via API."""
        self.ensure_token_valid()
        headers = {
            "Authorization": f"Bearer {self.access_token}",
            "Content-Type": "application/json"
        }
        response = requests.post(
            f"{self.base_url}/api/v1/agents/deploy",
            headers=headers,
            json=config
        )
        response.raise_for_status()
        return response.json()

# Usage with context manager
class HikigaiAPIClientContext:
    def __init__(self, api_key: str):
        self.client = HikigaiAPIClient(api_key)
    
    def __enter__(self):
        self.client.exchange_api_key()
        return self.client
    
    def __exit__(self, exc_type, exc_val, exc_tb):
        pass

# Deploy agent
with HikigaiAPIClientContext(api_key=os.environ["HIKIGAI_API_KEY"]) as client:
    config = {
        "name": "medical-coder",
        "display_name": "Medical Coding Assistant",
        "description": "Extracts ICD-10 and CPT codes",
        "instruction": "You are a medical coding expert...",
        "model": "claude-3.5-sonnet",
        "timeout": 60,
        "memory_mb": 512,
        "input_schema": {
            "fields": {
                "clinical_note": {"type": "string", "required": True}
            }
        },
        "output_schema": {
            "fields": {
                "icd10_codes": {"type": "array"},
                "cpt_codes": {"type": "array"}
            }
        },
        "tools": []
    }
    
    result = client.deploy_agent(config)
    print(f"Agent deployed! ID: {result['agent_id']}")

For complete API documentation, see the Python AgentSDK Docs.

Features

  • 🚀 Simple Deployment: Deploy agents with a single function call
  • 🔧 Tool Integration: Add custom tools, OpenAPI specs, or MCP servers
  • 📊 Schema Validation: Define input/output schemas for type safety
  • ☁️ Multi-Cloud: Deploy to GCP Cloud Run, GCP Agent Engine, or AWS Bedrock
  • 🔒 HIPAA Compliant: Built-in compliance checking
  • 📈 Versioning: Semantic versioning support

Documentation

Full documentation:

License

MIT

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

hikigai_agentsdk-0.1.5.tar.gz (41.0 kB view details)

Uploaded Source

Built Distribution

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

hikigai_agentsdk-0.1.5-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

Details for the file hikigai_agentsdk-0.1.5.tar.gz.

File metadata

  • Download URL: hikigai_agentsdk-0.1.5.tar.gz
  • Upload date:
  • Size: 41.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for hikigai_agentsdk-0.1.5.tar.gz
Algorithm Hash digest
SHA256 ade698a4319e1d55b0c2a3dc2ad4a03a488b194cfab6f7383f092d6acfae6050
MD5 9579c041e6ba0599c00c94fa66b61b36
BLAKE2b-256 3b29be0ed228452f025612bb534aedaa5d9b90a9de527f0aa9226ffeeead5cc1

See more details on using hashes here.

File details

Details for the file hikigai_agentsdk-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for hikigai_agentsdk-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9239c3b6db1fa51a383e55e772a386edce14c06971c4ce3158485e67eed09512
MD5 911e6a936f8a8ed04463a38b0ec4a524
BLAKE2b-256 b29966a33ffc2df29ab5cf1726ea219a4091084e354f13837e129803577a5b58

See more details on using hashes here.

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