Back to Blog
AI & ML 14 min read

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.

C
Cadences Team
Artificial intelligence and autonomous agents represented with neural networks

"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
Concept

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
Architecture

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.

Catalog

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"
Implementation

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:

agentLibrary.js
{
  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.

Backend

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:

Execute an agent β€” API call
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
Free11030 sec
Starter31002 min
Premium105005 min
Enterprise50Unlimited10 min
Automation

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:

Schedule an agent with cron
// 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 βœ“
Advanced

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

1
Data Collector β†’ gathers data
↓ output as input
2
Analyzer β†’ processes and analyzes
↓ output as input
3
Reporter β†’ generates final report

🌊 Parallel Fan-Out

1
Trigger Agent β†’ fires 3 agents
↓↓↓ in parallel
A
Email Drafter
B
Slack Notifier
C
CRM Updater
Flexibility

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
Visual Interface

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

🎭 Personality
personality_config JSON
😊 Emotional State
current_mood: neutral, happy...
⚑ Energy
energy_level: 0-100%
🏒 Department
Sales, Support, Marketing...
πŸ“ˆ XP & Level
xp_points, level, achievements
πŸ”’ Data Access
data_access_level: 0-3

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.

Real Execution

How an Agent Executes a Task in Synapse

When you assign a task to an agent in Synapse Studio, this is what happens internally:

1

Agent state β†’ "working"

Updates current_state, current_task_id and increments consecutive_tasks

2

Contextual prompt construction

Combines: system_prompt + floor context + task description + previous history

3

AI call (multi-provider)

Uses the organization's AI configuration: provider, model, temperature

4

Result parsing + operations

Extracts steps from the response, creates subtasks if applicable, generates scores

5

Task completed β†’ event generated

Logged in synapse_events, XP points updated, achievements checked and leaderboard refreshed

Persistence

From D1: The Agent Execution Schema

Every agent execution is persisted in Cloudflare D1 for auditing, debugging, and analytics:

agent_executions (D1 / SQLite)
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
);
Conclusion

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.