Aller au contenu
Skillpedia
Agents14k · #11273

integrate

Ce qu’il fait

Cette compétence ajoute la supervision Olakai à un agent IA ou une application LLM qui fonctionne déjà. Elle s'adresse aux développeurs qui veulent suivre l'utilisation et les résultats métier de leurs fonctions IA.

Quand l’utiliser

  • ✓Quand vous avez une application IA fonctionnelle et voulez suivre ses performances.
  • ✓Quand vous voulez définir des KPI personnalisés, comme le nombre d'éléments traités ou les taux de réussite.
  • ✓Quand vous devez vérifier que la supervision fonctionne de bout en bout.

Lien du skill

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

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/andrewyng/context-hub/blob/main/content/olakai/skills/integrate/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Je veux ajouter la supervision Olakai à mon chatbot OpenAI existant et configurer deux KPI.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'agent enveloppe le client LLM avec le SDK Olakai, configure quelques KPI pour cet agent et lance une vérification pour confirmer que les données arrivent. Il utilise l'interface en ligne de commande Olakai pour la configuration.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis 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

Questions fréquentes

Combien de KPI faut-il configurer ?

La compétence suggère de prévoir au moins deux à quatre KPI par agent.

Les KPI peuvent-ils être partagés entre agents ?

Non. La compétence indique que chaque agent a besoin de ses propres définitions de KPI.

De quoi ai-je besoin avant de commencer ?

D'une connexion à l'interface Olakai, d'une clé API d'agent, et de Node.js 18 ou Python 3.7 ou plus récent.

Détails

Description originale de l’auteur

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

Popularité

Étoiles GitHub
14k
Position au classement
#11273
Licence
MIT
Mis à jour
31/05/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires