Expand description
§Tinytown
A simple, fast multi-agent orchestration system using Redis for message passing.
Tinytown takes the best ideas from complex orchestration systems and distills them into a minimal, fast, and easy-to-use library. It uses Redis with Unix socket communication for blazing-fast local message passing between agents.
§Key Features
- Simple: 5 core types, 1 config file, 3 commands
- Fast: Redis with Unix socket for sub-millisecond message passing
- Reliable: Agents persist work in git worktrees, survive crashes
- Observable: Built-in activity logging and status monitoring
§Quick Example
use tinytown::{Town, Agent, Task, Result};
#[tokio::main]
async fn main() -> Result<()> {
// Connect to town (auto-starts Redis if needed)
let town = Town::connect("./mytown").await?;
// Create an agent
let agent = town.spawn_agent("worker-1", "claude").await?;
// Assign a task
let task = Task::new("Fix the bug in auth.rs");
agent.assign(task).await?;
// Wait for completion
agent.wait().await?;
Ok(())
}Re-exports§
pub use agent::Agent;pub use agent::AgentId;pub use agent::AgentState;pub use agent::AgentType;pub use agent::RoleDefinition;pub use agent::SpawnMode;pub use agent::builtin_roles;pub use agent::roles;pub use app::audit::AuditEvent;pub use app::audit::AuditResult;pub use app::audit::audit_middleware;pub use app::auth::AuthError;pub use app::auth::AuthState;pub use app::auth::Principal;pub use app::auth::auth_middleware;pub use app::auth::generate_api_key;pub use app::mcp::McpState;pub use app::mcp::create_mcp_router;pub use app::rate_limit::RateLimitConfig;pub use app::rate_limit::RateLimiter;pub use app::rate_limit::rate_limit_middleware;pub use app::server::AppState;pub use app::server::ProblemDetails;pub use app::server::create_router;pub use app::services::AgentService;pub use app::services::BacklogService;pub use app::services::MessageService;pub use app::services::RecoveryService;pub use app::services::TaskService;pub use channel::Channel;pub use config::AgentConfig;pub use config::AuthConfig;pub use config::AuthMode;pub use config::Config;pub use config::MtlsConfig;pub use config::Scope;pub use config::TlsConfig;pub use config::TownhallConfig;pub use error::Error;pub use error::Result;pub use events::EventStream;pub use events::EventType;pub use events::TownEvent;pub use global_config::GlobalConfig;pub use keys::RedisKeys;pub use message::ConfirmationType;pub use message::Message;pub use message::MessageId;pub use message::MessageType;pub use message::Priority;pub use migration::HashMigrationStats;pub use migration::MigrationStats;pub use migration::migrate_json_to_hash;pub use migration::migrate_to_town_isolation;pub use migration::needs_hash_migration;pub use migration::needs_migration;pub use migration::preview_hash_migration;pub use migration::preview_migration;pub use plan::TaskEntry;pub use plan::TasksFile;pub use plan::TasksMeta;pub use redis_manager::RedisManager;pub use task::Task;pub use task::TaskId;pub use task::TaskState;pub use town::TT_DIR;pub use town::Town;
Modules§
- agent
- Agent definitions and lifecycle management.
- app
- Application services for Tinytown.
- channel
- Redis-based message passing channels.
- config
- Configuration management for tinytown.
- error
- Error types for tinytown.
- events
- Redis Stream-based event log for real-time progress.
- global_
config - Global configuration stored in ~/.tt/config.toml
- keys
- Redis key conventions for Tinytown.
- message
- Message types for inter-agent communication.
- migration
- Migration support for town isolation.
- mission
- Mission mode: autonomous multi-issue execution.
- plan
- Task planning DSL - Simple TOML-based task definitions.
- redis_
manager - Global Redis instance manager for Tinytown.
- task
- Task definitions and state management.
- town
- Town - the central orchestration hub.