Token导航 LogoToken导航

Agent Skill · 研究检索

olakai-create-agent(olakai 创建 Agent)

olakai-create-agent 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

olakai-create-agent 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描有未通过项,按安装量在研究检索类的 73,675 个 Skill 里排第 66,030。

总安装 269周安装 11GitHub Stars 公开资料未说明下载 87核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:olakai-create-agent(olakai 创建 Agent)
来源仓库:https://github.com/olakai-ai/olakai-skills
仓库路径:skills/olakai-create-agent
安装命令:
npx skills add https://github.com/olakai-ai/olakai-skills --skill olakai-create-agent
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/olakai-ai/olakai-skills --skill olakai-create-agent

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

olakai-create-agent 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。适用于关键词搜索、任务场景匹配或来源线索梳理等研究检索场景。通过 npx skills add 命令从 GitHub 仓库安装,需确认权限与维护状态。

使用前建议核实是否会触发联网、命令执行或文件读写操作。可结合原始 README 和仓库路径进一步验证具体用法与边界。

来源仓库内路径:skills/olakai-create-agent

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/olakai-ai/olakai-skills --skill olakai-create-…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

olakai-create-agent 怎么安装?

在终端执行 npx skills add https://github.com/olakai-ai/olakai-skills --skill olakai-create-agent。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

olakai-create-agent 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

olakai-create-agent 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

olakai-create-agent 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

olakai-create-agent 用的人多吗?

公开数据是累计安装 269 次,近一周安装 11 次,下载 87 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

olakai-create-agent 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
olakai-create-agent

olakai 创建 Agent · 本页

269—接触敏感数据MIT未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Create AI Agent with Olakai Monitoring

This skill guides you through creating a new AI agent that is fully integrated with Olakai for monitoring, analytics, and governance.

Prerequisites

Before starting, ensure:

  1. Olakai CLI installed: npm install -g olakai-cli
  2. CLI authenticated: olakai login
  3. API key for SDK (generated per-agent via CLI - see Step 2.1)

Why Custom KPIs Are Essential

Olakai's core value is tracking business-specific KPIs for your AI agents. Without KPIs, you're just logging events - not gaining actionable insights.

What you can measure with KPIs:

  • Business outcomes (items processed, success rates, revenue impact)
  • Operational metrics (step counts, retry rates, execution time)
  • Quality indicators (error rates, user satisfaction signals)

Without KPIs configured:

  • ❌ No dashboard metrics beyond basic token counts
  • ❌ No aggregated performance views
  • ❌ No alerting thresholds
  • ❌ No ROI calculations
⚠️ Every agent should have 2-4 KPIs that answer: "How do I know this agent is performing well?"
⚠️ KPIs created here belong to this specific agent only. If you later create additional agents, each one needs its own KPI definitions — KPIs cannot be shared or reused across agents.

Understanding the customData → KPI Pipeline

Before diving into implementation, understand how data flows through Olakai:

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

How It Works

  1. customData (SDK): Raw JSON you send with each event
  2. CustomDataConfig (Platform): Schema defining which fields are processed
  3. Context Variables: CustomDataConfig fields become available for formulas
  4. KPI Formula: Expression that computes a metric (e.g., SuccessRate * 100)
  5. kpiData (Response): Computed KPI values returned with each event

Critical Rules

RuleConsequence
Only CustomDataConfig fields become variablesUnregistered customData fields are NOT usable in KPIs
Formula evaluation is case-insensitivestepCount, STEPCOUNT, StepCount all work in formulas
NUMBER configs need numeric valuesDon't send "5" (string), send 5 (number)
KPIs are unique per agentEach KPI belongs to exactly one agent — create separately for each, even with identical formulas

Built-in Context Variables (Always Available)

VariableTypeDescription
PromptstringThe prompt text sent to the LLM
ResponsestringThe LLM response text
Documents countnumberNumber of attached documents
PII detectedbooleanWhether PII was detected
PHI detectedbooleanWhether PHI was detected
CODE detectedbooleanWhether code was detected
SECRET detectedbooleanWhether secrets were detected

Step 1: Design the Agent Architecture

1.1 Determine Agent Type

Agentic AI (Multi-step autonomous workflows):

  • Research agents, document processors, data pipelines
  • Track as SINGLE events aggregating all internal LLM calls
  • Focus on workflow-level metrics (total tokens, total time, success/failure)

Assistive AI (Interactive chatbots/copilots):

  • Customer support bots, coding assistants, Q&A systems
  • Track EACH interaction as separate events
  • Focus on conversation-level metrics (per-message tokens, response quality)

1.2 Design Your Metrics Schema (CRITICAL)

Design your metrics BEFORE writing any SDK code. This ensures only meaningful data is sent and tracked.

Step A: Identify Business Questions

What do stakeholders need to know about this agent?

  • "How many items does it process per run?"
  • "What's the success/failure rate?"
  • "How efficient is each execution?"
Step B: Map Questions to Metrics
Business QuestionField NameTypeKPI FormulaAggregation
ThroughputItemsProcessedNUMBERItemsProcessedSUM
ReliabilitySuccessRateNUMBERSuccessRate * 100AVERAGE
Error countSuccessRateNUMBERIF(SuccessRate < 1, 1, 0)SUM
Workflow IDExecutionIdSTRING(for filtering only)-
Step C: Plan Your customData Structure
// ONLY include fields you'll register as CustomDataConfigs
customData: {
  // Business metrics (will become KPIs)
  ItemsProcessed: number,  // Count of items handled
  SuccessRate: number,     // 0-1 success ratio

  // Performance metrics (will become KPIs)
  StepCount: number,       // Number of workflow steps

  // Identification (for filtering, not KPIs)
  ExecutionId: string,     // Correlation ID
}
⚠️ IMPORTANT: Only include fields you will register as CustomDataConfigs. Unregistered fields are stored but cannot be used in KPIs - they're effectively wasted data.

What NOT to Include in customData

The Olakai platform automatically tracks these fields - do NOT duplicate them in customData:

Already TrackedWhereDon't Send As customData
Session IDMain payload❌ sessionId
Agent IDAPI key association❌ agentId
User emailuserEmail parameter❌ email, userEmail
TimestampEvent metadata❌ timestamp, createdAt
Request timerequestTime parameter❌ duration, latency
Token counttokens parameter❌ tokenCount, totalTokens
ModelAuto-detected❌ model, modelName
ProviderWrapped client config❌ provider

customData is ONLY for:

  1. KPI variables - Fields you'll use in formula calculations (e.g., ItemsProcessed, SuccessRate)
  2. Tagging/filtering - Fields you'll filter by in queries (e.g., Department, ProjectId)

❌ BAD: Sending redundant data

customData: {
  sessionId: session.id,       // ❌ Already tracked
  agentId: agentConfig.id,     // ❌ Already tracked
  userEmail: user.email,       // ❌ Pass via userEmail param instead
  timestamp: Date.now(),       // ❌ Already tracked
  ItemsProcessed: 10,          // ✅ Needed for KPI
}

✅ GOOD: Only KPI-relevant data

customData: {
  ItemsProcessed: 10,          // ✅ Used in KPI formula
  SuccessRate: 1.0,            // ✅ Used in KPI formula
  ExecutionId: uuid,           // ✅ For correlation/filtering
}

Step 2: Configure Olakai Platform

2.1 Create a Workflow (Required)

⚠️ Every agent MUST belong to a workflow, even if it's the only agent in that workflow.

Why workflows are required:

  • Enable future multi-agent expansion without restructuring
  • Provide workflow-level aggregation for KPIs
  • Establish proper organizational hierarchy
  • Support workflow-level governance policies
# Create the workflow first
olakai workflows create --name "Your Workflow Name" --json

# Save the workflow ID for agent association
# Output: { "id": "wfl_xxx...", "name": "Your Workflow Name" }

2.2 Create the Agent in Olakai

# Create the agent associated with the workflow
olakai agents create \
  --name "Your Agent Name" \
  --description "What this agent does" \
  --workflow WORKFLOW_ID \
  --with-api-key \
  --json

# Returns agent details including apiKey for SDK use:
# {
#   "id": "cmkbteqn501kyjy4yu6p6xrrx",
#   "name": "Your Agent Name",
#   "workflowId": "wfl_xxx...",
#   "apiKey": "sk_agent_xxxxx..."   <-- Use this in your SDK
# }

# To retrieve an existing agent's API key:
olakai agents get AGENT_ID --json | jq '.apiKey'

Workflow → Agent Hierarchy:

Workflow: "Customer Support Pipeline"
├── Agent: "Ticket Classifier"
├── Agent: "Response Generator"
└── Agent: "Quality Checker"

Workflow: "Document Processing"
└── Agent: "Document Summarizer"  ← Even single agents need a workflow

2.3 Create Custom Data Configurations (BEFORE Writing SDK Code)

⚠️ This step MUST be completed before Step 3 (SDK Integration). Only fields registered here can be used in KPI formulas. Design the schema first, then code to it.
⚠️ ONLY create configs for data you'll use in KPIs or for filtering. Don't create configs for data already tracked (sessionId, timestamps, tokens) or "nice to have" fields. Each config should answer: "Will I use this in a KPI formula?" or "Will I filter/group by this?"

For each custom metric from Step 1.2, create a CustomDataConfig:

# Replace YOUR_AGENT_ID with the actual agent ID from step 2.1

# For numeric metrics (can be used in KPI calculations)
olakai custom-data create --agent-id YOUR_AGENT_ID --name "ItemsProcessed" --type NUMBER --description "Count of items processed per run"
olakai custom-data create --agent-id YOUR_AGENT_ID --name "SuccessRate" --type NUMBER --description "Success ratio 0-1"
olakai custom-data create --agent-id YOUR_AGENT_ID --name "StepCount" --type NUMBER --description "Number of workflow steps executed"

# For string metrics (for filtering/grouping, not calculations)
olakai custom-data create --agent-id YOUR_AGENT_ID --name "ExecutionId" --type STRING --description "Correlation ID for the execution"

# Verify all configs are created for this agent
olakai custom-data list --agent-id YOUR_AGENT_ID

What this enables:

  • ✅ These field names become context variables in KPI formulas for this agent
  • ✅ Values sent in SDK customData with these names are processed
  • ❌ Any customData field NOT listed here is ignored for KPI purposes

2.4 Create KPI Definitions

⚠️ Both CustomDataConfigs and KPIs are created for THIS agent only. Each config is bound to one agent. If multiple agents need the same fields, create the CustomDataConfig and KPI separately for each agent.
Quick Start with Templates

Instead of writing KPI formulas from scratch, you can use predefined classifier templates via the CLI or the dashboard UI.

List available templates:

olakai kpis templates

Create a classifier KPI from a template:

# Create a classifier KPI using a pre-built template
olakai kpis create --name "User Satisfaction" \
  --calculator-id classifier --template-id sentiment_scorer \
  --scope CHAT --agent-id $AGENT_ID

# Create a time-saved estimator
olakai kpis create --name "Time Saved" \
  --calculator-id classifier --template-id time_saved_estimator \
  --scope CHAT --agent-id $AGENT_ID

Or via the dashboard UI:

  1. Navigate to your agent's KPI settings in the Olakai dashboard
  2. Click Create KPI → Use Template
  3. Choose a template:

- Sentiment Scorer — Analyzes session sentiment on a configurable scale - Time Saved Estimator — Estimates minutes saved vs. manual execution

  1. Templates work at the CHAT scope — they analyze the entire conversation/workflow run

Templates are a great starting point. You can always add custom formula-based KPIs alongside them.

Custom Formula KPIs

Define KPIs that use your custom data:

# Simple variable KPIs
olakai kpis create \
  --name "Items Processed" \
  --agent-id YOUR_AGENT_ID \
  --calculator-id formula \
  --formula "ItemsProcessed" \
  --unit "items" \
  --aggregation SUM

# Calculated KPIs
olakai kpis create \
  --name "Success Rate" \
  --agent-id YOUR_AGENT_ID \
  --calculator-id formula \
  --formula "SuccessRate * 100" \
  --unit "%" \
  --aggregation AVERAGE

# Conditional KPIs
olakai kpis create \
  --name "Error Count" \
  --agent-id YOUR_AGENT_ID \
  --calculator-id formula \
  --formula "IF(SuccessRate < 1, 1, 0)" \
  --unit "errors" \
  --aggregation SUM

# Validate formulas before creating
olakai kpis validate --formula "ItemsProcessed" --agent-id YOUR_AGENT_ID

Step 3: Implement SDK Integration

3.1 TypeScript Implementation (Recommended)

Install dependencies:

npm install @olakai/sdk openai

Basic wrapped client setup:

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

// Initialize Olakai
const olakai = new OlakaiSDK({
  apiKey: process.env.OLAKAI_API_KEY!,
  debug: process.env.NODE_ENV === "development",
});
await olakai.init();

// Wrap your LLM client
const openai = olakai.wrap(
  new OpenAI({ apiKey: process.env.OPENAI_API_KEY }),
  {
    provider: "openai",
    defaultContext: {
      task: "Your Task Category", // e.g., "Data Processing & Analysis"
    },
  }
);

// Use wrapped client - monitoring happens automatically
const response = await openai.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: userPrompt }],
});

Agentic workflow with manual event tracking:

taskExecutionId — Cross-Agent Task Correlation Generate ONE taskExecutionId per task and share it across all agents in a multi-agent workflow. This is how Olakai links work done by different agents into a single logical task for analytics. Without it, each agent's events are isolated by session and you lose visibility into the full end-to-end task. The orchestrator should generate the ID and pass it to every agent it invokes.
async function runAgent(input: string): Promise<string> {
  const startTime = Date.now();
  const executionId = crypto.randomUUID();
  const taskExecutionId = crypto.randomUUID(); // Share across all agents in a multi-agent workflow
  let totalTokens = 0;
  let stepCount = 0;
  let itemsProcessed = 0;

  try {
    // Step 1: Planning
    stepCount++;
    const plan = await openai.chat.completions.create({
      model: "gpt-4o",
      messages: [{ role: "user", content: `Plan: ${input}` }],
    });
    totalTokens += plan.usage?.total_tokens ?? 0;

    // Step 2: Execution (example: process multiple items)
    const items = parseItems(plan.choices[0].message.content);
    for (const item of items) {
      stepCount++;
      const result = await openai.chat.completions.create({
        model: "gpt-4o",
        messages: [{ role: "user", content: `Process: ${item}` }],
      });
      totalTokens += result.usage?.total_tokens ?? 0;
      itemsProcessed++;
    }

    // Step 3: Summarize
    stepCount++;
    const summary = await openai.chat.completions.create({
      model: "gpt-4o",
      messages: [{ role: "user", content: "Summarize results" }],
    });
    totalTokens += summary.usage?.total_tokens ?? 0;

    const finalResponse = summary.choices[0].message.content ?? "";

    // Track the complete workflow as a single event
    // ⚠️ IMPORTANT: Only send fields that have CustomDataConfigs (from Step 2.2)
    olakai.event({
      prompt: input,
      response: finalResponse,
      tokens: totalTokens,
      requestTime: Date.now() - startTime,
      taskExecutionId,  // Links events across agents in the same task
      task: "Data Processing & Analysis",
      customData: {
        // Only include fields registered in Step 2.2
        ExecutionId: executionId,
        StepCount: stepCount,
        ItemsProcessed: itemsProcessed,
        SuccessRate: 1.0,
        // ❌ DON'T add unregistered fields - they can't be used in KPIs
      },
    });

    return finalResponse;
  } catch (error) {
    // Track failed execution - same fields, different values
    olakai.event({
      prompt: input,
      response: `Error: ${error instanceof Error ? error.message : "Unknown"}`,
      tokens: totalTokens,
      requestTime: Date.now() - startTime,
      taskExecutionId,
      task: "Data Processing & Analysis",
      customData: {
        ExecutionId: executionId,
        StepCount: stepCount,
        ItemsProcessed: itemsProcessed,
        SuccessRate: 0,  // 0 indicates failure
      },
    });
    throw error;
  }
}

3.2 Python Implementation

Install dependencies:

pip install olakai-sdk openai

Auto-instrumentation setup:

import os
from olakaisdk import olakai_config, instrument_openai, olakai_context, olakai_event, OlakaiEventParams
from openai import OpenAI

# Initialize Olakai
olakai_config(os.getenv("OLAKAI_API_KEY"))
instrument_openai()

# Create OpenAI client (automatically instrumented)
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))

# For assistive AI - use context manager
with olakai_context(userEmail="user@example.com", task="Customer Support"):
    response = client.chat.completions.create(
        model="gpt-4",
        messages=[{"role": "user", "content": user_message}]
    )

Manual event tracking for agentic workflows:

import time
import uuid

def run_agent(input_text: str) -> str:
    start_time = time.time()
    execution_id = str(uuid.uuid4())
    task_execution_id = str(uuid.uuid4())  # Share across all agents in a multi-agent workflow
    total_tokens = 0
    step_count = 0
    items_processed = 0

    try:
        # Your workflow steps here...
        step_count += 1
        response = client.chat.completions.create(
            model="gpt-4",
            messages=[{"role": "user", "content": input_text}]
        )
        total_tokens += response.usage.total_tokens

        final_response = response.choices[0].message.content

        # Track successful execution
        # ⚠️ Only send fields registered as CustomDataConfigs
        olakai_event(OlakaiEventParams(
            prompt=input_text,
            response=final_response,
            tokens=total_tokens,
            requestTime=int((time.time() - start_time) * 1000),
            taskExecutionId=task_execution_id,
            task="Data Processing & Analysis",
            customData={
                "ExecutionId": execution_id,
                "StepCount": step_count,
                "ItemsProcessed": items_processed,
                "SuccessRate": 1.0,
            }
        ))

        return final_response

    except Exception as e:
        # Track failed execution - same fields, different values
        olakai_event(OlakaiEventParams(
            prompt=input_text,
            response=f"Error: {str(e)}",
            tokens=total_tokens,
            requestTime=int((time.time() - start_time) * 1000),
            taskExecutionId=task_execution_id,
            task="Data Processing & Analysis",
            customData={
                "ExecutionId": execution_id,
                "StepCount": step_count,
                "ItemsProcessed": items_processed,
                "SuccessRate": 0,  # 0 indicates failure
            }
        ))
        raise

3.3 REST API Direct Integration

For other languages or custom integrations:

# ⚠️ customData fields must match registered CustomDataConfigs exactly
curl -X POST "https://app.olakai.ai/api/monitoring/prompt" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "prompt": "User input here",
    "response": "Agent response here",
    "app": "your-agent-name",
    "task": "Data Processing & Analysis",
    "tokens": 1500,
    "requestTime": 5000,
    "customData": {
      "ExecutionId": "abc-123",
      "StepCount": 5,
      "ItemsProcessed": 10,
      "SuccessRate": 1.0
    }
  }'

Step 4: Test-Validate-Iterate Cycle

CRITICAL: Always validate your implementation by running a test and inspecting the actual event data. Do not assume configuration is correct - verify it.

4.1 Run Your Agent (Generate Test Event)

Execute your agent with test data to generate at least one monitoring event:

// Run your agent
const result = await runAgent("Test input for validation");
console.log("Agent completed, checking Olakai...");

4.2 Fetch and Inspect the Event

# List recent activity for your agent
olakai activity list --agent-id YOUR_AGENT_ID --limit 1 --json

# Get the full event details including customData and kpiData
olakai activity get EVENT_ID --json

4.3 Validate Each Component

Check customData is present and correct:

olakai activity get EVENT_ID --json | jq '.customData'

Expected output:

{
  "ExecutionId": "abc-123",
  "StepCount": 5,
  "ItemsProcessed": 10,
  "SuccessRate": 1.0
}

If fields are missing: SDK isn't sending them. Check your customData object in the event call.

Check KPIs are numeric (not strings):

olakai activity get EVENT_ID --json | jq '.kpiData'

CORRECT - numeric values:

{
  "Items Processed": 10,
  "Success Rate": 100
}

WRONG - string values (indicates broken formula):

{
  "Items Processed": "itemsProcessed",
  "Success Rate": "SuccessRate"
}

If KPIs show strings: The formula is stored incorrectly. Fix with:

olakai kpis update KPI_ID --formula "YourVariable"

Check KPIs show values (not null):

If KPIs show null:

  1. Verify customData contains the field: jq '.customData.YourField'
  2. Verify CustomDataConfig exists: olakai custom-data list
  3. Verify field name case matches exactly (case-sensitive!)

4.4 Iterate Until Correct

Repeat the cycle until all validations pass:

┌─────────────────────────────────────────────────────────┐
│  1. Run agent (generate event)                          │
│                    ↓                                    │
│  2. Fetch event: olakai activity get ID --json          │
│                    ↓                                    │
│  3. Check customData present?                           │
│     NO → Fix SDK code, goto 1                           │
│                    ↓                                    │
│  4. Check kpiData numeric (not strings)?                │
│     NO → Fix formula: olakai kpis update ID --formula   │
│          goto 1                                         │
│                    ↓                                    │
│  5. Check kpiData not null?                             │
│     NO → Create CustomDataConfig or fix field name      │
│          goto 1                                         │
│                    ↓                                    │
│  ✅ All validations pass - implementation complete      │
└─────────────────────────────────────────────────────────┘

4.5 Example Validation Session

# 1. Run your agent (generates event)
$ node my-agent.js "Test task"
Agent completed successfully

# 2. Get the latest event
$ olakai activity list --agent-id cmkxxx --limit 1 --json | jq '.prompts[0].id'
"cmkeyyy"

# 3. Inspect the event
$ olakai activity get cmkeyyy --json | jq '{customData, kpiData}'
{
  "customData": {
    "StepCount": 3,
    "ItemsProcessed": 5,
    "SuccessRate": 1
  },
  "kpiData": {
    "Steps Executed": 3,        # ✅ Numeric
    "Items Processed": 5,       # ✅ Numeric
    "Success Rate": 100         # ✅ Numeric (formula: SuccessRate * 100)
  }
}

# ✅ All good! Implementation is correct.

Step 5: Production Checklist

Before deploying to production:

  • API key stored securely in environment variables
  • Error handling wraps all LLM calls
  • Failed executions still report events (with successRate: 0)
  • All custom data fields have corresponding CustomDataConfig entries
  • KPI formulas validated and showing numeric values (not strings)
  • SDK configured with appropriate retries and timeouts
  • Sensitive data redaction enabled if needed

KPI Formula Reference

Supported Operators

CategoryOperators
Arithmetic+, -, *, /
Comparison<, <=, =, <>, >=, >
LogicalAND, OR, NOT
ConditionalIF(condition, true_val, false_val), MAP(value, match1, out1, default)
MathABS, MAX, MIN, AVERAGE, TRUNC
Null handlingISNA(value), ISDEFINED(value), NA()

Common Formula Patterns

# Simple variable passthrough
--formula "ItemsProcessed"

# Percentage conversion (0-1 to 0-100)
--formula "SuccessRate * 100"

# Conditional counting (count failures)
--formula "IF(SuccessRate < 1, 1, 0)"

# Boolean to number conversion
--formula "IF(PII detected, 1, 0)"

# Null-safe with default value
--formula "IF(ISDEFINED(MyField), MyField, 0)"

# Compound conditions
--formula "IF(AND(StepCount > 5, SuccessRate < 0.9), 1, 0)"

Aggregation Types

AggregationUse ForExample
SUMTotals, countsTotal items processed across all runs
AVERAGERates, percentagesAverage success rate

Task Categories Reference

Use these predefined task categories for the task field:

CategoryExample Subtasks
Research & Intelligencecompetitive intelligence, market research, legal research
Data Processing & Analysisdata extraction, statistical analysis, trend identification
Content Developmentblog writing, technical documentation, proposal writing
Content Refinementediting, proofreading, grammar correction
Customer Experiencecomplaint resolution, ticket triage, FAQ development
Software Developmentcode generation, code review, debugging
Strategic Planningroadmap development, scenario planning

Quick Reference

# CLI Commands
olakai login                           # Authenticate
olakai agents create --name "Name"     # Create agent
olakai custom-data create --agent-id ID --name X --type NUMBER  # Create custom field
olakai kpis create --formula "X" --agent-id ID    # Create KPI
olakai activity list --agent-id ID     # View events

# SDK Initialization (TypeScript)
const olakai = new OlakaiSDK({ apiKey: process.env.OLAKAI_API_KEY });
await olakai.init();
const openai = olakai.wrap(new OpenAI({ apiKey }), { provider: "openai" });

# SDK Initialization (Python)
olakai_config(os.getenv("OLAKAI_API_KEY"))
instrument_openai()

平台分布

Claude Code

29.23%
按下载量换算25

Gemini CLI

23.53%
按下载量换算20

Cursor

18.34%
按下载量换算16

trae

13.06%
按下载量换算11

Antigravity

6.75%
按下载量换算6

windsurf

3.48%
按下载量换算3

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills