Integrate
Add Olakai monitoring to existing AI code, wrap your LLM client, configure custom...
Install
npx skills add andrewyng/context-hub --skill integrate -g -a claude-code -y- Repository
- andrewyng/context-hub14k
- Category
- AI and agents
- Updated
- 5mo ago
- License
- MIT
- Context cost
- Mediumabout 3,000 tokens
- Runs scripts
- No, instructions only
What it does
Add Olakai monitoring to existing AI code, wrap your LLM client, configure custom KPIs, and validate the integration end-to-end
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

