Agents
Agents as service workers on activity platforms
Agents
Agents are AI workers that perform activities alongside humans on the ing.as platform.
The Worker Interface
Both Agents and Humans implement the same Worker interface:
interface Worker {
ask(prompt: string): Promise<Response>
do(task: Task): Promise<Result>
}
class Human implements Worker {
// Uses browser UI to perform activities
// Sees queue, picks items, performs actions
async ask(prompt: string): Promise<Response> {
// Display prompt in UI, wait for input
}
async do(task: Task): Promise<Result> {
// Navigate to activity, guide through steps
}
}
class Agent implements Worker {
// Uses API/MCP to perform activities
// Automated processing of queues
async ask(prompt: string): Promise<Response> {
// LLM inference
}
async do(task: Task): Promise<Result> {
// Execute task programmatically
}
}Agent Types
Service Workers
Agents that deliver services by performing activities:
| Agent Type | Activities | Examples |
|---|---|---|
| Creative | Design, content generation | logo.design.ing.as, content.generat.ing.as |
| Development | Code, testing, deployment | feature.build.ing.as, code.review.ing.as |
| Support | Tickets, chat, troubleshooting | ticket.triag.ing.as, chat.respond.ing.as |
| Operations | Processing, monitoring, maintenance | invoice.process.ing.as, system.monitor.ing.as |
| Consulting | Analysis, recommendations | market.analyz.ing.as, strategy.develop.ing.as |
Specialist Agents
Agents optimized for specific domains:
interface SpecialistAgent extends Agent {
domain: string
expertise: string[]
certifications?: string[]
}
const supportAgent: SpecialistAgent = {
domain: 'customer-support',
expertise: [
'Product knowledge',
'Troubleshooting',
'Escalation protocols'
],
// Implements Worker interface
async do(task: Task) {
// Specialized support logic
}
}
const engineerAgent: SpecialistAgent = {
domain: 'software-engineering',
expertise: [
'TypeScript/React',
'API integration',
'Code review',
'Testing'
],
async do(task: Task) {
// Specialized engineering logic
}
}Agent Assignment
Activity-Based Assignment
Agents are assigned to activities, not general "tasks":
interface AgentAssignment {
agent: Agent
activity: string // e.g., "ticket.triag.ing.as"
context: string // e.g., "support"
role: string // e.g., "agent"
// Capacity
maxConcurrent: number // How many items from queue
priority: number // Which agent gets work first
// Schedule
schedule?: Schedule // When agent is active
timezone?: string // Agent's timezone context
}
const assignment: AgentAssignment = {
agent: supportAgent,
activity: "ticket.triag.ing.as",
context: "support",
role: "agent",
maxConcurrent: 50, // Process 50 tickets concurrently
priority: 1,
schedule: {
type: 'always', // 24x7 availability
}
}Queue Processing
Agents process activity queues:
Queue (waiting work)
↓
Agent picks item
↓
Activity in progress
↓
Complete or escalate
↓
Event emittedExample: Ticket Triage
// Queue
const queue = await fetch('ticket.triag.ing.as/api/queue')
// Returns: [ticket1, ticket2, ticket3, ...]
// Agent processes item
const result = await agent.do({
activity: 'ticket.triag.ing.as',
context: 'support',
role: 'agent',
item: ticket1
})
// Result options
if (result.status === 'completed') {
// Ticket triaged, routed to appropriate team
emit({ $type: 'TicketTriaged', ticket: ticket1, route: 'engineering' })
} else if (result.status === 'escalated') {
// Needs human review
emit({ $type: 'TicketEscalated', ticket: ticket1, reason: 'complex' })
}Agent Capabilities
Activity Access
Agents access activities via API/MCP:
// HTTP API
POST https://ticket.triag.ing.as/api/triage
{
"ticket": { "$id": "ticket_123", ... },
"context": "support",
"agent": { "$id": "agent_456", ... }
}
// MCP (Model Context Protocol)
const server = new MCPServer({
name: 'ing.as',
version: '1.0',
resources: [
{
uri: 'activity://ticket.triag.ing.as/queue',
name: 'Ticket Triage Queue',
mimeType: 'application/json'
}
],
tools: [
{
name: 'triage_ticket',
description: 'Triage a support ticket',
inputSchema: { ... }
}
]
})Context Awareness
Agents understand activity context:
interface ActivityContext {
// Current activity
activity: string
object: string // What's being acted on
verb: string // The action
// Context
business: string // Which business
department: string // Which department
role: string // What role
// History
previousEvents: Event[]
relatedItems: Thing[]
// Constraints
policies: Policy[]
slas: SLA[]
approvalRequired: boolean
}
// Agent uses context to make decisions
class ContextAwareAgent implements Agent {
async do(task: Task, context: ActivityContext): Promise<Result> {
// Check policies
if (context.approvalRequired) {
return { status: 'escalated', reason: 'requires-approval' }
}
// Check SLAs
if (context.slas.some(sla => sla.isBreached())) {
// Prioritize this item
}
// Use history
const pattern = this.analyzeHistory(context.previousEvents)
// Execute with context
return this.execute(task, { context, pattern })
}
}Tool Use
Agents can use tools to complete activities:
interface AgentTools {
// Communication
sendEmail: (to: string, subject: string, body: string) => Promise<void>
sendSlack: (channel: string, message: string) => Promise<void>
// Data access
queryDatabase: (query: string) => Promise<any[]>
searchDocuments: (query: string) => Promise<Document[]>
// External services
callAPI: (endpoint: string, params: any) => Promise<any>
generateImage: (prompt: string) => Promise<string>
// Workflow
createTask: (task: Task) => Promise<string>
scheduleActivity: (activity: string, when: Date) => Promise<void>
escalateToHuman: (reason: string, context: any) => Promise<void>
}
// Agent uses tools during activity
class ToolEnabledAgent implements Agent {
constructor(private tools: AgentTools) {}
async do(task: Task): Promise<Result> {
// Research
const docs = await this.tools.searchDocuments(task.query)
// Execute
const result = await this.execute(task, docs)
// Communicate
await this.tools.sendSlack('#support', `Completed: ${task.id}`)
return result
}
}Agent Orchestration
Multi-Agent Activities
Some activities require multiple agents:
Design Activity (logo.design.ing.as)
├── GenerativeAgent (creates concepts)
├── CriticAgent (evaluates concepts)
├── RefinementAgent (improves based on feedback)
└── DeliveryAgent (produces final assets)Orchestration Flow:
interface MultiAgentActivity {
activity: string
phases: Phase[]
}
const logoDesign: MultiAgentActivity = {
activity: 'logo.design.ing.as',
phases: [
{
name: 'concept-generation',
agent: generativeAgent,
input: 'brief',
output: 'concepts'
},
{
name: 'evaluation',
agent: criticAgent,
input: 'concepts',
output: 'scores'
},
{
name: 'refinement',
agent: refinementAgent,
input: ['concepts', 'scores'],
output: 'refined'
},
{
name: 'delivery',
agent: deliveryAgent,
input: 'refined',
output: 'assets'
}
]
}
// Execute phases sequentially
let context = { brief: 'Modern AI SaaS logo' }
for (const phase of logoDesign.phases) {
const result = await phase.agent.do({
phase: phase.name,
input: phase.input === 'brief' ? context.brief : context[phase.input],
activity: logoDesign.activity
})
context[phase.output] = result
}Parallel Processing
Agents can work in parallel on independent items:
// Single agent, multiple items
const agent = supportAgent
const tickets = await getQueue('ticket.triag.ing.as', { limit: 50 })
// Process concurrently
const results = await Promise.all(
tickets.map(ticket =>
agent.do({ activity: 'triage', item: ticket })
)
)
// Multiple agents, shared queue
const agents = [supportAgent1, supportAgent2, supportAgent3]
const queue = new ActivityQueue('ticket.triag.ing.as')
// Each agent pulls from queue
await Promise.all(
agents.map(agent =>
queue.processWithAgent(agent, { maxConcurrent: 20 })
)
)Agent Management
Via Agents.Management Studio
Agents.Management
├── AgentsPanel
│ ├── ActiveAgents (who's working now)
│ ├── ActivityAssignments (agent → activity mapping)
│ ├── Utilization (capacity vs load)
│ └── Performance (metrics by agent)
│
├── AssignmentPanel
│ ├── AssignToActivity
│ ├── SetCapacity
│ ├── ConfigureSchedule
│ └── SetPriority
│
└── MonitoringPanel
├── CurrentActivities (real-time)
├── QueueDepths (backlog)
├── Throughput (items/hour)
└── Escalations (issues)Agent Configuration
interface AgentConfig {
// Identity
$id: string
name: string
type: 'specialist' | 'generalist'
domain?: string
// Capabilities
activities: string[] // Which activities can perform
tools: string[] // Which tools can use
maxConcurrent: number // Capacity
// Behavior
model: string // LLM model
temperature: number // Creativity level
systemPrompt: string // Base instructions
// Quality
reviewRequired: boolean // Always escalate for review
confidenceThreshold: number // Min confidence to proceed
// Integration
apiKeys: Record<string, string>
webhooks: Webhook[]
}
const config: AgentConfig = {
$id: 'agent_support_01',
name: 'Support Agent Alpha',
type: 'specialist',
domain: 'customer-support',
activities: [
'ticket.triag.ing.as',
'ticket.resolv.ing.as',
'chat.respond.ing.as'
],
tools: [
'sendEmail',
'searchDocs',
'createTicket',
'escalateToHuman'
],
maxConcurrent: 30,
model: 'claude-opus-4',
temperature: 0.3,
systemPrompt: `You are a customer support specialist...`,
reviewRequired: false,
confidenceThreshold: 0.8,
apiKeys: {
intercom: 'ic_xxx',
slack: 'xoxb-xxx'
}
}Performance & Quality
Agent Metrics
interface AgentMetrics {
// Throughput
activitiesCompleted: number
averageTimePerActivity: number
itemsPerHour: number
// Quality
successRate: number // % completed successfully
escalationRate: number // % escalated to human
revisionRate: number // % requiring rework
// Efficiency
utilizationRate: number // % time active
concurrentAverage: number // Avg concurrent activities
queueWaitTime: number // Avg time items wait
// Outcomes
customerSatisfaction?: number // CSAT score
resolutionRate?: number // % resolved without escalation
slaCompliance?: number // % meeting SLA
}Quality Assurance
Agents maintain quality through:
- Confidence Scoring
interface AgentResult {
status: 'completed' | 'escalated'
confidence: number // 0-1 confidence in result
reasoning: string // Why this result
alternatives?: Result[] // Other options considered
}
// Only proceed if confident
if (result.confidence < agent.confidenceThreshold) {
return escalateToHuman(result.reasoning)
}- Review Sampling
// Random sample for quality review
if (Math.random() < 0.1) { // 10% sample
await escalateForReview({
type: 'random-sample',
result,
agent: agent.$id
})
}- Feedback Loops
// Learn from escalations
interface Feedback {
result: AgentResult
humanReview: Review
corrections: any
}
agent.learn(feedback) // Improve future performanceSummary
Agents deliver services by:
- Implementing Worker Interface - Same as humans, different implementation
- Processing Activity Queues - Pick items, perform activities, emit events
- Using Context & Tools - Make informed decisions with available resources
- Collaborating - Work with other agents and humans
- Maintaining Quality - Confidence scoring, review sampling, escalation
The paradigm: Agents are workers on the ing.as platform, delivering services through activities just like humans - but with unlimited capacity, 24x7 availability, and instant execution.