Skip to content

API Reference parrot.services.agent_service

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.services.agent_service

View source

AgentService — standalone asyncio runtime for autonomous AI agents.

Alias AbstractBot

Re-exported from parrot.bots.abstract.AbstractBot.

Class AgentService

Standalone asyncio runtime for autonomous AI agents.

Composes:

  • TaskQueue for priority-aware task management
  • WorkerPool for bounded concurrent execution
  • HeartbeatScheduler for periodic agent wake-ups
  • RedisTaskListener for IPC with the web server
  • DeliveryRouter for routing results to delivery channels

Agent resolution uses BotManager.get_bot() — the same mechanism used by TelegramBotManager and AutonomousOrchestrator.

Usage::

from parrot.services import AgentService, AgentServiceConfig

config = AgentServiceConfig(redis_url="redis://localhost:6379")
service = AgentService(config, bot_manager)
await service.start()
# ... runs until stop() is called
await service.stop()
Parameter Type Default Description
config AgentServiceConfig
bot_manager BotManager

Method AgentService.start

Initialize all components and begin processing.

start() -> None

Method AgentService.stop

Graceful shutdown of all components.

stop() -> None

Method AgentService.submit_task

Submit a task for execution.

submit_task(task: AgentTask) -> str

Parameter Type Default Description
task AgentTask The agent task to execute.

Returns: str — The task ID (existing one if agent is already active).

Method AgentService.get_status

Return service status for monitoring.

get_status() -> dict

Returns: dict

Alias AgentServiceConfig

Re-exported from parrot.services.models.AgentServiceConfig.

Alias AgentTask

Re-exported from parrot.services.models.AgentTask.

Alias BotManager

Re-exported from parrot.manager.BotManager.

Alias DeliveryChannel

Re-exported from parrot.services.models.DeliveryChannel.

Alias DeliveryRouter

Re-exported from parrot.services.delivery.DeliveryRouter.

Alias HeartbeatScheduler

Re-exported from parrot.services.heartbeat.HeartbeatScheduler.

Alias RedisTaskListener

Re-exported from parrot.services.redis_listener.RedisTaskListener.

Alias TaskQueue

Re-exported from parrot.services.task_queue.TaskQueue.

Alias TaskResult

Re-exported from parrot.services.models.TaskResult.

Alias TaskStatus

Re-exported from parrot.services.models.TaskStatus.

Alias WorkerPool

Re-exported from parrot.services.worker_pool.WorkerPool.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally