Flock: Declarative Blackboard Multi-Agent OrchestrationΒΆ
Stop engineering prompts. Start declaring contracts.
Flock is a production-focused framework for orchestrating AI agents through declarative type contracts and blackboard architectureβproven patterns from distributed systems, decades of experience with microservice architectures, and classical AIβnow applied to modern LLMs.
Quick StartΒΆ
import os
import asyncio
from pydantic import BaseModel, Field
from flock import Flock, flock_type
# Define typed artifacts
@flock_type
class CodeSubmission(BaseModel):
code: str
language: str
@flock_type
class BugAnalysis(BaseModel):
bugs_found: list[str]
severity: str = Field(pattern="^(Critical|High|Medium|Low|None)$")
confidence: float = Field(ge=0.0, le=1.0)
# Create the blackboard
flock = Flock(os.getenv("DEFAULT_MODEL", "openai/gpt-4.1"))
# Agents subscribe to types (NO graph wiring!)
bug_detector = flock.agent("bug_detector").consumes(CodeSubmission).publishes(BugAnalysis)
# Run with real-time dashboard
async def main():
await flock.serve(dashboard=True)
asyncio.run(main())
Why Flock?ΒΆ
Flock makes different architectural choices than traditional multi-agent frameworks:
- β Declarative Type Contracts - No 500-line prompts, schemas define behavior
- β Blackboard Architecture - Loose coupling through type subscriptions
- β Automatic Parallelization - Concurrent execution by default
- β Built-in Security - Zero-trust visibility controls
- β Production Observability - Real-time dashboard + OpenTelemetry tracing
Key FeaturesΒΆ
Type-Safe Agent CommunicationΒΆ
@flock_type
class PatientDiagnosis(BaseModel):
condition: str = Field(min_length=10)
confidence: float = Field(ge=0.0, le=1.0)
recommended_treatment: list[str] = Field(min_length=1)
follow_up_required: bool
Zero-Trust SecurityΒΆ
# HIPAA compliance built-in
agent.publishes(MedicalRecord, visibility=PrivateVisibility(agents={"physician"}))
# Multi-tenancy
agent.publishes(CustomerData, visibility=TenantVisibility(tenant_id="customer_123"))
Real-Time DashboardΒΆ
Start the dashboard with one line:
Next StepsΒΆ
-
Getting Started
Learn how to install Flock and create your first agent
-
Tutorials
Step-by-step tutorials from basics to advanced patterns
-
User Guides
In-depth documentation on agents, blackboard, and patterns
-
API Reference
Complete API documentation for all modules
Community & SupportΒΆ
- GitHub: whiteducksoftware/flock
- PyPI: flock-core
- Issues: Report bugs & request features
- Discussions: Community discussions
**Built with β€οΈ by white duck GmbH** **Version:** 0.5.0 | **License:** MIT | **Python:** 3.10+