new-project
Skill này làm gì
Skill này hướng dẫn tạo một dự án agent AI mới được kết nối với Olakai ngay từ đầu. Skill dành cho người xây dựng muốn có phân tích và quản trị sẵn sàng trước khi ra mắt.
Khi nào nên dùng
- ✓Khi bạn bắt đầu một agent AI mới và muốn có giám sát ngay từ ngày đầu.
- ✓Khi bạn muốn có hướng dẫn thiết lập cho SDK và CLI của Olakai.
- ✓Khi bạn cần định nghĩa các KPI cho thấy agent hoạt động tốt đến đâu.
Liên kết skill
https://github.com/andrewyng/context-hub/blob/main/content/olakai/skills/new-project/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tôi muốn bắt đầu một dự án agent AI mới với giám sát Olakai và định nghĩa các KPI của nó.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent thiết lập dự án, thêm SDK Olakai, tạo khóa cho agent, định nghĩa KPI và kiểm thử kết quả. Agent làm theo các bước trong skill theo một thứ tự cố định.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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:
- Olakai CLI installed:
npm install -g olakai-cli - CLI authenticated:
olakai login - 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
- customData (SDK): Raw JSON you send with each event
- CustomDataConfig (Platform): Schema defining which fields are processed
- Context Variables: CustomDataConfig fields become available for formulas
- KPI Formula: Expression that computes a value (e.g.,
SuccessRate * 100) - 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,
Câu hỏi thường gặp
Tôi có cần CLI trước khi bắt đầu không?
Có. Skill yêu cầu bạn đã cài đặt Olakai CLI và đã đăng nhập.
KPI trong skill này là gì?
KPI là một chỉ số kinh doanh, như số mục đã xử lý, tỷ lệ thành công hoặc tỷ lệ thử lại, cho thấy hiệu quả của agent.
Tôi có dùng lại các KPI này cho agent khác không?
Không. KPI thuộc về một agent, nên mỗi agent mới cần bộ KPI riêng.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 14k
- Vị trí xếp hạng
- #11274
- Giấy phép
- MIT
- Cập nhật
- 31/5/2026
Bình luận
- …
Thêm skill từ kho mã này
get-api-docs
14kGiúp agent của bạn tải tài liệu hiện tại cho các API và thư viện bên thứ ba trước khi viết mã, thay vì dựa vào trí nhớ cũ.
bloc-cubit
14kDạy agent của bạn cách quản lý trạng thái ứng dụng Flutter bằng Bloc hoặc Cubit, gồm khi nào chọn loại nào và thiết lập mặc định an toàn để test.
riverpod
14kDạy agent của bạn quản lý trạng thái Flutter bằng Riverpod: provider, dữ liệu bất đồng bộ và kiểm thử, với mặc định hợp lý cho từng trường hợp.
document-extraction
14kGiúp agent của bạn đọc PDF, hình ảnh và bảng tính, chuyển thành văn bản sạch và lấy các trường như tổng hóa đơn bằng dịch vụ ADE của LandingAI.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.