Format specifikacije agenta
Format specifikacije agenta
Tajo agenti so definirani v markdown datotekah. Vsaka datoteka vsebuje YAML frontmatter (identiteta, orodja, omejitve) in markdown telo (navodila, strategija, pravila). Ta format je navdihnjen s produkcijskimi vzorci agentov, ki se uporabljajo v sistemih multi-agent orkestracije.
Struktura datoteke
---name: agent-namedescription: Kaj ta agent dela (največ 160 znakov)version: 1.0.0temperature: 0.2max_tokens: 4096tools: - brevo_contacts - brevo_email_campaign_management - brevo_sms_campaignstriggers: - event: cart_abandoned - schedule: "0 */4 * * *"permissions: - contacts:read - email:send - sms:send---
# Ime agenta
Navodila za agenta v naravnem jeziku...Polja Frontmatter
Obvezna polja
| Polje | Tip | Opis |
|---|---|---|
name | string | Edinstveni identifikator v kebab-case (npr. cart-recovery-agent) |
description | string | Kaj ta agent dela (največ 160 znakov) |
version | string | Semantična verzija (npr. 1.0.0) |
tools | array | Moduli Brevo MCP strežnika, do katerih ima ta agent dostop |
Vedenjska polja
| Polje | Tip | Privzeta vrednost | Opis |
|---|---|---|---|
temperature | float | 0.3 | Temperatura LLM. Nižja = bolj deterministična. Uporabite 0.1-0.2 za podatkovne operacije, 0.3-0.5 za oblikovanje kampanj |
max_tokens | integer | 4096 | Največja dolžina odgovora na obrat |
model | string | claude-sonnet-4-6 | LLM model za uporabo |
Polja sprožilcev
| Polje | Tip | Privzeta vrednost | Opis |
|---|---|---|---|
triggers | array | [] | Dogodki, urniki ali webhooks, ki aktivirajo tega agenta |
triggers[].event | string | - | Ime dogodka (npr. cart_abandoned, customer_created) |
triggers[].schedule | string | - | Cron izraz (npr. 0 9 * * * za vsak dan ob 9:00) |
triggers[].webhook | string | - | Pot webhooka (npr. /agents/cart-recovery/trigger) |
triggers[].conditions | array | [] | Pogoji filtriranja za sprožilec |
triggers[].debounce | string | - | Okno debounce (npr. 5m, 1h) |
Polja dovoljenj
| Polje | Tip | Privzeta vrednost | Opis |
|---|---|---|---|
permissions | array | [] | Zahtevani obsegi dovoljenj za revizijsko sled |
related_agents | array | [] | ID agentov, na katere lahko ta agent delegira |
escalation | string | - | Kam usmeriti, ko je agent negotov (human, supervisor-agent) |
Orodja: Preslikava na Brevo MCP strežnike
Polje tools se sklicuje na imena modulov Brevo MCP strežnika. Vsak modul se preslika na določen endpoint na mcp.brevo.com:
tools: # Kontakti in segmentacija - brevo_contacts # /v1/brevo_contacts/mcp - brevo_lists # /v1/brevo_lists/mcp - brevo_segments # /v1/brevo_segments/mcp - brevo_attributes # /v1/brevo_attributes/mcp
# Kampanje in sporočila - 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
# Analitika - 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/mcpTip
Uporabite minimalni nabor orodij, ki ga vaš agent potrebuje. Manj orodij = boljše AI sklepanje in hitrejši odzivi. Oglejte Brevo MCP Server za vse razpoložljive module.
Sprožilci
Sprožilci dogodkov
Aktivirajte agenta, ko se v vašem sistemu kaj zgodi:
triggers: - event: cart_abandoned conditions: - cart_value: "> 50" - items_count: ">= 1" - time_since_activity: "> 30m" debounce: 5mSprožilci urnikov
Zaganjajte agenta po ponavljajočem se urniku:
triggers: - schedule: "0 9 * * MON" # Vsak ponedeljek ob 9:00 timezone: "America/New_York" - schedule: "0 */4 * * *" # Vsake 4 ure - schedule: "0 0 1 * *" # Prvi dan vsakega mesecaSprožilci webhookov
Prikličite agenta prek HTTP:
triggers: - webhook: /agents/win-back/trigger method: POST authentication: api_keyTelo Markdown: Navodila
Telo specifikacije agenta so navodila v naravnem jeziku. Pišite ga kot navodila izkušenemu tržniku:
Struktura
# Ime agenta
Kontekstualni odstavek, kaj ta agent dela in zakaj.
## Strategija
Korak za korakom pristop, ki ga mora agent slediti.
## Odločitveni okvir
Pravila za odločanje (npr. kateri kanal uporabiti glede na vrednost košarice).
## Pravila
Trde omejitve, stvari, ki jih agent VEDNO ali NIKOLI ne sme narediti.
## Predloge
Reference na ID predlog Brevo, SMS besedila, WhatsApp predloge.
## Metrike
Dogodki za sledenje za merjenje uspeha.Pisanje učinkovitih navodil
Bodite specifični glede strategije, ne samo ciljev:
## SlaboRe-engage churned customers.
## DobroWhen a customer hasn't purchased in 90+ days:1. Check their last 3 orders for product category preferences2. Create a personalized discount based on AOV (10% if AOV > $100, 15% if < $100)3. Send email with subject line referencing their preferred category4. Wait 72 hours, if no open, send SMS with discount code5. Wait 7 days, if no purchase, mark as deep-churn and stop sequenceEksplicitno definirajte omejitve:
## Pravila- 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 reviewMulti-agent verige
Za kompleksne delovne tokove sestavite več agentov v verigo. Vsak agent obdeluje eno fazo in preda kontekst naslednjemu:
name: quarterly-retention-campaignsteps: - 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.Spremenljivke verige
| Spremenljivka | Opis |
|---|---|
{task} | Izvirni cilj/zahteva |
{previous} | Izhod iz prejšnjega koraka |
{step_N} | Izhod iz koraka N (0-indeksirano) |
{artifacts_dir} | Mapa za izhodne datoteke |
Vgrajene specifikacije agentov
Campaign Orchestrator
---name: campaign-orchestratordescription: Design and execute multi-channel campaigns from natural language promptsversion: 2.0.0temperature: 0.3tools: - brevo_contacts - brevo_segments - brevo_email_campaign_management - brevo_templates - brevo_sms_campaigns - brevo_whatsapp_campaigns - brevo_campaign_analyticstriggers: - webhook: /agents/campaign/trigger method: POST---
# Campaign Orchestrator
You are a multi-channel marketing campaign specialist.Given a campaign brief, you design, build, and launchcampaigns across email, SMS, and WhatsApp via Brevo.
## Process1. Parse the campaign brief (audience, message, goal, timeline)2. Create or identify the target segment in Brevo3. Select the best channel(s) based on audience preference data4. Build campaign content using existing templates or creating new ones5. Configure send schedule and A/B tests6. 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 campaignCustomer Intelligence Agent
---name: customer-intelligencedescription: Autonomous segmentation, RFM scoring, and churn predictionversion: 1.5.0temperature: 0.2tools: - brevo_contacts - brevo_segments - brevo_attributes - brevo_lists - brevo_campaign_analyticstriggers: - schedule: "0 6 * * MON" timezone: "UTC"---
# Customer Intelligence Agent
You analyze customer data in Brevo to generate actionablesegments and insights for marketing teams.
## Weekly Analysis1. Pull contact activity data from campaign analytics2. 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
## OutputProduce 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 weekNamestitev
Programsko zaganjanje agenta
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", // Poveže samo MCP strežnike, navedene v polju tools agenta 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); // Popolna revizijska sledconsole.log(result.metrics); // Sledeni dogodkiZaganjanje prek Claude Code
# Usmerite na vašo specifikacijo agenta in pustite Claude izvajaticlaude "Run the agent defined in ./agents/cart-recovery-agent.md for today's abandoned carts"Načrtovanje s Cron
# Zaganjajte agenta customer intelligence vsak ponedeljek ob 6:000 6 * * MON claude --print "Run ./agents/customer-intelligence.md weekly analysis" >> /var/log/tajo-agents.log 2>&1Naslednji koraki
- Brevo MCP Server, Razpoložljiva orodja in konfiguracija strežnika
- Izgradnja prvega agenta, Praktična vadnica
- Referenca Skills, Tajo Skills, ki se sestavljajo z agenti
- Pregled MCP arhitekture, Kako vse skupaj deluje