flock-core 0.1.1__py3-none-any.whl → 0.1.2__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.
- {flock_core-0.1.1.dist-info → flock_core-0.1.2.dist-info}/METADATA +65 -38
- {flock_core-0.1.1.dist-info → flock_core-0.1.2.dist-info}/RECORD +5 -5
- {flock_core-0.1.1.dist-info → flock_core-0.1.2.dist-info}/WHEEL +0 -0
- {flock_core-0.1.1.dist-info → flock_core-0.1.2.dist-info}/entry_points.txt +0 -0
- {flock_core-0.1.1.dist-info → flock_core-0.1.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flock-core
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: An agent framework for the age of agents
|
|
5
5
|
Author-email: Andre Ratzenberger <andre.ratzenberger@whiteduck.de>
|
|
6
6
|
License-File: LICENSE
|
|
@@ -25,19 +25,30 @@ Requires-Dist: tavily-python>=0.5.0
|
|
|
25
25
|
Requires-Dist: temporalio>=1.9.0
|
|
26
26
|
Description-Content-Type: text/markdown
|
|
27
27
|
|
|
28
|
-
#
|
|
28
|
+
# Flock by white duck
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
Wir dachten da vielleicht als Logo einfach eine Herde/Schwarm an Freds, oder ähnlich wie Huggingface an einen James Bond Fred (vgl. https://huggingface.co/docs/smolagents/en/index) oder natürlich auch gerne eine Herde an James Bond Freds!
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
White Duck Flock (engl. Herde/Schwarm) ist ein KI-gestütztes Agentenframework. Agenten sind Applikationen, die autark und autonom entscheiden, wie sie ein Problem lösen – und je nach Konfiguration auch selbst bestimmen, wie sie untereinander kommunizieren. Ein Zusammenschluss mehrerer Agenten bildet ein Agentensystem.
|
|
36
|
-
|
|
37
|
-
Als Logo dachten wir vielleicht an eine Herde/Schwarm von Freds – oder, ähnlich wie Hugging Face, an einen James-Bond-Fred (vgl. https://huggingface.co/docs/smolagents/en/index). Alternativ natürlich auch gerne eine ganze Herde an James-Bond-Freds!
|
|
30
|
+
### Declarative LLM Orchestration at Scale
|
|
38
31
|
|
|
32
|
+
<img src="docs/img/image.png" width="600">
|
|
39
33
|
|
|
34
|
+
| Traditional Agent Frameworks 🙃 | Flock 🐤🐧🐓 🦆 |
|
|
35
|
+
|-----------------------------------------|------------------------------------------------|
|
|
36
|
+
| 🤖 **Interaction Design** | 📝 **Simplified Agent Logic** |
|
|
37
|
+
| • Requires complex prompt tuning | • Straightforward input/output definitions |
|
|
38
|
+
| • Fragile and hard-to-maintain | • No need for prompt engineering |
|
|
39
|
+
| • Time-consuming adjustments | • Focused on business logic |
|
|
40
|
+
| | |
|
|
41
|
+
| 💥 **Reliability Challenges** | ⚡ **Robust & Scalable** |
|
|
42
|
+
| • Prone to single points of failure | • Built-in fault tolerance |
|
|
43
|
+
| • Lacks automatic recovery | • Automated retries & error handling |
|
|
44
|
+
| • Difficult to monitor | • Full observability & logging |
|
|
45
|
+
| | |
|
|
46
|
+
| 🏗️ **Execution Constraints** | 🔄 **Flexible Orchestration** |
|
|
47
|
+
| • Linear workflows, limited adaptability | • Dynamic and modular execution |
|
|
48
|
+
| • Lacks parallelism & batching | • Supports concurrency & batch processing |
|
|
49
|
+
| • Struggles with scaling | • Persistent state management |
|
|
40
50
|
|
|
51
|
+
## Hello, Bot
|
|
41
52
|
|
|
42
53
|
```python
|
|
43
54
|
MODEL = "openai/gpt-4o"
|
|
@@ -45,29 +56,26 @@ MODEL = "openai/gpt-4o"
|
|
|
45
56
|
async def main():
|
|
46
57
|
|
|
47
58
|
#--------------------------------
|
|
48
|
-
# Create the flock
|
|
59
|
+
# Create the flock
|
|
49
60
|
#--------------------------------
|
|
50
61
|
# The flock is the place where all the agents are at home
|
|
51
|
-
|
|
52
|
-
flock, context = Flock.create()
|
|
62
|
+
flock = Flock(model=MODEL)
|
|
53
63
|
|
|
54
64
|
#--------------------------------
|
|
55
65
|
# Create an agent
|
|
56
66
|
#--------------------------------
|
|
57
|
-
# The
|
|
58
|
-
# The
|
|
67
|
+
# The flock doesn't believe in prompts (continue reading for more info)
|
|
68
|
+
# The flock just declares what agents get in and what agents produce
|
|
59
69
|
# bloggy takes in a blog_idea and outputs a funny_blog_title and blog_headers
|
|
60
|
-
bloggy =
|
|
70
|
+
bloggy = Flock(
|
|
71
|
+
DeclarativeAgent,
|
|
61
72
|
name="bloggy",
|
|
62
73
|
input="blog_idea",
|
|
63
|
-
output="funny_blog_title, blog_headers"
|
|
64
|
-
model=MODEL
|
|
74
|
+
output="funny_blog_title, blog_headers"
|
|
65
75
|
)
|
|
66
|
-
# Let's add bloggy to the flock
|
|
67
|
-
flock.add_agent(bloggy)
|
|
68
76
|
|
|
69
77
|
#--------------------------------
|
|
70
|
-
#
|
|
78
|
+
# Let the flock do its thing
|
|
71
79
|
#--------------------------------
|
|
72
80
|
# By giving the flock a start_agent and an input, we can run the flock
|
|
73
81
|
# local_debug makes it easier to debug the flock
|
|
@@ -80,6 +88,9 @@ async def main():
|
|
|
80
88
|
# earn the fruits of the flock's labor
|
|
81
89
|
print(result)
|
|
82
90
|
|
|
91
|
+
|
|
92
|
+
# Continue reading to give your flock temporal(ly) super powers, heh.
|
|
93
|
+
|
|
83
94
|
```
|
|
84
95
|
|
|
85
96
|
Problems with other agent frameworks
|
|
@@ -88,7 +99,7 @@ Problems with other agent frameworks
|
|
|
88
99
|
- One crash and your whole agent system is dead
|
|
89
100
|
- Demand having your system be a real DAG and a real state machine
|
|
90
101
|
|
|
91
|
-
How
|
|
102
|
+
How flock tries to solve it:
|
|
92
103
|
|
|
93
104
|
- Just declare what your agents get ind, and what they should return
|
|
94
105
|
- First grade temporalio support. Retry, Error, Timeout etc etc are somethi
|
|
@@ -107,6 +118,7 @@ How does a good prompt look like? What happens with your prompt if you switch mo
|
|
|
107
118
|
With flock you just tell an agent what kind of input it gets, and what it should output. Done. Easy peasy.
|
|
108
119
|
|
|
109
120
|
The philosophy behind this approach is simple: by focusing on the interface (inputs and outputs) rather than implementation details (prompts), we create more maintainable and adaptable systems. This declarative approach means:
|
|
121
|
+
|
|
110
122
|
- Your agents are model-agnostic
|
|
111
123
|
- Behavior can be tested and validated objectively
|
|
112
124
|
- Changes are localized and predictable
|
|
@@ -115,9 +127,10 @@ The philosophy behind this approach is simple: by focusing on the interface (inp
|
|
|
115
127
|
### Testable
|
|
116
128
|
|
|
117
129
|
Reducing the need for fuzzy natural language to a minimum agents become easily testable, evaluable.
|
|
118
|
-
|
|
130
|
+
flock comes with tools to know exactly how good your agents and therefore the agent system is performing.
|
|
119
131
|
|
|
120
132
|
This focus on testability isn't just about catching bugs - it's about building confidence in your AI systems:
|
|
133
|
+
|
|
121
134
|
- Clear input/output contracts make unit testing straightforward
|
|
122
135
|
- Type safety ensures data consistency
|
|
123
136
|
- Performance metrics are built into the framework
|
|
@@ -127,9 +140,10 @@ This focus on testability isn't just about catching bugs - it's about building c
|
|
|
127
140
|
|
|
128
141
|
Would you run your agent system in critical environments? The answer is probably no, since with most frameworks one dead endpoint or uncatched exception will break the whole agent system.
|
|
129
142
|
|
|
130
|
-
|
|
143
|
+
flock uses Temporal as its workflow engine which comes with battle-hardened retry, failure, exception options.
|
|
131
144
|
|
|
132
145
|
This production-readiness is achieved through several key design decisions:
|
|
146
|
+
|
|
133
147
|
- Temporal workflow engine for durability and reliability
|
|
134
148
|
- Strong typing for predictable behavior
|
|
135
149
|
- Modular architecture for maintainability
|
|
@@ -146,20 +160,19 @@ This production-readiness is achieved through several key design decisions:
|
|
|
146
160
|
|
|
147
161
|
## Architecture and Flow
|
|
148
162
|
|
|
149
|
-

|
|
163
|
+

|
|
150
164
|
|
|
151
|
-
|
|
152
|
-

|
|
165
|
+

|
|
153
166
|
|
|
154
167
|
## Requirements
|
|
155
168
|
|
|
156
169
|
Nothing. Temporal is not needed for development but recommended
|
|
157
170
|
|
|
158
|
-
Either clone https://github.com/temporalio/docker-compose and up the compose
|
|
171
|
+
Either clone <https://github.com/temporalio/docker-compose> and up the compose
|
|
159
172
|
|
|
160
173
|
or install the temporal cli
|
|
161
174
|
|
|
162
|
-
https://docs.temporal.io/cli
|
|
175
|
+
<https://docs.temporal.io/cli>
|
|
163
176
|
|
|
164
177
|
## Installation
|
|
165
178
|
|
|
@@ -174,11 +187,11 @@ Here's a simple example of creating and using an agent:
|
|
|
174
187
|
```python
|
|
175
188
|
import asyncio
|
|
176
189
|
from flock.core.agents.declarative_agent import DeclarativeAgent
|
|
177
|
-
from flock.core.flock import
|
|
190
|
+
from flock.core.flock import flock
|
|
178
191
|
|
|
179
192
|
async def main():
|
|
180
|
-
# Initialize
|
|
181
|
-
agent_runner =
|
|
193
|
+
# Initialize flock
|
|
194
|
+
agent_runner = flock()
|
|
182
195
|
|
|
183
196
|
# Create a simple agent
|
|
184
197
|
agent = DeclarativeAgent(
|
|
@@ -204,7 +217,7 @@ if __name__ == "__main__":
|
|
|
204
217
|
|
|
205
218
|

|
|
206
219
|
|
|
207
|
-
|
|
220
|
+
flock comes with a built-in web interface for managing and monitoring your agents. The web app provides a rich, interactive environment for working with your agent systems.
|
|
208
221
|
|
|
209
222
|
TODO: Expand
|
|
210
223
|
|
|
@@ -220,7 +233,7 @@ uv run flock
|
|
|
220
233
|
### Features
|
|
221
234
|
|
|
222
235
|
- **Dashboard**: Overview of your agent systems and their status
|
|
223
|
-
- **Agent Management**:
|
|
236
|
+
- **Agent Management**:
|
|
224
237
|
- List and filter agents
|
|
225
238
|
- View agent details and configuration
|
|
226
239
|
- Monitor production readiness
|
|
@@ -234,6 +247,7 @@ uv run flock
|
|
|
234
247
|
### Technical Details
|
|
235
248
|
|
|
236
249
|
The web application is built with:
|
|
250
|
+
|
|
237
251
|
- FastHTML for UI components
|
|
238
252
|
- MonsterUI for enhanced UI elements
|
|
239
253
|
- Interactive features using D3.js and interact.js
|
|
@@ -321,9 +335,10 @@ project_plan_agent.hand_off = content_agent
|
|
|
321
335
|
|
|
322
336
|
## Core Components
|
|
323
337
|
|
|
324
|
-
###
|
|
338
|
+
### flock Class
|
|
325
339
|
|
|
326
340
|
The main orchestrator that manages agent creation and execution:
|
|
341
|
+
|
|
327
342
|
- Handles agent registration
|
|
328
343
|
- Manages workflow execution
|
|
329
344
|
- Supports both local debugging and distributed execution
|
|
@@ -331,6 +346,7 @@ The main orchestrator that manages agent creation and execution:
|
|
|
331
346
|
### DeclarativeAgent
|
|
332
347
|
|
|
333
348
|
Base class for creating agents with:
|
|
349
|
+
|
|
334
350
|
- Input/output specifications
|
|
335
351
|
- Tool integration
|
|
336
352
|
- Type validation
|
|
@@ -339,6 +355,7 @@ Base class for creating agents with:
|
|
|
339
355
|
### Workflow System
|
|
340
356
|
|
|
341
357
|
Built on Temporal for:
|
|
358
|
+
|
|
342
359
|
- Durable execution
|
|
343
360
|
- State management
|
|
344
361
|
- Error handling
|
|
@@ -347,6 +364,7 @@ Built on Temporal for:
|
|
|
347
364
|
### Tools
|
|
348
365
|
|
|
349
366
|
Built-in tools include:
|
|
367
|
+
|
|
350
368
|
- Web search (via Tavily)
|
|
351
369
|
- Math evaluation
|
|
352
370
|
- Code execution
|
|
@@ -355,14 +373,14 @@ Built-in tools include:
|
|
|
355
373
|
## Architecture
|
|
356
374
|
|
|
357
375
|
```
|
|
358
|
-
|
|
376
|
+
flock Framework
|
|
359
377
|
├── Core
|
|
360
378
|
│ ├── Agents
|
|
361
379
|
│ │ ├── DeclarativeAgent
|
|
362
380
|
│ │ └── Agent Registry
|
|
363
381
|
│ ├── Tools
|
|
364
382
|
│ │ └── Basic Tools
|
|
365
|
-
│ └──
|
|
383
|
+
│ └── flock Manager
|
|
366
384
|
├── Workflow
|
|
367
385
|
│ ├── Activities
|
|
368
386
|
│ ├── Temporal Setup
|
|
@@ -382,18 +400,21 @@ Flock Framework
|
|
|
382
400
|
### Setup
|
|
383
401
|
|
|
384
402
|
1. Clone the repository:
|
|
403
|
+
|
|
385
404
|
```bash
|
|
386
405
|
git clone https://github.com/yourusername/flock.git
|
|
387
406
|
cd flock
|
|
388
407
|
```
|
|
389
408
|
|
|
390
409
|
2. Create a virtual environment:
|
|
410
|
+
|
|
391
411
|
```bash
|
|
392
412
|
python -m venv .venv
|
|
393
413
|
source .venv/bin/activate # On Windows: .venv\Scripts\activate
|
|
394
414
|
```
|
|
395
415
|
|
|
396
416
|
3. Install dependencies:
|
|
417
|
+
|
|
397
418
|
```bash
|
|
398
419
|
pip install -e .
|
|
399
420
|
```
|
|
@@ -421,17 +442,21 @@ This project is licensed under the terms of the LICENSE file included in the rep
|
|
|
421
442
|
|
|
422
443
|
## Evolution & Future Direction
|
|
423
444
|
|
|
424
|
-
|
|
445
|
+
flock was born from the realization that current agent frameworks often prioritize flexibility at the cost of reliability and maintainability. The framework's design decisions reflect this focus:
|
|
425
446
|
|
|
426
447
|
### Why Declarative?
|
|
448
|
+
|
|
427
449
|
The declarative approach wasn't just a stylistic choice - it was a deliberate decision to separate what agents do from how they do it. This separation means:
|
|
450
|
+
|
|
428
451
|
- Agents can be optimized independently of their interface
|
|
429
452
|
- Different LLM backends can be swapped without changing agent definitions
|
|
430
453
|
- Testing and validation become straightforward
|
|
431
454
|
- Integration with existing systems is simplified
|
|
432
455
|
|
|
433
456
|
### Why Temporal?
|
|
457
|
+
|
|
434
458
|
Using Temporal as the workflow engine was crucial for production reliability:
|
|
459
|
+
|
|
435
460
|
- Automatic retry on failures
|
|
436
461
|
- Built-in state management
|
|
437
462
|
- Scalable execution
|
|
@@ -439,7 +464,9 @@ Using Temporal as the workflow engine was crucial for production reliability:
|
|
|
439
464
|
- Production-grade monitoring
|
|
440
465
|
|
|
441
466
|
### Future Plans
|
|
467
|
+
|
|
442
468
|
The framework is actively evolving with several key areas of focus:
|
|
469
|
+
|
|
443
470
|
- Enhanced type system for more complex agent interactions
|
|
444
471
|
- Expanded tool ecosystem
|
|
445
472
|
- Improved optimization capabilities
|
|
@@ -41,8 +41,8 @@ flock/workflow/activities.py,sha256=YZ0YYJTYPSmoTkpiY7x_pzwY3OpkkWm3ye9g6n-bFO4,
|
|
|
41
41
|
flock/workflow/agent_activities.py,sha256=Shwiphd5Yi3VwbQN9SCuEsuhe6zJxIn0gBwMIpRZh-8,1134
|
|
42
42
|
flock/workflow/temporal_setup.py,sha256=if3fmdy9cxoKGOZlbIfizLrZBYRGn2soMOBYLtP1mPI,1126
|
|
43
43
|
flock/workflow/workflow.py,sha256=JTWFGE2_JltOd2PPJXlYfSeBlwbTQqRKLMszVdeqia0,1813
|
|
44
|
-
flock_core-0.1.
|
|
45
|
-
flock_core-0.1.
|
|
46
|
-
flock_core-0.1.
|
|
47
|
-
flock_core-0.1.
|
|
48
|
-
flock_core-0.1.
|
|
44
|
+
flock_core-0.1.2.dist-info/METADATA,sha256=bfJrZD3pUNeIKA07tyaPR82Zu4OYCPE8AgxL7FZo5yY,14179
|
|
45
|
+
flock_core-0.1.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
46
|
+
flock_core-0.1.2.dist-info/entry_points.txt,sha256=BoHLk1jgBHMsiQNA8h6lEe8B-dcq3Hqh3sbJGSmavZs,51
|
|
47
|
+
flock_core-0.1.2.dist-info/licenses/LICENSE,sha256=eukczQf9y9W2_CLyGK-S06qMcU5zkTF39gJCjspsDA0,1093
|
|
48
|
+
flock_core-0.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|