AI Agents in Cadences: From Prompt to Autonomous System
How a simple text becomes an agent with personality, memory, tools, and the ability to make decisions on its own.
"AI Agent" has become this year's buzzword, but the reality is that most implementations are simply a chatbot with a long prompt. In Cadences, agents are something else entirely. They are autonomous processes running on the cloud edge, with configurable personality, persistent memory, real tools, and the ability to communicate with each other.
π§ What you'll learn in this article
- The multi-layer architecture of agents: prompt, personality, tools, memory
- The pre-configured agent library: productivity, sales, support, marketing
- Autonomous background execution with scheduling, pipelines, and agent-to-agent communication
- Synapse Studio: the visual environment where agents come to life
What Makes an "Agent" Different from a "Chatbot"?
A chatbot answers questions. An agent acts. The fundamental difference is that an agent has access to tools, persistent context, and the ability to execute operations in the real world β create tasks, send emails, update data, even execute other agents.
π¬ Traditional Chatbot
- β’ Receives question β returns text
- β’ No memory between sessions
- β’ Cannot execute actions
- β’ Single AI model
- β’ No notion of "goal"
π€ Cadences Agent
- β’ Receives goal β plans β executes β reports
- β’ Persistent memory in D1
- β’ Autonomous CRUD (tasks, CRM, emails)
- β’ Multi-provider: Gemini, DeepSeek, OpenAI
- β’ Goal-oriented with multi-step planning
Anatomy of a Cadences Agent
Each agent in Cadences is composed of five layers that work together. This modular design allows a support agent to work completely differently from a sales agent, while both share the same execution infrastructure:
1. Prompt & Personality
The system prompt defines who the agent is, its tone, rules, and limits. Includes output format instructions and decision logic.
2. Tool Modules
Each agent activates selective modules: project CRUD operations, data, forms, tasks+media. It only accesses what it needs.
3. Context & Memory
Access to current project state, previous conversation history, and CRM data. Memory persists in D1 across sessions.
4. Execution Engine
The AgentWorker runs on Cloudflare Workers with retry logic, tier-based rate limiting, and configurable timeouts. Complete logging of each step.
5. Autonomous Operations
When operations: true, the agent can create tasks, update contacts, send notifications, and more β without human intervention.
The Pre-Configured Agent Library
Cadences includes a library of ready-to-use agents, organized by category. Each comes with an optimized prompt, recommended modules, and usage examples. You can use them as-is or clone them as a base to create custom agents:
| Category | Agents | Usage Example |
|---|---|---|
| π Productivity | Task Organizer, Meeting Summarizer, Email Drafter | "Organize my 15 pending tasks by priority and create a weekly plan" |
| π― Sales | Lead Qualifier, Proposal Writer | "Qualify this lead with BANT and suggest next step" |
| π« Support | Ticket Router, FAQ Responder | "Classify the 20 new tickets and assign them to the correct team" |
| π£ Marketing | Content Creator, Campaign Planner | "Generate 5 social media posts about our launch" |
| π» Development | Code Reviewer, Bug Triager | "Review pending PRs and prioritize bugs by severity" |
| π€ Custom | Your own agent | "Create an agent from scratch with your rules and personality" |
Defining an Agent: Code Anatomy
Each library agent is a JavaScript object with a clear structure. This is what defines the Lead Qualifier, one of the most popular agents in the sales catalog:
{
id: 'lead-qualifier',
name: 'Lead Qualifier',
category: 'sales',
icon: 'π―',
description: 'Qualifies leads using BANT/CHAMP framework',
prompt: `You are an expert in B2B lead qualification.
Use BANT framework:
- Budget: Do they have a budget?
- Authority: Are they a decision maker?
- Need: Do they have a clear need?
- Timeline: When do they need to buy?
Scale: π₯ HOT (90-100) | π WARM (70-89)
π΅ COLD (50-69) | βοΈ FROZEN (<50)`,
promptModules: {
includeCore: true,
includeFormOperations: true,
includeProjectOperations: true
},
difficulty: 'intermediate',
popularity: 76
}
The promptModules field is key: it defines which tools and operations the agent has access to. An agent with includeProjectOperations: true can create and modify tasks; with includeFormOperations: true, it can read CRM form data.
Autonomous Execution on the Cloud Edge
Agents don't live in the browser. They run on Cloudflare Workers via the AgentWorker, an execution system designed to run AI tasks in the background without user intervention:
const response = await fetch('/api/agents/execute', {
method: 'POST',
body: JSON.stringify({
agentType: 'lead-qualifier',
prompt: 'Qualify this lead: CEO, 50 employees, $10k',
context: { projectId: 'proj_123' },
userId: 'user_abc',
userTier: 'premium',
priority: 8, // CRITICAL = 10, HIGH = 8
operations: true, // Allow autonomous CRUD
aiProvider: 'auto' // Uses user preferences
})
});
const { executionId, status } = await response.json();
// status: 'pending' β 'running' β 'completed' β‘ Rate Limits per Tier
| Tier | Concurrent | Per Hour | Max Timeout |
|---|---|---|---|
| Free | 1 | 10 | 30 sec |
| Starter | 3 | 100 | 2 min |
| Premium | 10 | 500 | 5 min |
| Enterprise | 50 | Unlimited | 10 min |
Scheduling: Agents That Work While You Sleep
The AgentScheduler enables scheduling agents with cron expressions, timezone support, and auto-disable after consecutive failures. Some real-world examples:
// Daily report: Monday to Friday at 9:00 AM
await fetch('/api/schedules', {
method: 'POST',
body: JSON.stringify({
cron: '0 9 * * 1-5',
agentConfig: {
agentType: 'daily-reporter',
prompt: 'Generate summary of tasks completed yesterday',
userId: 'user_abc',
userTier: 'premium'
},
timezone: 'America/New_York',
enabled: true
})
});
// Auto-disable after 5 consecutive failures β
// Retry logic with exponential backoff β Pipelines and Agent-to-Agent Communication
Agents can communicate with each other through two patterns: sequential pipeline (one agent's output feeds the next) and parallel fan-out (one agent triggers multiple agents simultaneously).
π Sequential Pipeline
π Parallel Fan-Out
Multi-Provider: Choose Your AI Model
Agents are not tied to a single model. The aiService system supports multiple AI providers: if the user configured DeepSeek as their preferred provider, their agents will use DeepSeek. If not, the system uses Gemini as a smart fallback:
| Provider | Default Model | Best For |
|---|---|---|
| Google Gemini | gemini-2.5-flash | Speed and cost (default) |
| DeepSeek | deepseek-chat | Complex reasoning |
| OpenAI | gpt-4o | Legacy compatibility |
| Anthropic | claude-sonnet | Long and safe analysis |
Synapse Studio: Your Agents in Action
Synapse Studio takes agents to the next visual level. It's a "corporate building" environment where each agent has an avatar, a desk, an emotional state, and an energy level. You can watch them work, send them on breaks, and review their performance in real time.
Agent Properties in Synapse
When an agent has completed many consecutive tasks, its energy drops. You can send it to break and its energy recovers +40 points, its mood changes to "happy" and its consecutive task counter resets. This isn't cosmetic β it's a real context management mechanic that prevents quality degradation in responses from token accumulation.
How an Agent Executes a Task in Synapse
When you assign a task to an agent in Synapse Studio, this is what happens internally:
Agent state β "working"
Updates current_state, current_task_id and increments consecutive_tasks
Contextual prompt construction
Combines: system_prompt + floor context + task description + previous history
AI call (multi-provider)
Uses the organization's AI configuration: provider, model, temperature
Result parsing + operations
Extracts steps from the response, creates subtasks if applicable, generates scores
Task completed β event generated
Logged in synapse_events, XP points updated, achievements checked and leaderboard refreshed
From D1: The Agent Execution Schema
Every agent execution is persisted in Cloudflare D1 for auditing, debugging, and analytics:
CREATE TABLE agent_executions (
execution_id TEXT UNIQUE, -- 'exec_a8f3c2...'
user_id TEXT NOT NULL,
user_tier TEXT DEFAULT 'free',
agent_type TEXT NOT NULL, -- 'lead-qualifier'
config TEXT, -- Full JSON config
status TEXT DEFAULT 'pending',
priority INTEGER DEFAULT 5,
result TEXT, -- JSON with response
logs TEXT, -- JSON array of logs
parent_execution_id TEXT, -- For pipelines
scheduled_for DATETIME,
started_at DATETIME,
completed_at DATETIME
); From Prompt to System: The Future Is Already Here
Cadences agents are not a lab experiment. They are production systems that real companies use daily to qualify leads, generate reports, classify tickets, and automate repetitive tasks. The combination of personality library + edge execution + multi-provider AI + Synapse Studio creates an ecosystem where building an autonomous agent is as easy as choosing a template and giving it a goal.
And this is just the beginning. In upcoming articles, we'll see how these same agents can talk on the phone with customers (Conversational Voice AI) and how Synapse acts as the data brain that connects the entire ecosystem.
Ready to create your first agent?
Access Synapse Studio and set up autonomous agents for your organization in minutes.