ขอสิทธิ์ใช้งานล่วงหน้า

กรอกชื่อพร้อมอีเมลหรือหมายเลขโทรศัพท์ แล้วเราจะติดต่อกลับพร้อมรายละเอียดการเข้าใช้งาน Tajo

รูปแบบข้อกำหนดเอเจนต์

เอเจนต์ของ Tajo ถูกกำหนดไว้ในไฟล์ markdown แต่ละไฟล์ประกอบด้วย YAML frontmatter (ตัวตน เครื่องมือ ข้อจำกัด) และเนื้อหา markdown (คำสั่ง กลยุทธ์ กฎ) รูปแบบนี้ได้รับแรงบันดาลใจจากรูปแบบเอเจนต์ระดับ production ที่ใช้ในระบบ multi-agent orchestration

โครงสร้างไฟล์

---
name: agent-name
description: What this agent does (max 160 chars)
version: 1.0.0
temperature: 0.2
max_tokens: 4096
tools:
- brevo_contacts
- brevo_email_campaign_management
- brevo_sms_campaigns
triggers:
- event: cart_abandoned
- schedule: "0 */4 * * *"
permissions:
- contacts:read
- email:send
- sms:send
---
# Agent Name
Instructions for the agent in natural language...

ฟิลด์ใน frontmatter

ฟิลด์ที่ต้องระบุ

ฟิลด์ชนิดคำอธิบาย
namestringตัวระบุที่ไม่ซ้ำกันในรูปแบบ kebab-case (เช่น cart-recovery-agent)
descriptionstringสิ่งที่เอเจนต์นี้ทำ (ไม่เกิน 160 ตัวอักษร)
versionstringเวอร์ชันแบบ semantic (เช่น 1.0.0)
toolsarrayโมดูลของ Brevo MCP server ที่เอเจนต์นี้เข้าถึงได้

ฟิลด์ด้านพฤติกรรม

ฟิลด์ชนิดค่าเริ่มต้นคำอธิบาย
temperaturefloat0.3ค่า temperature ของ LLM ยิ่งต่ำยิ่งให้ผลลัพธ์คงที่ ใช้ 0.1-0.2 สำหรับงานจัดการข้อมูล และ 0.3-0.5 สำหรับการออกแบบแคมเปญ
max_tokensinteger4096ความยาวสูงสุดของคำตอบต่อหนึ่งรอบ
modelstringclaude-sonnet-4-6โมเดล LLM ที่จะใช้

ฟิลด์ทริกเกอร์

ฟิลด์ชนิดค่าเริ่มต้นคำอธิบาย
triggersarray[]เหตุการณ์ ตารางเวลา หรือ webhook ที่ปลุกให้เอเจนต์นี้ทำงาน
triggers[].eventstring-ชื่อเหตุการณ์ (เช่น cart_abandoned, customer_created)
triggers[].schedulestring-นิพจน์ cron (เช่น 0 9 * * * สำหรับทุกวันเวลา 9 นาฬิกา)
triggers[].webhookstring-เส้นทางของ webhook (เช่น /agents/cart-recovery/trigger)
triggers[].conditionsarray[]เงื่อนไขกรองสำหรับทริกเกอร์
triggers[].debouncestring-ช่วงเวลาหน่วงซ้ำ (เช่น 5m, 1h)

ฟิลด์สิทธิ์การใช้งาน

ฟิลด์ชนิดค่าเริ่มต้นคำอธิบาย
permissionsarray[]ขอบเขตสิทธิ์ที่ต้องมี ใช้สำหรับบันทึกร่องรอยการตรวจสอบ
related_agentsarray[]รหัสเอเจนต์ที่เอเจนต์นี้มอบหมายงานต่อได้
escalationstring-ปลายทางที่จะส่งต่อเมื่อเอเจนต์ไม่แน่ใจ (human, supervisor-agent)

เครื่องมือ: การจับคู่กับ Brevo MCP server

ฟิลด์ tools อ้างอิงชื่อโมดูลของ Brevo MCP server แต่ละโมดูลจับคู่กับ endpoint หนึ่งบน mcp.brevo.com:

tools:
# Contacts & Segmentation
- brevo_contacts # /v1/brevo_contacts/mcp
- brevo_lists # /v1/brevo_lists/mcp
- brevo_segments # /v1/brevo_segments/mcp
- brevo_attributes # /v1/brevo_attributes/mcp
# Campaigns & Messaging
- brevo_email_campaign_management # /v1/brevo_email_campaign_management/mcp
- brevo_templates # /v1/brevo_templates/mcp
- brevo_sms_campaigns # /v1/brevo_sms_campaigns/mcp
- brevo_whatsapp_campaigns # /v1/brevo_whatsapp_campaigns/mcp
# Analytics
- brevo_campaign_analytics # /v1/brevo_campaign_analytics/mcp
# Sales CRM
- brevo_deals # /v1/brevo_deals/mcp
- brevo_companies # /v1/brevo_companies/mcp
- brevo_tasks # /v1/brevo_tasks/mcp
- brevo_pipelines # /v1/brevo_pipelines/mcp
- brevo_notes # /v1/brevo_notes/mcp

Tip

ใช้เครื่องมือชุดเล็กที่สุดเท่าที่เอเจนต์ของคุณต้องการ เครื่องมือยิ่งน้อย AI ยิ่งให้เหตุผลได้ดีขึ้นและตอบเร็วขึ้น ดู Brevo MCP Server สำหรับโมดูลทั้งหมดที่มีให้ใช้

ทริกเกอร์

ทริกเกอร์ตามเหตุการณ์

ปลุกเอเจนต์เมื่อมีบางอย่างเกิดขึ้นในระบบของคุณ:

triggers:
- event: cart_abandoned
conditions:
- cart_value: "> 50"
- items_count: ">= 1"
- time_since_activity: "> 30m"
debounce: 5m

ทริกเกอร์ตามตารางเวลา

ให้เอเจนต์ทำงานตามตารางเวลาที่วนซ้ำ:

triggers:
- schedule: "0 9 * * MON" # Every Monday at 9am
timezone: "America/New_York"
- schedule: "0 */4 * * *" # Every 4 hours
- schedule: "0 0 1 * *" # First day of each month

ทริกเกอร์ผ่าน webhook

เรียกใช้เอเจนต์ผ่าน HTTP:

triggers:
- webhook: /agents/win-back/trigger
method: POST
authentication: api_key

เนื้อหา markdown: คำสั่ง

เนื้อหาของข้อกำหนดเอเจนต์คือคำสั่งในภาษาธรรมชาติ เขียนเหมือนกำลังบรีฟงานให้นักการตลาดที่เชี่ยวชาญ:

โครงสร้าง

# Agent Name
Context paragraph, what this agent does and why.
## Strategy
Step-by-step approach the agent should follow.
## Decision Framework
Rules for making choices (e.g., which channel to use based on cart value).
## Rules
Hard constraints, things the agent must ALWAYS or NEVER do.
## Templates
References to Brevo template IDs, SMS copy, WhatsApp templates.
## Metrics
Events to track for measuring success.

การเขียนคำสั่งให้ได้ผล

ระบุกลยุทธ์ให้ชัดเจน ไม่ใช่บอกแค่เป้าหมาย:

## Bad
Re-engage churned customers.
## Good
When a customer hasn't purchased in 90+ days:
1. Check their last 3 orders for product category preferences
2. Create a personalized discount based on AOV (10% if AOV > $100, 15% if < $100)
3. Send email with subject line referencing their preferred category
4. Wait 72 hours, if no open, send SMS with discount code
5. Wait 7 days, if no purchase, mark as deep-churn and stop sequence

กำหนดกรอบป้องกันอย่างชัดแจ้ง:

## Rules
- NEVER send more than 3 messages per sequence
- NEVER contact customers who unsubscribed
- ALWAYS check if the customer converted before sending the next step
- ALWAYS respect quiet hours (no SMS 9pm-9am local time)
- If unsure about a decision, escalate to human review

การต่อเอเจนต์หลายตัวเป็นสายงาน

สำหรับเวิร์กโฟลว์ที่ซับซ้อน ให้ประกอบเอเจนต์หลายตัวเข้าเป็นสายงานเดียว เอเจนต์แต่ละตัวรับผิดชอบหนึ่งช่วง แล้วส่งบริบทต่อให้ตัวถัดไป:

chain.yaml
name: quarterly-retention-campaign
steps:
- agent: customer-intelligence
input: |
Analyze customer segments for Q2 retention campaign.
Goal: {task}
Identify:
1. At-risk customers (declining purchase frequency)
2. VIP customers (top 10% by LTV)
3. Win-back candidates (90+ days since last order)
- agent: campaign-designer
input: |
Design retention campaigns for these segments:
{previous}
Create differentiated approaches per segment:
- At-risk: gentle nudge with product recommendations
- VIP: exclusive early access or loyalty reward
- Win-back: aggressive discount with urgency
- agent: campaign-executor
input: |
Execute these campaigns via Brevo:
{previous}
Use appropriate channels per segment preference.
Set up A/B tests for subject lines.
Schedule sends for optimal times.
- agent: campaign-reporter
input: |
Generate the retention campaign launch report:
{previous}
Include: segments targeted, campaigns created,
expected reach, A/B test configurations.

ตัวแปรในสายงาน

ตัวแปรคำอธิบาย
{task}เป้าหมายหรือคำขอตั้งต้น
{previous}ผลลัพธ์จากขั้นตอนก่อนหน้า
{step_N}ผลลัพธ์จากขั้นตอนที่ N (เริ่มนับจาก 0)
{artifacts_dir}ไดเรกทอรีสำหรับไฟล์ผลลัพธ์

ข้อกำหนดเอเจนต์สำเร็จรูป

Campaign Orchestrator

---
name: campaign-orchestrator
description: Design and execute multi-channel campaigns from natural language prompts
version: 2.0.0
temperature: 0.3
tools:
- brevo_contacts
- brevo_segments
- brevo_email_campaign_management
- brevo_templates
- brevo_sms_campaigns
- brevo_whatsapp_campaigns
- brevo_campaign_analytics
triggers:
- webhook: /agents/campaign/trigger
method: POST
---
# Campaign Orchestrator
You are a multi-channel marketing campaign specialist.
Given a campaign brief, you design, build, and launch
campaigns across email, SMS, and WhatsApp via Brevo.
## Process
1. Parse the campaign brief (audience, message, goal, timeline)
2. Create or identify the target segment in Brevo
3. Select the best channel(s) based on audience preference data
4. Build campaign content using existing templates or creating new ones
5. Configure send schedule and A/B tests
6. Launch and report initial delivery metrics
## Channel Selection
- Email: default for all campaigns
- SMS: add for time-sensitive offers or cart recovery
- WhatsApp: add for conversational campaigns or high-value segments
## Rules
- ALWAYS preview campaigns before sending
- NEVER send to unsubscribed contacts
- ALWAYS set up tracking for campaign attribution
- Maximum 2 A/B test variants per campaign

Customer Intelligence Agent

---
name: customer-intelligence
description: Autonomous segmentation, RFM scoring, and churn prediction
version: 1.5.0
temperature: 0.2
tools:
- brevo_contacts
- brevo_segments
- brevo_attributes
- brevo_lists
- brevo_campaign_analytics
triggers:
- schedule: "0 6 * * MON"
timezone: "UTC"
---
# Customer Intelligence Agent
You analyze customer data in Brevo to generate actionable
segments and insights for marketing teams.
## Weekly Analysis
1. Pull contact activity data from campaign analytics
2. Calculate RFM scores (Recency, Frequency, Monetary)
3. Identify segment shifts (customers moving between tiers)
4. Flag churn risks (declining engagement over 4+ weeks)
5. Generate segment recommendations for upcoming campaigns
## Segment Definitions
- Champions: R=5, F=5, M=5, recent, frequent, high-value
- Loyal: R>=3, F>=4, M>=3, consistent buyers
- At Risk: R<=2, F>=3, M>=3, were loyal, now fading
- Hibernating: R=1, F>=2, M>=2, long gone, were once active
- New: first purchase in last 30 days
## Output
Produce a markdown report with:
- Segment sizes and week-over-week changes
- Top 10 at-risk customers by LTV
- Recommended actions per segment
- Suggested campaign themes for the week

การนำไปใช้งานจริง

การรันเอเจนต์ด้วยโค้ด

import { TajoAgent } from "@tajo/agent-sdk";
const agent = new TajoAgent({
specPath: "./agents/cart-recovery-agent.md",
brevoToken: process.env.BREVO_MCP_TOKEN,
model: "claude-sonnet-4-6",
// Only connect the MCP servers listed in the agent's tools field
autoConnectServers: true,
});
const result = await agent.run(
"Recover abandoned carts over $50 from the last 4 hours"
);
console.log(result.summary);
console.log(result.toolCalls); // Full audit trail
console.log(result.metrics); // Events tracked

การรันผ่าน Claude Code

Terminal window
# Point to your agent spec and let Claude execute it
claude "Run the agent defined in ./agents/cart-recovery-agent.md for today's abandoned carts"

การตั้งเวลาด้วย cron

Terminal window
# Run the customer intelligence agent every Monday at 6am
0 6 * * MON claude --print "Run ./agents/customer-intelligence.md weekly analysis" >> /var/log/tajo-agents.log 2>&1

ขั้นตอนถัดไป

ขอสิทธิ์ใช้งานล่วงหน้า

กรอกชื่อพร้อมอีเมลหรือหมายเลขโทรศัพท์ แล้วเราจะติดต่อกลับพร้อมรายละเอียดการเข้าใช้งาน Tajo

ตรวจจับอัตโนมัติ
ผู้ช่วย AI

สวัสดี! ถามฉันเกี่ยวกับเอกสารได้เลย