# Integrate

Add Olakai monitoring to existing AI code, wrap your LLM client, configure custom...

- Repository: https://github.com/andrewyng/context-hub (13986 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-05-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add andrewyng/context-hub --skill integrate -g -a claude-code -y`
Codex: `npx skills add andrewyng/context-hub --skill integrate -g -a codex -y`
Cursor: `npx skills add andrewyng/context-hub --skill integrate -g -a cursor -y`
Gemini CLI: `npx skills add andrewyng/context-hub --skill integrate -g -a gemini-cli -y`

## Description

Add Olakai monitoring to existing AI code, wrap your LLM client, configure custom KPIs, and validate the integration end-to-end

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Integrate Olakai into Existing AI Code

This skill guides you through adding Olakai monitoring to an existing AI agent or LLM-powered application with minimal code changes.

For full SDK documentation, see: https://app.olakai.ai/llms.txt

## Prerequisites

- Existing working AI agent/application using OpenAI, Anthropic, or other LLM
- Olakai CLI installed and authenticated (`npm install -g olakai-cli && olakai login`)
- Olakai API key for your agent (get via CLI: `olakai agents get AGENT_ID --json | jq '.apiKey'`)
- Node.js 18+ (for TypeScript) or Python 3.7+ (for Python)

> **Note:** Each agent can have its own API key. Create one with `olakai agents create --name "Name" --with-api-key`

## Why Custom KPIs Are Essential

Adding monitoring is only the first step. **The real value of Olakai comes from tracking custom KPIs specific to your agent's business purpose.**

**Without KPIs configured:**
- Only basic token counts and request data
- No aggregated business KPIs on dashboard
- No alerting capabilities
- No ROI tracking

**With KPIs configured:**
- Custom KPIs (items processed, success rates, quality scores)
- Trend analysis and performance dashboards
- Threshold-based alerting
- Business value calculations

> **Plan to configure at least 2-4 KPIs** that answer: "How do I know this agent is performing well?"

> **KPIs are unique per agent.** If adding monitoring to an agent that needs the same KPIs as another already-configured agent, you must still create new KPI definitions for this agent. KPIs cannot be shared or reused across agents.

## Understanding the customData to KPI Pipeline

Before adding monitoring, understand how custom data flows through Olakai:

```
SDK customData → CustomDataConfig (Schema) → Context Variable → KPI Formula → kpiData
```

### Critical Rules

The rest: https://github.com/andrewyng/context-hub/blob/HEAD/content/olakai/skills/integrate/SKILL.md
