Documentation

Build with Hikigai

Deploy AI agents, ship full-stack applications, and connect healthcare MCP servers — everything you need to build with the Hikigai platform.

Getting Started

Quick Start

  1. Create a Hikigai account and get your API key
  2. Set up Project Members and roles for collaboration
  3. Deploy an agent using the web wizard or API
  4. Invoke your agent via REST API

Hikigai provides a simple way to deploy AI agents powered by Google's ADK and Vertex AI. You can create agents using our config-based approach (no code) or upload custom Python code.

Authentication

All API requests require authentication using a Bearer token. Get your API key from the dashboard.

curl -X GET "https://api.hikigai.com/v1/agents" \
  -H "Authorization: Bearer YOUR_API_KEY"
Security Tip: Hikigai supports Bring Your Own Key (BYOK) for LLM providers. Configure your own API keys in Project Settings to use your organization's existing quotas and billing.

Deploy an Agent

Config-Based Deployment

The easiest way to deploy an agent. Just provide a name and instruction:

curl -X POST "https://api.hikigai.com/v1/agents/deploy/config" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-sentiment-analyzer",
    "instruction": "Analyze the sentiment of the given text and return positive, negative, or neutral with a confidence score.",
    "model": "gemini-2.0-flash",
    "category": "Natural Language Processing"
  }'

Code-Based Deployment

For custom logic, upload your agent.py file:

# agent.py
from google.adk.agents import Agent

def analyze_sentiment(text: str) -> dict:
    """Custom sentiment analysis logic."""
    return {"analyzed": True}

root_agent = Agent(
    name="my-agent",
    model="gemini-2.0-flash",
    instruction="Analyze sentiment...",
    tools=[analyze_sentiment],
)

Invoke an Agent

Once deployed, invoke your agent with a simple POST request:

curl -X POST "https://api.hikigai.com/v1/agents/my-sentiment-analyzer/invoke" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "I love this product! It works great."
  }'

Response

{
  "agent_id": "abc123",
  "response": "The sentiment is positive with high confidence (0.92).",
  "metadata": {
    "latency_ms": 245,
    "timestamp": "2024-01-15T10:30:00Z"
  }
}

Deploy an App

Hikigai lets you deploy full-stack web applications directly from a GitHub repository. The platform handles framework detection, Docker image building, container orchestration, and gives your app a live production URL — all in minutes.

How App Deployment Works

1

Connect Source

Link your GitHub repo or upload a ZIP archive. Hikigai authenticates via a GitHub App for secure, scoped repository access.

2

Framework Detection

The platform analyzes your repository to detect the framework (Next.js, React, FastAPI, etc.) and generates an optimized Dockerfile.

3

Build & Push

AWS CodeBuild compiles your app into a Docker image and pushes it to a private ECR container registry.

4

Deploy to ECS

The image is deployed as a Fargate task on AWS ECS with auto-scaling, health checks, and zero-downtime updates.

Deploy via Console

The easiest way to deploy is through the Hikigai Console. Navigate to your project, click New App, and follow the 3-step wizard:

  1. Source — Choose GitHub and select your repository and branch, or upload a ZIP file.
  2. Configure — Review the auto-detected framework, set environment variables, choose CPU/memory resources, and configure the number of instances.
  3. Deploy — Click deploy and watch real-time streaming build logs. Once complete, your app is live.

Deploy via API

You can also create and deploy apps programmatically using the Platform API:

# Step 1: Create an app in your project
curl -X POST "https://api.hikigai.ai/v1/projects/{project_id}/apps" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "display_name": "My Healthcare Portal",
    "framework": "nextjs"
  }'
# Step 2: Connect a GitHub repository
curl -X POST "https://api.hikigai.ai/v1/projects/{project_id}/apps/{app_id}/github/connect" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "installation_id": "136386010",
    "repo_full_name": "your-org/your-repo",
    "branch": "main"
  }'
# Step 3: Trigger a deployment
curl -X POST "https://api.hikigai.ai/v1/projects/{project_id}/apps/{app_id}/deploy" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "cpu": 256,
    "memory": 512,
    "min_instances": 1,
    "env_vars": {
      "NODE_ENV": "production"
    }
  }'

Supported Frameworks

The platform auto-detects your framework from the repository structure and generates an optimized, multi-stage Dockerfile tailored to it:

FrameworkDetectionBase ImageBuild Command
Next.jsnext.config.* in rootnode:20-alpinenpm run build (standalone)
React (Vite)vite.config.* in rootnode:20-alpine + nginxnpm run build → static serve
Express / Node.jsserver.js or index.jsnode:20-alpinenpm install → node start
FastAPImain.py + fastapi in requirementspython:3.11-slimpip install → uvicorn
Flaskapp.py + flask in requirementspython:3.11-slimpip install → gunicorn
Djangomanage.py in rootpython:3.11-slimpip install → gunicorn
Static HTMLindex.html in rootnginx:alpineCopy files → nginx serve

Build Pipeline

When you trigger a deployment, the following pipeline executes:

1
Source ResolutionClone the repository at the specified branch and commit SHA.
2
Framework DetectionAnalyze package.json, requirements.txt, and project structure to identify the framework.
3
Dockerfile GenerationRender a multi-stage Dockerfile from a framework-specific Jinja2 template with optimized caching layers.
4
Docker BuildAWS CodeBuild builds the Docker image with layer caching for faster subsequent builds.
5
Image PushThe built image is tagged and pushed to a private AWS ECR repository.
6
ECS Task RegistrationA new ECS task definition is registered with the image URI, CPU/memory, and environment variables.
7
Service DeploymentThe ECS Fargate service is created or updated with the new task definition. Rolling deployment ensures zero downtime.
8
Health CheckECS monitors container health. Once the task is running and healthy, the deployment is marked as successful.

Real-time Build Logs

Monitor every phase of your build with server-sent event (SSE) streaming. Connect to the log stream endpoint to receive live updates in your terminal or application:

# Stream build logs in real time
curl -N "https://api.hikigai.ai/v1/projects/{project_id}/apps/{app_id}/deployments/{deploy_id}/logs/stream" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Response (SSE):
# data: {"phase": "BUILD", "message": "Step 1/8: FROM node:20-alpine AS base"}
# data: {"phase": "BUILD", "message": "Step 2/8: WORKDIR /app"}
# data: {"phase": "BUILD", "message": "Step 3/8: COPY package*.json ./"}
# data: {"phase": "DEPLOY", "message": "Task registered: arn:aws:ecs:..."}
# data: {"phase": "DEPLOY", "message": "Service updated, waiting for stability..."}
# data: {"phase": "COMPLETE", "message": "Deployment successful"}

Auto-Deploy on Git Push

Once your GitHub repository is connected, Hikigai can automatically redeploy your app whenever you push to the configured branch. The GitHub App webhook triggers a new build with the latest commit SHA, so your production app stays in sync with your code.

Automatic deployments use the same build settings (CPU, memory, env vars) from your most recent manual deployment. You can update these settings at any time from the Console.

App Environment

Every deployed app receives a set of platform environment variables that are automatically injected into the container at runtime. These let your app interact with Hikigai services without any manual configuration.

Auto-Injected Variables

VariableDescriptionExample
HIKIGAI_API_KEYDeploy-scoped API key for calling platform serviceshk_deploy_abc123...
HIKIGAI_PROJECT_IDThe project this app belongs toproj_7f8a9b...
HIKIGAI_PLATFORM_URLBase URL for platform API callshttps://api.hikigai.ai
HIKIGAI_APP_IDUnique identifier for this appapp_3d4e5f...
PORTPort your app should listen on3000

Using Platform Variables in Your App

Your deployed app can call any Hikigai agent using the auto-injected credentials. No API key management needed:

// Next.js API route — calling a Hikigai agent
export async function POST(req) {
  const { clinical_note } = await req.json();

  // These environment variables are auto-injected by the platform
  const response = await fetch(
    `${process.env.HIKIGAI_PLATFORM_URL}/v1/agents/icd-10-coder/invoke`,
    {
      method: "POST",
      headers: {
        "Authorization": `Bearer ${process.env.HIKIGAI_API_KEY}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({ message: clinical_note }),
    }
  );

  return Response.json(await response.json());
}
# FastAPI endpoint — calling a Hikigai agent
import os, httpx

@app.post("/analyze")
async def analyze(note: str):
    async with httpx.AsyncClient() as client:
        resp = await client.post(
            f"{os.environ['HIKIGAI_PLATFORM_URL']}/v1/agents/icd-10-coder/invoke",
            headers={"Authorization": f"Bearer {os.environ['HIKIGAI_API_KEY']}"},
            json={"message": note},
        )
    return resp.json()

Custom Environment Variables

In addition to auto-injected variables, you can set your own environment variables during the Configure step. These are encrypted at rest and injected alongside platform variables.

Tip: Use custom environment variables for database connection strings, third-party API keys, feature flags, and any secrets your app needs. Never hard-code credentials in your repository.

MCP Servers

The Model Context Protocol (MCP) is an open standard that lets AI agents connect to external data sources and tools through a unified interface. Hikigai provides purpose-built MCP servers for the healthcare ecosystem, giving your agents real-time access to clinical data, terminology systems, and EHR platforms.

What is MCP?

MCP servers act as a bridge between your AI agents and healthcare data sources. Instead of building custom integrations for each EHR, terminology service, or clinical database, your agent connects to a standardized MCP server that handles authentication, data formatting, and compliance.

Architecture

Your AI Agent
→ MCP Protocol →
Hikigai MCP Server
→ FHIR / HL7 →
EHR / Data Source

Available Healthcare MCP Servers

Epic EHR Server

epic-ehr

FHIR R4-based access to patient demographics, encounters, conditions, medications, allergies, immunizations, procedures, and lab results from Epic EHR systems.

get_patient()get_patient_conditions()get_patient_medications()get_patient_encounters()search_patient_by_mrn()

Clinical Terminology Server

clinical-terminology

Semantic search and lookup across ICD-10-CM, CPT, SNOMED CT, LOINC, and RxNorm code systems. Supports code validation, cross-mapping, and hierarchical navigation.

lookup_icd10()search_snomed()map_code()validate_cpt()

Drug Interaction Server

drug-interactions

Real-time drug-drug and drug-allergy interaction checking powered by RxNorm and NLM DailyMed. Returns severity levels, clinical effects, and recommended alternatives.

check_interactions()check_allergy_conflict()get_alternatives()

Lab Results Server

lab-results

Structured access to lab results with LOINC coding, reference ranges, critical value flagging, and trend analysis across patient encounters.

get_lab_results()get_trends()check_critical_values()

Connecting Agents to MCP Servers

When deploying an agent, specify which MCP servers it should connect to. The platform handles authentication and connection management:

from hikigai.agentsdk import AgentBuilder

agent = AgentBuilder("clinical-note-coder") \
    .instruction("Analyze clinical notes and suggest ICD-10 codes") \
    .model("gemini-2.0-flash") \
    .mcp_servers(["epic-ehr", "clinical-terminology"]) \
    .build()

# The agent can now:
# - Pull patient context from Epic EHR
# - Look up and validate ICD-10 codes
# - Cross-reference SNOMED CT mappings
# Invoking an MCP-connected agent
from hikigai.appsdk import AppClient

client = AppClient()
result = client.agent("clinical-note-coder").invoke(
    clinical_note="Patient presents with acute chest pain...",
    context={
        "patient_mrn": "MRN12345",     # Agent uses Epic EHR MCP to pull patient data
        "encounter_id": "ENC-67890",   # Agent fetches encounter context automatically
    }
)

print(result.codes)
# [{"code": "R07.9", "description": "Chest pain, unspecified", "confidence": 0.94}]
HIPAA Compliance: All MCP server connections are encrypted in transit (TLS 1.3), scoped to your project, and audited. PHI never leaves the platform boundary. MCP servers authenticate with your organization's EHR credentials configured in Project Settings.

Platform API Reference

MethodEndpointDescription
GET/v1/agentsList all agents
GET/v1/agents/:idGet agent details
POST/v1/agents/deploy/configDeploy with config
POST/v1/agents/deploy/codeDeploy with code
POST/v1/agents/:slug/invokeInvoke agent
DELETE/v1/agents/:idDelete agent

App Deployment Endpoints

MethodEndpointDescription
POST/v1/projects/:id/appsCreate a new app
GET/v1/projects/:id/appsList all apps in a project
GET/v1/projects/:id/apps/:app_idGet app details
POST/v1/projects/:id/apps/:app_id/github/connectConnect GitHub repository
POST/v1/projects/:id/apps/:app_id/deployTrigger deployment
GET/v1/projects/:id/apps/:app_id/deploymentsList deployment history
GET/v1/.../deployments/:deploy_id/logs/streamStream build logs (SSE)
POST/v1/projects/:id/apps/:app_id/stopStop a running app
POST/v1/projects/:id/apps/:app_id/restartRestart a stopped app
DELETE/v1/projects/:id/apps/:app_idDelete app and AWS resources

SDKs

Official SDKs for popular languages:

Py

Python

pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ hikigai-agentsdk hikigai-appsdk hikigai-core --upgrade

Available
JS

JavaScript

npm install hikigai

Coming Soon
Go

Go

go get hikigai

Coming Soon

Rate Limits

Rate limits vary by plan. Exceeding limits returns HTTP 429.

PlanRequests/minRequests/day
Free10100
Pro10010,000
EnterpriseUnlimitedUnlimited