flock-core 0.5.0b55__py3-none-any.whl → 0.5.0b56__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of flock-core might be problematic. Click here for more details.

@@ -88,12 +88,12 @@ class DuckDBSpanExporter(TelemetryExporter):
88
88
  with duckdb.connect(str(self.db_path)) as conn:
89
89
  # Delete spans older than TTL
90
90
  # Note: DuckDB doesn't support ? placeholders inside INTERVAL expressions
91
- result = conn.execute(
92
- f"""
91
+ # Safe: ttl_days is guaranteed to be an int, no injection risk
92
+ query = f"""
93
93
  DELETE FROM spans
94
94
  WHERE created_at < CURRENT_TIMESTAMP - INTERVAL '{self.ttl_days} DAYS'
95
- """
96
- )
95
+ """ # nosec B608
96
+ result = conn.execute(query)
97
97
 
98
98
  deleted_count = result.fetchall()[0][0] if result else 0
99
99
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flock-core
3
- Version: 0.5.0b55
3
+ Version: 0.5.0b56
4
4
  Summary: Add your description here
5
5
  Author-email: Andre Ratzenberger <andre.ratzenberger@whiteduck.de>
6
6
  License-File: LICENSE
@@ -34,41 +34,45 @@ Description-Content-Type: text/markdown
34
34
  <p align="center">
35
35
  <a href="https://pypi.org/project/flock-core/" target="_blank"><img alt="PyPI Version" src="https://img.shields.io/pypi/v/flock-core?style=for-the-badge&logo=pypi&label=pip%20version"></a>
36
36
  <img alt="Python Version" src="https://img.shields.io/badge/python-3.10%2B-blue?style=for-the-badge&logo=python">
37
- <a href="https://github.com/whiteducksoftware/flock/blob/master/LICENSE" target="_blank"><img alt="License" src="https://img.shields.io/pypi/l/flock-core?style=for-the-badge"></a>
37
+ <a href="LICENSE" target="_blank"><img alt="License" src="https://img.shields.io/pypi/l/flock-core?style=for-the-badge"></a>
38
38
  <a href="https://whiteduck.de" target="_blank"><img alt="Built by white duck" src="https://img.shields.io/badge/Built%20by-white%20duck%20GmbH-white?style=for-the-badge&labelColor=black"></a>
39
39
  </p>
40
40
 
41
41
  ---
42
42
 
43
- # Flock 0.5: Declarative Multi-Agent Orchestration
43
+ # Flock 0.5: Declarative Blackboard Multi-Agent Orchestration
44
44
 
45
45
  > **Stop engineering prompts. Start declaring contracts.**
46
46
 
47
- Flock is a production-focused framework for orchestrating AI agents through **declarative type contracts** and **blackboard architecture**—proven patterns from distributed systems and classical AI, now applied to modern LLMs.
47
+ Flock is a production-focused framework for orchestrating AI agents through **declarative type contracts** and **blackboard architecture**, proven patterns from distributed systems, decades of engaging with micro-service landscapes and classical AI, now applied to modern LLMs.
48
+
48
49
 
49
- **Version 0.5.0** • Production-Ready Core • 743 Tests • 77% Coverage
50
50
 
51
51
  ---
52
52
 
53
- ## The Problem With Current Frameworks
53
+ ## The Problem With Current Approaches
54
54
 
55
55
  Building production multi-agent systems today means dealing with:
56
56
 
57
57
  **🔥 Prompt Engineering Hell**
58
58
  ```python
59
- # 500-line prompt that breaks when GPT-4 becomes GPT-5
59
+
60
60
  prompt = """You are an expert code reviewer. When you receive code, you should...
61
61
  [498 more lines of instructions that the LLM ignores half the time]"""
62
+
63
+ # 500-line prompt that breaks when models update
64
+
65
+ # How do I know that there isn't an even better prompt (you don't) -> proof of 'best possible performane' impossible
62
66
  ```
63
67
 
64
- **🔥 Testing Nightmares**
68
+ **🧪 Testing Nightmares**
65
69
  ```python
66
70
  # How do you unit test this?
67
71
  result = llm.invoke(prompt) # Hope for valid JSON
68
72
  data = json.loads(result.content) # Crashes in production
69
73
  ```
70
74
 
71
- **🔥 Rigid Workflow Graphs**
75
+ **📐 Rigid topology and tight coupling**
72
76
  ```python
73
77
  # Want to add a new agent? Rewrite the entire graph.
74
78
  workflow.add_edge("agent_a", "agent_b")
@@ -76,12 +80,20 @@ workflow.add_edge("agent_b", "agent_c")
76
80
  # Add agent_d? Start rewiring...
77
81
  ```
78
82
 
79
- **🔥 No Security Model**
83
+ **💀 Single point of failure: Orchestrator dies? Everything dies.**
80
84
  ```python
81
- # Every agent sees everything. Good luck with HIPAA compliance.
85
+ # Orchestrator dies? Everything dies.
82
86
  ```
83
87
 
84
- These aren't framework limitations—they're **architectural choices** that don't scale.
88
+ **🧠 God object anti-pattern:**
89
+ ```python
90
+ # One orchestrator needs domain knowledge of 20+ agents to route correctly
91
+ # Orchestrator 'guesses' next agent based on a natural language description. Hardly fit for critical systems.
92
+ ```
93
+
94
+ These aren't framework limitations, they're **architectural choices** that don't scale.
95
+
96
+ Most issues are solvable, because decades of experience with micro services taught us hard lessons about decoupling, orchestration and reliability already. Let's use these learnings!
85
97
 
86
98
  ---
87
99
 
@@ -91,7 +103,7 @@ Flock takes a different path, combining two proven patterns:
91
103
 
92
104
  ### 1. Declarative Type Contracts (Not Prompts)
93
105
 
94
- **The old way:**
106
+ **Traditional approach:**
95
107
  ```python
96
108
  prompt = "Analyze this bug report and return JSON with severity, category, hypothesis..."
97
109
  result = llm.invoke(prompt) # Hope it works
@@ -110,6 +122,10 @@ class BugDiagnosis(BaseModel):
110
122
  agent.consumes(BugReport).publishes(BugDiagnosis)
111
123
  ```
112
124
 
125
+ <p align="center">
126
+ <img alt="Flock Banner" src="docs/img/bug_diagnosis.png" width="1000">
127
+ </p>
128
+
113
129
  **Why this matters:**
114
130
  - ✅ **Survives model upgrades** - GPT-6 will still understand Pydantic schemas
115
131
  - ✅ **Runtime validation** - Errors caught at parse time, not in production
@@ -118,7 +134,7 @@ agent.consumes(BugReport).publishes(BugDiagnosis)
118
134
 
119
135
  ### 2. Blackboard Architecture (Not Directed Graphs)
120
136
 
121
- **The old way (graph-based):**
137
+ **Graph-based approach:**
122
138
  ```python
123
139
  # Explicit workflow with hardcoded edges
124
140
  workflow.add_edge("radiologist", "diagnostician")
@@ -151,15 +167,17 @@ performance = flock.agent("perf").consumes(Scan).publishes(PerfAnalysis)
151
167
  ## Quick Start (60 Seconds)
152
168
 
153
169
  ```bash
154
- pip install flock-flow
170
+ pip install flock-core
155
171
  export OPENAI_API_KEY="sk-..."
172
+ # Optional: export DEFAULT_MODEL (falls back to hard-coded default if unset)
173
+ export DEFAULT_MODEL="openai/gpt-4.1"
156
174
  ```
157
175
 
158
176
  ```python
177
+ import os
159
178
  import asyncio
160
179
  from pydantic import BaseModel, Field
161
- from flock.orchestrator import Flock
162
- from flock.registry import flock_type
180
+ from flock import Flock, flock_type
163
181
 
164
182
  # 1. Define typed artifacts
165
183
  @flock_type
@@ -184,7 +202,7 @@ class FinalReview(BaseModel):
184
202
  action_items: list[str]
185
203
 
186
204
  # 2. Create the blackboard
187
- flock = Flock("openai/gpt-4.1")
205
+ flock = Flock(os.getenv("DEFAULT_MODEL", "openai/gpt-4.1"))
188
206
 
189
207
  # 3. Agents subscribe to types (NO graph wiring!)
190
208
  bug_detector = flock.agent("bug_detector").consumes(CodeSubmission).publishes(BugAnalysis)
@@ -290,6 +308,42 @@ agent.publishes(PublicReport, visibility=PublicVisibility())
290
308
 
291
309
  **Why this matters:** Financial services, healthcare, defense, SaaS platforms all need this for compliance. Other frameworks make you build it yourself.
292
310
 
311
+ ### Batching Pattern: Parallel Execution Control
312
+
313
+ **A key differentiator:** The separation of `publish()` and `run_until_idle()` enables parallel execution.
314
+
315
+ ```python
316
+ # ✅ EFFICIENT: Batch publish, then run in parallel
317
+ for review in customer_reviews:
318
+ await flock.publish(review) # Just scheduling work
319
+
320
+ await flock.run_until_idle() # All sentiment_analyzer agents run concurrently!
321
+
322
+ # Get all results
323
+ analyses = await flock.store.get_by_type(SentimentAnalysis)
324
+ # 100 analyses completed in ~1x single review processing time!
325
+ ```
326
+
327
+ **Why this separation matters:**
328
+ - ⚡ **Parallel execution** - Process 100 customer reviews concurrently
329
+ - 🎯 **Batch control** - Publish multiple artifacts, execute once
330
+ - 🔄 **Multi-type workflows** - Publish different types, trigger different agents in parallel
331
+ - 📊 **Better performance** - Process 1000 items in the time it takes to process 1
332
+
333
+ **Comparison to other patterns:**
334
+ ```python
335
+ # ❌ If run_until_idle() was automatic (like most frameworks):
336
+ for review in customer_reviews:
337
+ await flock.publish(review) # Would wait for completion each time!
338
+ # Total time: 100x single execution (sequential)
339
+
340
+ # ✅ With explicit batching:
341
+ for review in customer_reviews:
342
+ await flock.publish(review) # Fast: just queuing
343
+ await flock.run_until_idle()
344
+ # Total time: ~1x single execution (parallel)
345
+ ```
346
+
293
347
  ### Production Safety Features
294
348
 
295
349
  **Built-in safeguards prevent common production failures:**
@@ -317,6 +371,92 @@ agent.best_of(150, ...) # ⚠️ Warns: "best_of(150) is very high - high LLM c
317
371
 
318
372
  ## Production-Ready Observability
319
373
 
374
+ ### Real-Time Dashboard
375
+
376
+ **Start the dashboard with one line:**
377
+
378
+ ```python
379
+ await flock.serve(dashboard=True)
380
+ ```
381
+
382
+ The dashboard provides comprehensive real-time visibility into your agent system with professional UI/UX:
383
+
384
+ <p align="center">
385
+ <img alt="Flock Agent View" src="docs/img/flock_ui_agent_view.png" width="1000">
386
+ <i>Agent View: See agent communication patterns and message flows in real-time</i>
387
+ </p>
388
+
389
+ **Key Features:**
390
+
391
+ - **Dual Visualization Modes:**
392
+ - **Agent View** - Agents as nodes with message flows as edges
393
+ - **Blackboard View** - Messages as nodes with data transformations as edges
394
+
395
+ <p align="center">
396
+ <img alt="Flock Blackboard View" src="docs/img/flock_ui_blackboard_view.png" width="1000">
397
+ <i>Blackboard View: Track data lineage and transformations across the system</i>
398
+ </p>
399
+
400
+ - **Real-Time Updates:**
401
+ - WebSocket streaming with 2-minute heartbeat
402
+ - Live agent activation and message publication
403
+ - Auto-layout with Dagre algorithm
404
+
405
+ - **Interactive Graph:**
406
+ - Drag nodes, zoom, pan, and explore topology
407
+ - Double-click nodes to open detail windows
408
+ - Right-click for context menu and modules
409
+
410
+ - **Advanced Filtering:**
411
+ - Correlation ID tracking for workflow tracing
412
+ - Time range filtering (last 5/10/60 minutes or custom)
413
+ - Active filter pills with one-click removal
414
+ - Autocomplete search with metadata preview
415
+
416
+ - **Control Panel:**
417
+ - Publish artifacts from the UI
418
+ - Invoke agents manually
419
+ - Monitor system health
420
+
421
+ - **Keyboard Shortcuts:**
422
+ - `Ctrl+M` - Toggle view mode
423
+ - `Ctrl+F` - Focus filter
424
+ - `Ctrl+/` - Show shortcuts help
425
+ - WCAG 2.1 AA compliant accessibility
426
+
427
+ ### Production-Grade Trace Viewer
428
+
429
+ The dashboard includes a **Jaeger-style trace viewer** with 7 powerful visualization modes:
430
+
431
+ <p align="center">
432
+ <img alt="Trace Viewer" src="docs/img/trace_1.png" width="1000">
433
+ <i>Trace Viewer: Timeline view showing span hierarchies and execution flow</i>
434
+ </p>
435
+
436
+ **7 Trace Viewer Modes:**
437
+
438
+ 1. **Timeline** - Waterfall visualization with parent-child relationships
439
+ 2. **Statistics** - Sortable table view with durations and error tracking
440
+ 3. **RED Metrics** - Rate, Errors, Duration monitoring for service health
441
+ 4. **Dependencies** - Service-to-service communication analysis
442
+ 5. **DuckDB SQL** - Interactive SQL query editor with CSV export
443
+ 6. **Configuration** - Real-time service/operation filtering
444
+ 7. **Guide** - Built-in documentation and query examples
445
+
446
+ **Additional Features:**
447
+
448
+ - **Full I/O Capture** - Complete input/output data for every operation
449
+ - **JSON Viewer** - Collapsible tree structure with expand all/collapse all
450
+ - **Multi-Trace Support** - Open and compare multiple traces simultaneously
451
+ - **Smart Sorting** - Sort by date, span count, or duration
452
+ - **CSV Export** - Download query results for offline analysis
453
+
454
+ <p align="center">
455
+ <img alt="Trace Viewer" src="docs/img/trace_2.png" width="1000">
456
+ <i>Trace Viewer: Dependency Analysis</i>
457
+ </p>
458
+
459
+
320
460
  ### OpenTelemetry + DuckDB Tracing
321
461
 
322
462
  **One environment variable enables comprehensive tracing:**
@@ -365,67 +505,71 @@ AI: [queries DuckDB]
365
505
 
366
506
  **Why DuckDB?** 10-100x faster than SQLite for analytical queries. Zero configuration. AI agents can debug your AI agents.
367
507
 
368
- ### Real-Time Dashboard
369
-
370
- ```python
371
- await flock.serve(dashboard=True)
372
- ```
373
-
374
- - **Dual visualization modes:** Agent View vs Blackboard View
375
- - **WebSocket streaming:** Live updates with 2-minute heartbeat
376
- - **Control panel:** Publish artifacts and invoke agents from UI
377
- - **7 trace viewer modes:** Timeline, Statistics, RED metrics, Dependencies, SQL, Config, Guide
378
- - **Full I/O capture:** Complete input/output data with collapsible JSON viewer
379
- - **Keyboard shortcuts:** WCAG 2.1 AA compliant accessibility
508
+ <p align="center">
509
+ <img alt="Trace Viewer" src="docs/img/trace_3.png" width="1000">
510
+ <i>Trace Viewer: DuckDB Query</i>
511
+ </p>
380
512
 
381
513
  ---
382
514
 
383
515
  ## Framework Comparison
384
516
 
517
+ ### Architectural Differences
518
+
519
+ Flock uses a fundamentally different coordination pattern than most multi-agent frameworks:
520
+
521
+ | Dimension | Graph-Based Frameworks | Chat-Based Frameworks | Flock (Blackboard) |
522
+ |-----------|------------------------|----------------------|-------------------|
523
+ | **Core Pattern** | Directed graph with explicit edges | Round-robin conversation | Blackboard subscriptions |
524
+ | **Coordination** | Manual edge wiring | Message passing | Type-based subscriptions |
525
+ | **Parallelism** | Manual (split/join nodes) | Sequential turn-taking | Automatic (concurrent consumers) |
526
+ | **Type Safety** | Varies (often TypedDict) | Text-based messages | Pydantic + runtime validation |
527
+ | **Coupling** | Tight (hardcoded successors) | Medium (conversation context) | Loose (type subscriptions only) |
528
+ | **Adding Agents** | Rewrite graph topology | Update conversation flow | Just subscribe to types |
529
+ | **Testing** | Requires full graph | Requires full group | Individual agent isolation |
530
+ | **Security Model** | DIY implementation | DIY implementation | Built-in (5 visibility types) |
531
+ | **Scalability** | O(n²) edge complexity | Limited by turn-taking | O(n) subscription complexity |
532
+
385
533
  ### When Flock Wins
386
534
 
387
535
  **✅ Use Flock when you need:**
388
536
 
389
- | Requirement | Why Flock | Alternative Challenge |
390
- |-------------|-----------|----------------------|
391
- | **Parallel agent execution** | Automatic - agents consuming same type run concurrently | Graph frameworks require manual coordination; chat frameworks are typically sequential |
392
- | **Type-safe outputs** | Pydantic validation at runtime | Most use TypedDict (no validation) or text-based outputs |
393
- | **Zero prompt engineering** | Schemas define behavior | Most require extensive manual prompts |
394
- | **Adding agents dynamically** | Just subscribe to types | Graph frameworks require rewiring; others need flow updates |
395
- | **Testing in isolation** | Unit test individual agents | Most require full workflow setup for testing |
396
- | **Security/access control** | 5 visibility types built-in | DIY implementation in most frameworks |
397
- | **10+ agents** | O(n) complexity, stays clean | Graph-based approaches have O(n²) edge complexity |
537
+ - **Parallel agent execution** - Agents consuming the same type run concurrently automatically
538
+ - **Type-safe outputs** - Pydantic validation catches errors at runtime
539
+ - **Minimal prompt engineering** - Schemas define behavior, not natural language
540
+ - **Dynamic agent addition** - Subscribe new agents without rewiring existing workflows
541
+ - **Testing in isolation** - Unit test individual agents with mock inputs
542
+ - **Built-in security** - 5 visibility types for compliance (HIPAA, SOC2, multi-tenancy)
543
+ - **10+ agents** - Linear complexity stays manageable at scale
398
544
 
399
545
  ### When Alternatives Win
400
546
 
401
- **⚠️ Consider LangGraph when:**
402
- - You need **extensive ecosystem integration** (LangChain tools, LangSmith debugging)
403
- - Your workflow is **inherently sequential** (no parallelism needed)
404
- - You want **battle-tested maturity** (LangGraph is 1.0+, Flock is 0.5.0)
405
- - You need **extensive documentation** and large community
406
-
407
- **⚠️ Consider AutoGen when:**
408
- - You need **Microsoft ecosystem** integration (Azure, Office)
409
- - You prefer **chat-based development patterns** for agent interaction
410
- - Your team has existing **AutoGen expertise**
411
- - You need features specific to the AutoGen ecosystem
412
-
413
- ### Honest Architectural Comparison
414
-
415
- | Dimension | Flock | LangGraph | AutoGen (v0.2) | AutoGen (v0.4) |
416
- |-----------|-------|-----------|---------------|----------------|
417
- | **Core Pattern** | Blackboard subscriptions | Directed graph | Round-robin chat | Agent graphs |
418
- | **Parallelism** | Automatic | Manual (Send API) | No | Manual |
419
- | **Type Safety** | Pydantic + validation | TypedDict | Text-based | Typed messages |
420
- | **Coupling** | Loose (types) | Tight (edges) | Medium (conversation) | Medium (graph) |
421
- | **Prompt Engineering** | Zero (declarative) | Required | Required | Required |
422
- | **Add Agent** | Subscribe to type | Rewrite graph | Update flow | Update graph |
423
- | **Maturity** | 0.5.0 (early) | 1.0+ (mature) | 1.0+ (mature) | 0.4+ (evolving) |
424
- | **Community** | Small | Large | Large | Growing |
425
- | **Testing** | Isolated agents | Full graph | Full group | Graph/agents |
426
- | **Security** | Built-in (5 types) | DIY | DIY | DIY |
427
-
428
- **Bottom line:** Different architectures for different needs. Flock trades ecosystem maturity for better scalability patterns. Choose based on your priorities.
547
+ **⚠️ Consider graph-based frameworks when:**
548
+ - You need extensive ecosystem integration with existing tools
549
+ - Your workflow is inherently sequential (no parallelism needed)
550
+ - You want battle-tested maturity (larger communities, more documentation)
551
+ - Your team has existing expertise with those frameworks
552
+
553
+ **⚠️ Consider chat-based frameworks when:**
554
+ - You prefer conversation-based development patterns
555
+ - Your use case maps naturally to turn-taking dialogue
556
+ - You need features specific to those ecosystems
557
+
558
+ ### Honest Trade-offs
559
+
560
+ **You trade:**
561
+ - Ecosystem maturity (established frameworks have larger communities)
562
+ - Extensive documentation (we're catching up)
563
+ - Battle-tested age (newer architecture means less production history)
564
+
565
+ **You gain:**
566
+ - Better scalability (O(n) vs O() complexity)
567
+ - Type safety (runtime validation vs hope)
568
+ - Cleaner architecture (loose coupling vs tight graphs)
569
+ - Production safety (circuit breakers, feedback prevention built-in)
570
+ - Security model (5 visibility types vs DIY)
571
+
572
+ **Different frameworks for different priorities. Choose based on what matters to your team.**
429
573
 
430
574
  ---
431
575
 
@@ -434,7 +578,7 @@ await flock.serve(dashboard=True)
434
578
  ### What Works Today (v0.5.0)
435
579
 
436
580
  **✅ Production-ready core:**
437
- - 743 tests, 77% coverage (86-100% on critical paths)
581
+ - more than 700 tests, with >75% coverage (>90% on critical paths)
438
582
  - Blackboard orchestrator with typed artifacts
439
583
  - Parallel + sequential execution (automatic)
440
584
  - Zero-trust security (5 visibility types)
@@ -443,13 +587,16 @@ await flock.serve(dashboard=True)
443
587
  - Real-time dashboard with 7-mode trace viewer
444
588
  - MCP integration (Model Context Protocol)
445
589
  - Best-of-N execution, batch processing, join operations
590
+ - Type-safe retrieval API (`get_by_type()`)
446
591
 
447
592
  **⚠️ What's missing for large-scale production:**
448
- - **Persistent blackboard** - Currently in-memory only (Redis/Postgres coming Q1 2025)
449
- - **Advanced retry logic** - Basic only (exponential backoff + dead letter queue coming Q1 2025)
450
- - **Event replay** - No Kafka integration yet (coming Q2 2025)
451
- - **Kubernetes-native deployment** - No Helm chart yet (coming Q2 2025)
452
- - **OAuth/RBAC** - Dashboard has no auth (coming Q2 2025)
593
+ - **Persistent blackboard** - Currently in-memory only
594
+ - **Advanced retry logic** - Basic only
595
+ - **Event replay** - No Kafka integration yet
596
+ - **Kubernetes-native deployment** - No Helm chart yet
597
+ - **OAuth/RBAC** - Dashboard has no auth
598
+
599
+ All planned for v1.0
453
600
 
454
601
  ### Recommended Use Cases Today
455
602
 
@@ -471,34 +618,94 @@ await flock.serve(dashboard=True)
471
618
 
472
619
  ## Roadmap to 1.0
473
620
 
474
- See [ROADMAP.md](ROADMAP.md) for detailed timeline. Key milestones:
475
-
476
- **Q1 2025: Production Hardening**
477
- - Redis/Postgres persistence
478
- - Advanced retry & error handling (exponential backoff, circuit breakers per-agent, dead letter queues)
479
- - Aggregation patterns (map-reduce, voting, consensus)
480
-
481
- **Q2 2025: Enterprise Infrastructure**
482
- - Kafka event backbone (replay, time-travel debugging)
483
- - Kubernetes-native deployment (Helm charts, auto-scaling)
484
- - OAuth/RBAC (multi-tenant auth)
485
-
486
- **Q3 2025: Advanced Orchestration**
487
- - Human-in-the-loop approval patterns
488
- - Fan-out/fan-in workflows
489
- - Time-based scheduling (cron triggers, sliding windows)
490
-
491
- **Target: v1.0 by Q3 2025**
621
+ We're not building a toy framework. We're building enterprise infrastructure for AI agents.
622
+
623
+ **See [ROADMAP.md](ROADMAP.md) for the complete roadmap with detailed code examples.**
624
+
625
+ ### Flock 1.0 - Q4 2025 Release
626
+
627
+ **We're confident to deliver all enterprise features by Q4 2025:**
628
+
629
+ **🏢 Enterprise Persistence**
630
+ - Redis and PostgreSQL backends for durable blackboard state
631
+ - Agent crashes? State persists, agents resume automatically
632
+ - Multi-region deployments with shared blackboard
633
+ - SQL queries on artifact history for analytics and compliance
634
+
635
+ **🔄 Advanced Error Handling**
636
+ - Exponential backoff with jitter for transient failures
637
+ - Dead letter queues for poison messages
638
+ - Per-agent circuit breakers with auto-recovery
639
+ - Full observability of all failure modes
640
+
641
+ **🤝 Aggregation Patterns**
642
+ - Map-reduce pattern for parallel processing → aggregation
643
+ - Voting/consensus for multi-agent decision making
644
+ - Best-result selection with custom scoring functions
645
+
646
+ **📨 Kafka Event Backbone**
647
+ - Event replay for debugging production issues in development
648
+ - Time-travel debugging with checkpoint restoration
649
+ - Immutable audit logs for regulatory compliance
650
+ - Backfill new agents with historical data
651
+
652
+ **☸️ Kubernetes-Native Deployment**
653
+ - Helm charts for production deployments
654
+ - Horizontal auto-scaling based on blackboard queue depth
655
+ - Zero-downtime deployments with health checks
656
+ - Production-grade readiness probes
657
+
658
+ **🔐 OAuth/RBAC**
659
+ - OAuth2/OIDC authentication for multi-tenant SaaS
660
+ - API key authentication for programmatic access
661
+ - Role-based access control with agent-level permissions
662
+ - Complete audit trails for compliance (SOC2, HIPAA)
663
+
664
+ **👤 Human-in-the-Loop**
665
+ - Approval patterns for high-value transactions
666
+ - Dashboard integration for pending approvals
667
+ - Slack/email notifications with audit trails
668
+ - Training mode with review-before-automation
669
+
670
+ **🔀 Fan-Out/Fan-In Patterns**
671
+ - Dynamic work distribution based on runtime data
672
+ - Result collection and aggregation
673
+ - Map-reduce over LLM operations
674
+ - Sharding for horizontal scale
675
+
676
+ **⏰ Time-Based Scheduling**
677
+ - Cron-like triggers for periodic workflows
678
+ - Sliding window patterns for real-time analytics
679
+ - Hybrid event+time based triggers
680
+ - SLA monitoring and data freshness checks
681
+
682
+ ### Release Criteria for v1.0
683
+
684
+ **v1.0 will ship when all of these are complete:**
685
+ 1. ✅ Production persistence (Redis + Postgres backends stable)
686
+ 2. ✅ Advanced error handling (retry, circuit breakers, DLQ working)
687
+ 3. ✅ Aggregation patterns (map-reduce, voting, consensus implemented)
688
+ 4. ✅ Kafka event backbone (replay and time-travel debugging)
689
+ 5. ✅ Kubernetes native (Helm chart with auto-scaling)
690
+ 6. ✅ Authentication (OAuth/OIDC + API key auth)
691
+ 7. ✅ Human-in-the-loop (approval patterns implemented)
692
+ 8. ✅ Fan-out/fan-in (distributed processing patterns)
693
+ 9. ✅ Time-based scheduling (cron + sliding windows)
694
+ 10. ✅ 85%+ test coverage (1000+ tests passing)
695
+ 11. ✅ Production validation (deployed at 3+ companies)
696
+
697
+ **Target Date:** Q4 2025
492
698
 
493
699
  ---
494
700
 
495
701
  ## Example: Multi-Modal Clinical Decision Support
496
702
 
497
703
  ```python
498
- from flock.orchestrator import Flock
499
- from flock.visibility import PrivateVisibility, TenantVisibility
704
+ import os
705
+ from flock import Flock, flock_type
706
+ from flock.visibility import PrivateVisibility, TenantVisibility, LabelledVisibility
707
+ from flock.identity import AgentIdentity
500
708
  from pydantic import BaseModel
501
- from flock.registry import flock_type
502
709
 
503
710
  @flock_type
504
711
  class PatientScan(BaseModel):
@@ -522,7 +729,7 @@ class Diagnosis(BaseModel):
522
729
  confidence: float
523
730
 
524
731
  # Create HIPAA-compliant blackboard
525
- flock = Flock("openai/gpt-4.1")
732
+ flock = Flock(os.getenv("DEFAULT_MODEL", "openai/gpt-4.1"))
526
733
 
527
734
  # Radiologist with privacy controls
528
735
  radiologist = (
@@ -575,11 +782,73 @@ async with flock.traced_run("patient_123_diagnosis"):
575
782
 
576
783
  ---
577
784
 
785
+ ## Production Use Cases
786
+
787
+ Flock's architecture shines in production scenarios requiring parallel execution, security, and observability. Here are common patterns:
788
+
789
+ ### Financial Services: Multi-Signal Trading
790
+
791
+ **The Challenge:** Analyze multiple market signals in parallel, correlate them within time windows, maintain SEC-compliant audit trails.
792
+
793
+ **The Solution:** 20+ signal analyzers run concurrently, join operations correlate signals, DuckDB provides complete audit trails.
794
+
795
+ ```python
796
+ # Parallel signal analyzers
797
+ volatility = flock.agent("volatility").consumes(MarketData).publishes(VolatilityAlert)
798
+ sentiment = flock.agent("sentiment").consumes(NewsArticle).publishes(SentimentAlert)
799
+
800
+ # Trade execution waits for CORRELATED signals (within 5min window)
801
+ trader = flock.agent("trader").consumes(
802
+ VolatilityAlert, SentimentAlert,
803
+ join=JoinSpec(within=timedelta(minutes=5))
804
+ ).publishes(TradeOrder)
805
+ ```
806
+
807
+ ### Healthcare: HIPAA-Compliant Diagnostics
808
+
809
+ **The Challenge:** Multi-modal data fusion with strict access controls, complete audit trails, zero-trust security.
810
+
811
+ **The Solution:** Built-in visibility controls for HIPAA compliance, automatic parallel execution, full data lineage tracking.
812
+
813
+ ```python
814
+ # Privacy controls built-in
815
+ radiology.publishes(XRayAnalysis, visibility=PrivateVisibility(agents={"diagnostician"}))
816
+ lab.publishes(LabResults, visibility=TenantVisibility(tenant_id="patient_123"))
817
+
818
+ # Diagnostician waits for BOTH inputs with role-based access
819
+ diagnostician = flock.agent("diagnostician").consumes(XRayAnalysis, LabResults).publishes(Diagnosis)
820
+ ```
821
+
822
+ ### E-Commerce: 50-Agent Personalization
823
+
824
+ **The Challenge:** Analyze dozens of independent signals, support dynamic signal addition, process millions of events daily.
825
+
826
+ **The Solution:** O(n) scaling to 50+ analyzers, batch processing for efficiency, zero graph rewiring when adding signals.
827
+
828
+ ```python
829
+ # 50+ signal analyzers (all run in parallel!)
830
+ for signal in ["browsing", "purchase", "cart", "reviews", "email", "social"]:
831
+ flock.agent(f"{signal}_analyzer").consumes(UserEvent).publishes(Signal)
832
+
833
+ # Recommender batches signals for efficient LLM calls
834
+ recommender = flock.agent("recommender").consumes(Signal, batch=BatchSpec(size=50))
835
+ ```
836
+
837
+ ### Multi-Tenant SaaS: Content Moderation
838
+
839
+ **The Challenge:** Complete data isolation between tenants, multi-agent consensus, full audit trails.
840
+
841
+ **The Solution:** Tenant visibility ensures zero cross-tenant leakage, parallel checks provide diverse signals, traces show complete reasoning.
842
+
843
+ **See [USECASES.md](USECASES.md) for complete code examples and production metrics.**
844
+
845
+ ---
846
+
578
847
  ## Getting Started
579
848
 
580
849
  ```bash
581
850
  # Install
582
- pip install flock-flow
851
+ pip install flock-core
583
852
 
584
853
  # Set API key
585
854
  export OPENAI_API_KEY="sk-..."
@@ -591,18 +860,16 @@ uv run python examples/05-claudes-workshop/lesson_01_code_detective.py
591
860
  ```
592
861
 
593
862
  **Learn by doing:**
594
- - 📚 [7-Lesson Workshop](examples/05-claudes-workshop/) - Progressive lessons from basics to advanced
595
- - 🎯 [Declarative Basics](examples/01-the-declarative-way/) - Understanding declarative programming
596
- - 🗂️ [Blackboard Workflows](examples/02-the-blackboard/) 🚧 - Parallel and sequential execution patterns *(coming soon)*
597
- - 📊 [Dashboard UI](examples/03-the-dashboard/) 🚧 - Real-time visualization *(coming soon)*
598
- - 🔌 [REST API](examples/04-the-api/) 🚧 - API integration examples *(coming soon)*
863
+ - 📚 [7-Lesson Workshop](examples/05-claudes-workshop/) - Progressive lessons from basics to advanced
864
+ - 🆚 [The Blackboard](examples/02-the-blackboard/) - See data-driven orchestration without graphs
865
+ - 🎯 [Declarative Basics](examples/01-the-declarative-way/) - Understanding declarative programming
599
866
  - 📖 [Documentation](AGENTS.md) - Complete development guide
600
867
 
601
868
  ---
602
869
 
603
870
  ## Contributing
604
871
 
605
- We're building Flock in the open. See [AGENTS.md](AGENTS.md) for development setup.
872
+ We're building Flock in the open. See [CONTRIBUTING.md](CONTRIBUTING.md) and [AGENTS.md](AGENTS.md) for development setup.
606
873
 
607
874
  **We welcome:**
608
875
  - Bug reports and feature requests
@@ -611,10 +878,9 @@ We're building Flock in the open. See [AGENTS.md](AGENTS.md) for development set
611
878
  - Architecture discussions
612
879
 
613
880
  **Quality standards:**
614
- - All tests must pass (743 currently)
615
- - Coverage requirements met (77%+ overall, 86-100% critical paths)
881
+ - All tests must pass
882
+ - Coverage requirements met
616
883
  - Code formatted with Ruff
617
- - Type checking passes (mypy)
618
884
 
619
885
  ---
620
886
 
@@ -622,12 +888,12 @@ We're building Flock in the open. See [AGENTS.md](AGENTS.md) for development set
622
888
 
623
889
  We're calling this 0.5 to signal:
624
890
 
625
- 1. **Core is production-ready** - 743 tests, real-world deployments, comprehensive features
891
+ 1. **Core is production-ready** - real-world client deployments, comprehensive features
626
892
  2. **Ecosystem is evolving** - Documentation growing, community building, features maturing
627
893
  3. **Architecture is proven** - Blackboard pattern is 50+ years old, declarative contracts are sound
628
894
  4. **Enterprise features are coming** - Persistence, auth, Kubernetes deployment in roadmap
629
895
 
630
- **1.0 will arrive** when we've delivered persistence, advanced error handling, and enterprise deployment patterns (targeting Q3 2025).
896
+ **1.0 will arrive** when we've delivered persistence, advanced error handling, and enterprise deployment patterns (targeting Q4 2025).
631
897
 
632
898
  ---
633
899
 
@@ -664,7 +930,7 @@ We're calling this 0.5 to signal:
664
930
 
665
931
  **Built with ❤️ by white duck GmbH**
666
932
 
667
- **"Agents are microservices. The blackboard is their API."**
933
+ **"Declarative contracts eliminate prompt hell. Blackboard architecture eliminates graph spaghetti. Proven patterns applied to modern LLMs."**
668
934
 
669
935
  [⭐ Star on GitHub](https://github.com/whiteducksoftware/flock-flow) | [📖 Read the Docs](AGENTS.md) | [🚀 Try Examples](examples/) | [💼 Enterprise Support](mailto:support@whiteduck.de)
670
936
 
@@ -675,7 +941,3 @@ We're calling this 0.5 to signal:
675
941
  **Last Updated:** October 8, 2025
676
942
  **Version:** Flock 0.5.0 (Blackboard Edition)
677
943
  **Status:** Production-Ready Core, Enterprise Features Roadmapped
678
-
679
- ---
680
-
681
- **"Declarative contracts eliminate prompt hell. Blackboard architecture eliminates graph spaghetti. Proven patterns applied to modern LLMs."**
@@ -148,7 +148,7 @@ flock/logging/formatters/themed_formatter.py,sha256=idnv8-QAy9UxgOE4g33bUGzoToVy
148
148
  flock/logging/formatters/themes.py,sha256=80BRJJB0LZr11N0yQw2f8vdb_9179qjQO8PoeBaLMN0,10680
149
149
  flock/logging/span_middleware/baggage_span_processor.py,sha256=gJfRl8FeB6jdtghTaRHCrOaTo4fhPMRKgjqtZj-8T48,1118
150
150
  flock/logging/telemetry_exporter/base_exporter.py,sha256=T8l7GwjIulc2KbkgmhJbQ_psrLNwTGNSi23jvw6MKVA,1205
151
- flock/logging/telemetry_exporter/duckdb_exporter.py,sha256=ETQS8EzY9i-W0v18FIszdAGi9OdQ2Lf6o8bJzflC60A,8437
151
+ flock/logging/telemetry_exporter/duckdb_exporter.py,sha256=MoFFsAb-twZF9ZAB0s8TOJ8nwxtoLGmbp7m_YCWQ4AA,8522
152
152
  flock/logging/telemetry_exporter/file_exporter.py,sha256=uTgQZSKfbLjzypirBbiVnccaKBDkiRzhFvUdV26pKEY,3126
153
153
  flock/logging/telemetry_exporter/sqlite_exporter.py,sha256=754G8s4X-JHHpCdoNydJnPX4NZijZk9URutfPWFIT7s,3479
154
154
  flock/mcp/__init__.py,sha256=QuANhTz09E2fFhtp2yJ716WxXKwEpCMTGqHj54VRs2Q,2512
@@ -508,8 +508,8 @@ flock/themes/zenburned.toml,sha256=UEmquBbcAO3Zj652XKUwCsNoC2iQSlIh-q5c6DH-7Kc,1
508
508
  flock/themes/zenwritten-dark.toml,sha256=-dgaUfg1iCr5Dv4UEeHv_cN4GrPUCWAiHSxWK20X1kI,1663
509
509
  flock/themes/zenwritten-light.toml,sha256=G1iEheCPfBNsMTGaVpEVpDzYBHA_T-MV27rolUYolmE,1666
510
510
  flock/utility/output_utility_component.py,sha256=yVHhlIIIoYKziI5UyT_zvQb4G-NsxCTgLwA1wXXTTj4,9047
511
- flock_core-0.5.0b55.dist-info/METADATA,sha256=cXXsMUIUvfqgQ2qP2btsVoXWRvRdAgHGaRea9v7aMNA,22999
512
- flock_core-0.5.0b55.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
513
- flock_core-0.5.0b55.dist-info/entry_points.txt,sha256=UQdPmtHd97gSA_IdLt9MOd-1rrf_WO-qsQeIiHWVrp4,42
514
- flock_core-0.5.0b55.dist-info/licenses/LICENSE,sha256=U3IZuTbC0yLj7huwJdldLBipSOHF4cPf6cUOodFiaBE,1072
515
- flock_core-0.5.0b55.dist-info/RECORD,,
511
+ flock_core-0.5.0b56.dist-info/METADATA,sha256=BU-uf938Ij4swNJlk6MSpyTrgisSL4fECmkH6wDQgd8,32490
512
+ flock_core-0.5.0b56.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
513
+ flock_core-0.5.0b56.dist-info/entry_points.txt,sha256=UQdPmtHd97gSA_IdLt9MOd-1rrf_WO-qsQeIiHWVrp4,42
514
+ flock_core-0.5.0b56.dist-info/licenses/LICENSE,sha256=U3IZuTbC0yLj7huwJdldLBipSOHF4cPf6cUOodFiaBE,1072
515
+ flock_core-0.5.0b56.dist-info/RECORD,,