ai-agent
Configure AI agents via the imperative SDK / REST API — for no-code dashboard setups, webhook-based tools, and knowledge bases.
What this skill does
# AI Agent
## When to Use
Use this skill when the user wants to configure AI agents through **API calls** (no source files, no deploy step) — typically from a dashboard or a backend script that creates/updates the agent imperatively.
If the user wants a **code-first agent with custom tool handlers** in TypeScript, deployed via the `zavu` CLI, route them to the **`functions`** skill instead. That path is more ergonomic, version-controlled, and has built-in deployment + debugging.
**Quick routing:**
| User says… | Use |
|---|---|
| "I want my agent's tool to query my database" / "I want to write the tool handler in code" / `defineTool` / `zavu deploy` | `functions` skill |
| "Set up an agent that calls a webhook on my server" / "Configure from the dashboard" / "Create an agent via API" | this skill |
| "I'm starting from scratch and want the simplest path" | `functions` skill (recommended default) |
The imperative API documented here is fully supported and won't be deprecated, but Functions is the recommended path for most new integrations.
## Architecture
```
Inbound message -> Flow check (keyword/intent match?)
-> YES: Execute flow steps
-> NO: LLM call with system prompt + context + KB
-> Agent generates response -> Send reply
```
## Create Agent
Each sender can have one agent:
```typescript
const result = await zavu.senders.agent.create({
senderId: "snd_abc123",
name: "Customer Support",
provider: "openai",
model: "gpt-4o-mini",
systemPrompt: "You are a helpful customer support agent for Acme Corp. Be friendly, concise, and helpful. If you don't know the answer, say so.",
apiKey: process.env.PROVIDER_API_KEY,
contextWindowMessages: 10,
includeContactMetadata: true,
triggerOnChannels: ["sms", "whatsapp"],
triggerOnMessageTypes: ["text"],
});
console.log(result.agent.id); // agent_xxx
```
**Python:**
```python
result = zavu.senders.agent.create(
sender_id="snd_abc123",
name="Customer Support",
provider="openai",
model="gpt-4o-mini",
system_prompt="You are a helpful customer support agent...",
api_key=os.environ["PROVIDER_API_KEY"],
)
```
**Go:**
```go
result, err := client.Senders.Agent.Create(context.TODO(), zavudev.AgentCreateParams{
SenderID: zavudev.String("snd_abc123"),
Name: zavudev.String("Customer Support"),
Provider: zavudev.String("openai"),
Model: zavudev.String("gpt-4o-mini"),
SystemPrompt: zavudev.String("You are a helpful customer support agent..."),
APIKey: zavudev.String(os.Getenv("PROVIDER_API_KEY")),
})
```
**Ruby:**
```ruby
result = client.senders.agent.create(
sender_id: "snd_abc123",
name: "Customer Support",
provider: "openai",
model: "gpt-4o-mini",
system_prompt: "You are a helpful customer support agent...",
api_key: ENV["PROVIDER_API_KEY"],
)
```
**PHP:**
```php
$result = $client->senders->agent->create([
'senderId' => 'snd_abc123',
'name' => 'Customer Support',
'provider' => 'openai',
'model' => 'gpt-4o-mini',
'systemPrompt' => 'You are a helpful customer support agent...',
'apiKey' => getenv('PROVIDER_API_KEY'),
]);
```
## Provider & Model Selection
| Provider | Models | API Key Required |
|----------|--------|-----------------|
| `openai` | `gpt-4o`, `gpt-4o-mini`, `gpt-4-turbo` | Yes |
| `anthropic` | `claude-3-5-sonnet`, `claude-3-haiku` | Yes |
| `google` | `gemini-1.5-pro`, `gemini-1.5-flash` | Yes |
| `mistral` | `mistral-large`, `mistral-small` | Yes |
| `zavu` | Zavu-hosted models | No (included) |
## Update & Toggle Agent
```typescript
// Update configuration
await zavu.senders.agent.update({
senderId: "snd_abc123",
systemPrompt: "Updated prompt...",
temperature: 0.7,
maxTokens: 500,
});
// Enable/disable
await zavu.senders.agent.update({
senderId: "snd_abc123",
enabled: false,
});
```
## Conversational Flows
Flows handle structured conversations (keyword triggers, data collection):
```typescript
const result = await zavu.senders.agent.flows.create({
senderId: "snd_abc123",
name: "Lead Capture",
description: "Capture lead information from interested prospects",
trigger: {
type: "keyword",
keywords: ["info", "pricing", "demo"],
},
steps: [
{
id: "welcome",
type: "message",
config: { text: "Thanks for your interest! Let me get some info." },
nextStepId: "ask_name",
},
{
id: "ask_name",
type: "collect",
config: { variable: "name", prompt: "What's your name?" },
nextStepId: "ask_email",
},
{
id: "ask_email",
type: "collect",
config: { variable: "email", prompt: "What's your email?" },
nextStepId: "confirm",
},
{
id: "confirm",
type: "message",
config: { text: "Thanks {{name}}! We'll reach out at {{email}}." },
},
],
enabled: true,
priority: 10,
});
```
### Trigger Types
| Type | Description |
|------|-------------|
| `keyword` | Matches specific keywords in message |
| `intent` | Matches detected intent |
| `always` | Runs on every message |
| `manual` | Only triggered via API |
### Step Types
| Type | Description |
|------|-------------|
| `message` | Send a message |
| `collect` | Collect user input into a variable |
| `condition` | Branch based on conditions |
| `tool` | Call a webhook tool |
| `llm` | Make an LLM call |
| `transfer` | Transfer to human agent |
### Flow Operations
```typescript
// List flows
const flows = await zavu.senders.agent.flows.list({ senderId: "snd_abc123" });
// Update flow
await zavu.senders.agent.flows.update({
senderId: "snd_abc123",
flowId: "flow_abc123",
enabled: false,
});
// Duplicate flow
await zavu.senders.agent.flows.duplicate({
senderId: "snd_abc123",
flowId: "flow_abc123",
newName: "Lead Capture (Copy)",
});
// Delete flow
await zavu.senders.agent.flows.delete({
senderId: "snd_abc123",
flowId: "flow_abc123",
});
```
## Webhook Tools
Tools let the agent call your backend during conversations:
```typescript
const result = await zavu.senders.agent.tools.create({
senderId: "snd_abc123",
name: "get_order_status",
description: "Get the current status of a customer order",
webhookUrl: "https://api.example.com/webhooks/order-status",
webhookSecret: process.env.WEBHOOK_SECRET,
parameters: {
type: "object",
properties: {
order_id: { type: "string", description: "The order ID to look up" },
},
required: ["order_id"],
},
});
// Test tool
await zavu.senders.agent.tools.test({
senderId: "snd_abc123",
toolId: "tool_abc123",
testParams: { order_id: "ORD-12345" },
});
```
## Knowledge Bases (RAG)
Add documents for the agent to reference via retrieval-augmented generation:
```typescript
// Create knowledge base
const kb = await zavu.senders.agent.knowledgeBases.create({
senderId: "snd_abc123",
name: "Product FAQ",
description: "Frequently asked questions about our products",
});
// Add document
await zavu.senders.agent.knowledgeBases.documents.create({
senderId: "snd_abc123",
kbId: kb.knowledgeBase.id,
title: "Return Policy",
content: "Our return policy allows returns within 30 days of purchase...",
});
// List documents
const docs = await zavu.senders.agent.knowledgeBases.documents.list({
senderId: "snd_abc123",
kbId: kb.knowledgeBase.id,
});
```
## Monitoring
```typescript
// Get agent stats
const stats = await zavu.senders.agent.stats({ senderId: "snd_abc123" });
console.log(`Invocations: ${stats.totalInvocations}`);
console.log(`Tokens: ${stats.totalTokensUsed}`);
console.log(`Cost: $${stats.totalCost}`);
// List executions
const executions = await zavu.senders.agent.executions.list({
senderId: "snd_abc123",
status: "error",
limit: 20,
});
for (const exec of executions.items) {
console.log(exec.id, exec.status, exec.errorMessage);
}
```
### Execution Statuses
| Status | Description |
|--------|-----------Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.