Guide
Developer Guide
Learn how to build, deploy, and integrate AI agents in your applications. From zero to production in minutes.
Overview
What is Hikigai?
Hikigai is a platform for deploying and using AI agents. You can:
- Deploy agents, apps, and MCP servers (config or GitHub; GCP or AWS)
- Invoke agents via Platform API or Python / Node SDKs
- Connect MCP registry connectors or deploy your own tool servers
- Scale automatically with managed multi-cloud infrastructure
- Monitor usage, latency, and errors; subscribe to the event bus
Get API Key
Deploy Agent
Call Agent
Getting Started
Create an Account
Sign up at hikigai.com to get your developer account.
Authenticate with Google SSO
Navigate to the Dashboard and click Sign in with Google:
- Log in using your Google account
- Navigate to Settings to retrieve your access token
- Copy your token for API access
# Your token looks like this:
hk_token_abc123def456ghi789...Install the SDK
pip install hikigai-agentsdk hikigai-appsdk hikigai-core --upgradeSet Your Token
Choose one of these methods:
Environment Variable (Recommended)
export HIKIGAI_API_KEY=hk_token_your_tokenIn Code
from hikigai import Hikigai
client = Hikigai(api_key="hk_token_your_token")Deploy Your First Agent
Create a simple sentiment analyzer in just a few lines of code:
from hikigai import Hikigai, AgentConfig
# Initialize client
client = Hikigai()
# Create and deploy agent
agent = client.deploy(AgentConfig(
name="sentiment-analyzer",
instruction="""
You are a sentiment analysis expert.
Analyze the sentiment of the given text and respond with:
- "positive" for positive sentiment
- "negative" for negative sentiment
- "neutral" for neutral sentiment
Also provide a confidence score from 0 to 1.
Format: {"sentiment": "...", "confidence": 0.XX}
""",
model="gemini-2.0-flash",
description="Analyzes text sentiment",
category="NLP",
))
print(f"✓ Agent deployed: {agent.id}")
print(f"✓ Endpoint: {agent.endpoint}")- Agent configuration is validated
- Agent is registered in the Hikigai platform
- Endpoint is created for invocation
- You get an agent ID for future reference
Use Your Agent
Basic Invocation
# Get your deployed agent
agent = client.agent("sentiment-analyzer")
# Invoke it!
response = agent.invoke("I absolutely love this product!")
print(response.content)
# Output: {"sentiment": "positive", "confidence": 0.95}With Conversation Memory
# Use session_id to maintain conversation context
session = "user-abc-123"
r1 = agent.invoke("Remember: my favorite color is blue", session_id=session)
r2 = agent.invoke("What's my favorite color?", session_id=session)
print(r2.content) # "Your favorite color is blue"Streaming Responses
# Stream for real-time output
for chunk in agent.stream("Write a poem about AI"):
print(chunk, end="", flush=True)Using cURL
curl -X POST "https://api.hikigai.com/v1/agents/sentiment-analyzer/invoke" \
-H "Authorization: Bearer hk_token_your_token" \
-H "Content-Type: application/json" \
-d '{"message": "I love this!"}'Project Collaboration
Hikigai is built for teams. You can invite collaborators to your projects and assign them specific roles.
OWNER
Full access to project settings, billing, member management, and all agents.
ADMIN
Can manage members, agents, and configurations but cannot delete the project.
DEVELOPER
Can deploy, update, and invoke agents. Cannot manage project members.
VIEWER
Read-only access to agent configurations and history. Cannot invoke or deploy.
Invite a Member
Navigate to your Project Dashboard → Members and click Add Member. Enter their email and select a role.
Bring Your Own Key (BYOK)
For production workloads, you can provide your own LLM provider API keys. This gives you more control over rate limits and direct billing with providers.
Supported Providers
- OpenAI: GPT-4o, GPT-4-turbo, GPT-3.5
- Google: Gemini 1.5 Pro, Gemini 1.5 Flash
- Anthropic: Claude 3.5 Sonnet, Claude 3 Opus/Haiku
- OpenRouter: Access to hundreds of open-source models
MCP Servers & Connectors
Connect agents to clinical data via the Model Context Protocol (MCP). Use registry connectors (Epic EHR, Cerner, Athena Health, Google Health Connect, …) or deploy your own MCP server from GitHub in the console.
Registry connectors
Link Epic, Cerner, Athena Health, ECW, or Google Health Connect from the MCP Registry.
Deploy MCP servers
Deploy a custom MCP server from GitHub to GCP or AWS; the platform probes tools and auto-registers connectors.
Using a connector at invoke time
from hikigai.appsdk import AppClient
client = AppClient(api_key="...", project_id="...")
result = client.agent("clinical-note-coder").invoke(
{"note": "..."},
connectors={"epic-ehr": {}},
)Multi-Cloud Deployment
Agents, apps, and MCP servers deploy to GCP or AWS. Optional BYOC credentials deploy into your own account.
In the console, pick provider → service → region (and zones where supported) during deploy. From the SDK, pass cloud_service / region on AgentSDK deploy(), or use client.cloud.catalog() on AppSDK.
Rooms & Event Bus
Rooms provide project-scoped WebSocket pub/sub (presence, publish, bounded replay) via SDK RoomSession clients. See API reference — Rooms.
The Event Bus delivers platform CloudEvents (agent deploy/delete, jobs, invocations, storage). Subscribe with project webhooks (HMAC-signed) or client.events.stream(). Configure webhooks in the project console.
Production Tips
🔒 Security
- Never expose tokens in client-side code
- Call Hikigai from your backend server
- Use environment variables for tokens
- Tokens expire, implement refresh logic
⚡ Performance
- Use the async client for high-throughput applications
- Enable streaming for better user experience
- Implement retry logic for transient failures
- Cache responses when appropriate
📊 Monitoring
- Check
response.latency_msfor performance monitoring - Track
tokens_usedfor cost optimization - Use
request_idfor debugging - Monitor rate limit headers
Example: Production-Ready Code
import asyncio
from hikigai import HikigaiAsync, AgentConfig
from hikigai.exceptions import RateLimitError, HikigaiError
async def invoke_with_retry(agent, message, max_retries=3):
"""Invoke with exponential backoff retry."""
for attempt in range(max_retries):
try:
return await agent.invoke(message)
except RateLimitError as e:
if attempt < max_retries - 1:
await asyncio.sleep(e.retry_after)
else:
raise
except HikigaiError as e:
if attempt < max_retries - 1:
await asyncio.sleep(2 ** attempt)
else:
raise
async def main():
async with HikigaiAsync() as client:
agent = await client.agent("my-agent")
response = await invoke_with_retry(agent, "Hello!")
return response.content
asyncio.run(main())Framework Support
Hikigai is designed to be framework-agnostic. Under the hood, we support:
Google ADK
Full support for Google's Agent Development Kit
AvailableLangGraph
Support for LangChain/LangGraph agents
Coming SoonCrewAI
Support for multi-agent CrewAI frameworks
Coming SoonCustom Agents
Your own Python agent implementations
Coming SoonBest Practices
Write Clear Instructions
Be specific about what you want. Include examples, output format, and constraints.
Use Appropriate Models
For simple tasks, use faster models like claude-3-haiku. For complex reasoning, use claude-3.5-sonnet.
Handle Errors Gracefully
Always wrap API calls in try/except blocks. Implement retry logic for production.
Monitor Usage
Use client.usage() to track your API consumption and avoid surprises.
Use Sessions for Conversations
Pass session_id to maintain context across multiple invocations.