跳到正文
Skillpedia
智能体14k · #11274

new-project

它能做什么

这项技能指导创建一个从一开始就连接到 Olakai 的新 AI 智能体项目。适合希望在上线前就具备分析和管控能力的构建者。

适用场景

  • ✓当你开始一个新的 AI 智能体,并希望从第一天起就有监控的时候。
  • ✓当你想获得 Olakai SDK 和 CLI 的引导式设置的时候。
  • ✓当你需要定义能体现智能体表现的 KPI 的时候。

技能链接

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

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/andrewyng/context-hub/blob/main/content/olakai/skills/new-project/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我想启动一个带有 Olakai 监控的新 AI 智能体项目,并定义它的 KPI。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会搭建项目、添加 Olakai SDK、为智能体创建密钥、定义 KPI,并测试结果。它会按固定的顺序遵循该技能中的步骤。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Build a New AI Agent Project with Olakai

This skill guides you through creating a new AI agent that is fully integrated with Olakai for analytics, KPI tracking, 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.2)

Why Custom KPIs Are Essential

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

What you can measure with KPIs:

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

Without KPIs configured:

  • No dashboard KPIs 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 to 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 value (e.g., SuccessRate * 100)
  5. kpiData (Response): Computed KPI values returned with each event

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)
KPIs are unique per agent Each KPI belongs to exactly one agent — create separately for each

Built-in Context Variables (Always Available)

Variable Type Description
Prompt string The prompt text sent to the LLM
Response string The LLM response text
Documents count number Number of attached documents
PII detected boolean Whether PII was detected
PHI detected boolean Whether PHI was detected
CODE detected boolean Whether code was detected
SECRET detected boolean Whether 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 KPIs (total tokens, total time, success/failure)

Assistive AI (Interactive chatbots/copilots):

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

1.2 Design Your KPI Schema (CRITICAL)

Design your KPIs 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 Data Fields

Business Question Field Name Type KPI Formula Aggregation
Throughput ItemsProcessed NUMBER ItemsProcessed SUM
Reliability SuccessRate NUMBER SuccessRate * 100 AVERAGE
Error count SuccessRate NUMBER IF(SuccessRate < 1, 1, 0) SUM
Correlation ExecutionId STRING (for filtering only) -

Step C: Plan Your customData Structure

// ONLY include fields you'll register as CustomDataConfigs
customData: {
  // Business KPIs
  ItemsProcessed: number,  // Count of items handled
  SuccessRate: number,     // 0-1 success ratio

  // Performance KPIs
  StepCount: number,    
常见问题

开始之前需要先安装 CLI 吗?

需要。该技能要求已安装 Olakai CLI,并且你已登录。

这项技能中的 KPI 是什么?

KPI 是一项业务指标,例如处理的条目数、成功率或重试率,用来显示智能体的表现。

我可以把同样的 KPI 用于另一个智能体吗?

不可以。KPI 属于某一个智能体,因此每个新智能体都需要自己的一套。

详情

作者的原始描述

Build a new AI agent with Olakai monitoring from scratch — project setup, SDK integration, KPI configuration, and end-to-end validation

repo: andrewyng/context-hub

热度

GitHub 星标
14k
排名
#11274
许可证
MIT
更新时间
2026/5/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能