Langsung ke konten
Skillpedia
Agen14k ยท #11273

integrate

Fungsinya

Skill ini menambahkan pemantauan Olakai ke agent AI atau aplikasi LLM yang sudah berfungsi. Skill ini ditujukan untuk pengembang yang ingin melacak penggunaan dan hasil bisnis dari fitur AI mereka.

Kapan dipakai

  • โœ“Saat Anda punya aplikasi AI yang sudah berjalan dan ingin melacak kinerjanya.
  • โœ“Saat Anda ingin mengatur KPI khusus seperti jumlah item yang diproses atau tingkat keberhasilan.
  • โœ“Saat Anda perlu memastikan pemantauan bekerja dari awal sampai akhir.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/andrewyng/context-hub/blob/main/content/olakai/skills/integrate/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit โ†’

Contoh permintaan ke AI

โ€œSaya ingin menambahkan pemantauan Olakai ke chatbot OpenAI saya yang sudah ada dan mengatur dua KPI.โ€

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent membungkus klien LLM dengan SDK Olakai, menyiapkan beberapa KPI untuk agent ini, lalu menjalankan pemeriksaan untuk memastikan data masuk. Agent memakai CLI Olakai untuk penyiapannya.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

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

Rule Consequence
Only CustomDataConfig fields become variables Unregistered customData fields are NOT usable in KPIs
Formula evaluation is case-insensitive stepCount, STEPCOUNT, StepCount all work in formulas
NUMBER configs need numeric values Don't send "5" (string), send 5 (number)

IMPORTANT: The SDK accepts any JSON in customData, but only fields registered as CustomDataConfigs are processed. Unregistered fields are stored but cannot be used in KPIs.

Quick Start (5-Minute Integration)

For TypeScript/JavaScript

1. Install the SDK:

npm install @olakai/sdk

2. Add tracking after your LLM call:

Before:

import OpenAI from "openai";
const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });

const response = await openai.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: userMessage }],
});

After:

import OpenAI from "openai";
import { olakaiConfig, olakai } from "@olakai/sdk";

olakaiConfig({ apiKey: process.env.OLAKAI_API_KEY });

const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });

const response = await openai.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: userMessage }],
});

// Track the interaction (fire-and-forget)
olakai("event", "ai_activity", {
  prompt: userMessage,
  response: response.choices[0].message.content,
  tokens: response.usage?.total_tokens,
  userEmail: user.email,
  task: "Customer Experience",
});

For Python

1. Install the SDK:

pip install olakai-sdk

2. Add tracking after your LLM call:

Before:

from openai import OpenAI
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": user_message}],
)

After:

from openai import OpenAI
from olakaisdk import olakai_config, olakai, OlakaiEventParams

olakai_config(os.getenv("OLAKAI_API_KEY"))
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": user_message}],
)

# Track the interaction
olakai("event", "ai_activity", OlakaiEventParams(
    prompt=user_message,
    response=response.choices[0].message.content,
    tokens=response.usage.total_tokens,
    userEmail=user.email,
    task="Customer Experience",
))

Detailed Integration Guide

Step 1: Identify Your Integration Pattern

Pattern A: Single LLM Client You have one OpenAI/Anthropic client used throughout your app. Use the fire

Pertanyaan umum

Berapa banyak KPI yang sebaiknya saya atur?

Skill ini menyarankan merencanakan minimal dua hingga empat KPI untuk setiap agent.

Bisakah KPI dibagikan antar agent?

Tidak. Skill ini menyebutkan bahwa setiap agent membutuhkan definisi KPI sendiri.

Apa yang perlu saya siapkan sebelum memulai?

Login CLI Olakai, kunci API agent, dan Node.js 18 atau Python 3.7 ke atas.

Detail

Deskripsi asli dari pembuat

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

repo: andrewyng/context-hub

Popularitas

Bintang GitHub
14k
Peringkat
#11273
Lisensi
MIT
Diperbarui
31/5/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • โ€ฆ

Skill lain dari repositori ini

Skill serupa