flock-core 0.1.1__tar.gz → 0.1.2__tar.gz
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 → flock_core-0.1.2}/PKG-INFO +65 -38
- {flock_core-0.1.1 → flock_core-0.1.2}/README.md +68 -41
- flock_core-0.1.2/docs/img/image.png +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/pyproject.toml +1 -1
- {flock_core-0.1.1 → flock_core-0.1.2}/.gitignore +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/.python-version +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/.vscode/launch.json +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/.vscode/settings.json +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/.vscode/tasks.json +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/LICENSE +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/bloggy.json +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/data/history.json +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/data/mock.json +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/all.txt +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/charts/README.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/charts/agent-workflow.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/charts/architecture.drawio +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/charts/charts.drawio.png +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/charts/core-architecture.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/charts/temporal-workflow.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/charts/tool-system.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/charts/type-system.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/collect.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/collect_python_files.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/hive1.png +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/hive2.png +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/hive_out.png +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/ideas/final_review.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/ideas/integration.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/ideas/interpreter.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/ideas/optimizers.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/ideas/potential_improvements.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/ideas/predict.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/ideas/react.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/ideas/reimplementation.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/ideas/week0.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/ideas/week1.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/ideas/week2.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/ideas/week3.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/ideas/week4.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/ideas/week5.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/img/app.png +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/img/charts/agent_workflow.png +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/img/charts/agent_workflow_inv.png +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/img/charts/core_architecture.png +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/img/charts/core_architecture_inv.png +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/img/charts/tool_system.png +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/img/charts/tool_system_inv.png +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/old_schwarm_readme.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/old_schwarm_readme2.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/scratchpad.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/docs/todo.md +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/examples/jupyter_notebooks/Untitled-1.ipynb +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/examples/jupyter_notebooks/my_agent.json +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/examples/misc/01_simple_example.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/examples/misc/02_typed_output.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/examples/misc/03_tool_agent.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/examples/misc/04_tool_agent2.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/examples/misc/05_hand_off.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/examples/misc/06_chat.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/examples/misc/07_deploy_as_docker.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/examples/misc/07_deployment.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/examples/misc/08_provider.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/examples/misc/logging_examples/01_basic_logging.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/examples/misc/logging_examples/02_temporal_logging.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/examples/web/schwarm_editor/.sesskey +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/examples/web/schwarm_editor/main.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/examples/web/schwarm_editor/saves/alerts.txt +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/examples/web/schwarm_editor/scripts/editor.css +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/examples/web/schwarm_editor/scripts/editor.js +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/examples/web/schwarm_editor/templates/editor.html +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/examples/web/schwarm_editor/templates/editor2.html +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/__init__.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/agents/__init__.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/agents/batch_agent.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/agents/declarative_agent.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/agents/loop_agent.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/agents/trigger_agent.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/agents/user_agent.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/app/components/__init__.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/app/components/charts/agent_workflow.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/app/components/charts/core_architecture.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/app/components/charts/tool_system.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/app/components/history_grid.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/app/components/history_grid_alt.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/app/components/sidebar.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/app/components/theme.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/app/components/util.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/app/hive_app.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/app/html/d3.html +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/app/modules/__init__.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/app/modules/about.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/app/modules/agent_detail.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/app/modules/agent_list.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/app/modules/playground.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/app/modules/settings.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/core/__init__.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/core/agent.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/core/agent_registry.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/core/config/declarative_agent_config.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/core/context.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/core/context_vars.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/core/flock.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/core/handoff/handoff_base.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/core/logging/__init__.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/core/logging/error_handler.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/core/logging/formatters.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/core/logging/handlers.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/core/logging/logger.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/core/serializable.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/core/tools/basic_tools.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/workflow/activities.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/workflow/agent_activities.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/workflow/temporal_setup.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/src/flock/workflow/workflow.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/tests/test_agent.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/tests/test_basic.py +0 -0
- {flock_core-0.1.1 → flock_core-0.1.2}/tests/test_run_worker.py +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
|
|
@@ -1,16 +1,27 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
# Flock by white duck
|
|
2
|
+
|
|
3
|
+
### Declarative LLM Orchestration at Scale
|
|
4
|
+
|
|
5
|
+
<img src="docs/img/image.png" width="600">
|
|
6
|
+
|
|
7
|
+
| Traditional Agent Frameworks 🙃 | Flock 🐤🐧🐓 🦆 |
|
|
8
|
+
|-----------------------------------------|------------------------------------------------|
|
|
9
|
+
| 🤖 **Interaction Design** | 📝 **Simplified Agent Logic** |
|
|
10
|
+
| • Requires complex prompt tuning | • Straightforward input/output definitions |
|
|
11
|
+
| • Fragile and hard-to-maintain | • No need for prompt engineering |
|
|
12
|
+
| • Time-consuming adjustments | • Focused on business logic |
|
|
13
|
+
| | |
|
|
14
|
+
| 💥 **Reliability Challenges** | ⚡ **Robust & Scalable** |
|
|
15
|
+
| • Prone to single points of failure | • Built-in fault tolerance |
|
|
16
|
+
| • Lacks automatic recovery | • Automated retries & error handling |
|
|
17
|
+
| • Difficult to monitor | • Full observability & logging |
|
|
18
|
+
| | |
|
|
19
|
+
| 🏗️ **Execution Constraints** | 🔄 **Flexible Orchestration** |
|
|
20
|
+
| • Linear workflows, limited adaptability | • Dynamic and modular execution |
|
|
21
|
+
| • Lacks parallelism & batching | • Supports concurrency & batch processing |
|
|
22
|
+
| • Struggles with scaling | • Persistent state management |
|
|
23
|
+
|
|
24
|
+
## Hello, Bot
|
|
14
25
|
|
|
15
26
|
```python
|
|
16
27
|
MODEL = "openai/gpt-4o"
|
|
@@ -18,29 +29,26 @@ MODEL = "openai/gpt-4o"
|
|
|
18
29
|
async def main():
|
|
19
30
|
|
|
20
31
|
#--------------------------------
|
|
21
|
-
# Create the flock
|
|
32
|
+
# Create the flock
|
|
22
33
|
#--------------------------------
|
|
23
34
|
# The flock is the place where all the agents are at home
|
|
24
|
-
|
|
25
|
-
flock, context = Flock.create()
|
|
35
|
+
flock = Flock(model=MODEL)
|
|
26
36
|
|
|
27
37
|
#--------------------------------
|
|
28
38
|
# Create an agent
|
|
29
39
|
#--------------------------------
|
|
30
|
-
# The
|
|
31
|
-
# The
|
|
40
|
+
# The flock doesn't believe in prompts (continue reading for more info)
|
|
41
|
+
# The flock just declares what agents get in and what agents produce
|
|
32
42
|
# bloggy takes in a blog_idea and outputs a funny_blog_title and blog_headers
|
|
33
|
-
bloggy =
|
|
43
|
+
bloggy = Flock(
|
|
44
|
+
DeclarativeAgent,
|
|
34
45
|
name="bloggy",
|
|
35
46
|
input="blog_idea",
|
|
36
|
-
output="funny_blog_title, blog_headers"
|
|
37
|
-
model=MODEL
|
|
47
|
+
output="funny_blog_title, blog_headers"
|
|
38
48
|
)
|
|
39
|
-
# Let's add bloggy to the flock
|
|
40
|
-
flock.add_agent(bloggy)
|
|
41
49
|
|
|
42
50
|
#--------------------------------
|
|
43
|
-
#
|
|
51
|
+
# Let the flock do its thing
|
|
44
52
|
#--------------------------------
|
|
45
53
|
# By giving the flock a start_agent and an input, we can run the flock
|
|
46
54
|
# local_debug makes it easier to debug the flock
|
|
@@ -53,6 +61,9 @@ async def main():
|
|
|
53
61
|
# earn the fruits of the flock's labor
|
|
54
62
|
print(result)
|
|
55
63
|
|
|
64
|
+
|
|
65
|
+
# Continue reading to give your flock temporal(ly) super powers, heh.
|
|
66
|
+
|
|
56
67
|
```
|
|
57
68
|
|
|
58
69
|
Problems with other agent frameworks
|
|
@@ -61,7 +72,7 @@ Problems with other agent frameworks
|
|
|
61
72
|
- One crash and your whole agent system is dead
|
|
62
73
|
- Demand having your system be a real DAG and a real state machine
|
|
63
74
|
|
|
64
|
-
How
|
|
75
|
+
How flock tries to solve it:
|
|
65
76
|
|
|
66
77
|
- Just declare what your agents get ind, and what they should return
|
|
67
78
|
- First grade temporalio support. Retry, Error, Timeout etc etc are somethi
|
|
@@ -80,6 +91,7 @@ How does a good prompt look like? What happens with your prompt if you switch mo
|
|
|
80
91
|
With flock you just tell an agent what kind of input it gets, and what it should output. Done. Easy peasy.
|
|
81
92
|
|
|
82
93
|
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:
|
|
94
|
+
|
|
83
95
|
- Your agents are model-agnostic
|
|
84
96
|
- Behavior can be tested and validated objectively
|
|
85
97
|
- Changes are localized and predictable
|
|
@@ -88,9 +100,10 @@ The philosophy behind this approach is simple: by focusing on the interface (inp
|
|
|
88
100
|
### Testable
|
|
89
101
|
|
|
90
102
|
Reducing the need for fuzzy natural language to a minimum agents become easily testable, evaluable.
|
|
91
|
-
|
|
103
|
+
flock comes with tools to know exactly how good your agents and therefore the agent system is performing.
|
|
92
104
|
|
|
93
105
|
This focus on testability isn't just about catching bugs - it's about building confidence in your AI systems:
|
|
106
|
+
|
|
94
107
|
- Clear input/output contracts make unit testing straightforward
|
|
95
108
|
- Type safety ensures data consistency
|
|
96
109
|
- Performance metrics are built into the framework
|
|
@@ -100,9 +113,10 @@ This focus on testability isn't just about catching bugs - it's about building c
|
|
|
100
113
|
|
|
101
114
|
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.
|
|
102
115
|
|
|
103
|
-
|
|
116
|
+
flock uses Temporal as its workflow engine which comes with battle-hardened retry, failure, exception options.
|
|
104
117
|
|
|
105
118
|
This production-readiness is achieved through several key design decisions:
|
|
119
|
+
|
|
106
120
|
- Temporal workflow engine for durability and reliability
|
|
107
121
|
- Strong typing for predictable behavior
|
|
108
122
|
- Modular architecture for maintainability
|
|
@@ -119,20 +133,19 @@ This production-readiness is achieved through several key design decisions:
|
|
|
119
133
|
|
|
120
134
|
## Architecture and Flow
|
|
121
135
|
|
|
122
|
-

|
|
123
|
-
|
|
136
|
+

|
|
124
137
|
|
|
125
|
-

|
|
138
|
+

|
|
126
139
|
|
|
127
140
|
## Requirements
|
|
128
141
|
|
|
129
142
|
Nothing. Temporal is not needed for development but recommended
|
|
130
143
|
|
|
131
|
-
Either clone https://github.com/temporalio/docker-compose and up the compose
|
|
144
|
+
Either clone <https://github.com/temporalio/docker-compose> and up the compose
|
|
132
145
|
|
|
133
146
|
or install the temporal cli
|
|
134
147
|
|
|
135
|
-
https://docs.temporal.io/cli
|
|
148
|
+
<https://docs.temporal.io/cli>
|
|
136
149
|
|
|
137
150
|
## Installation
|
|
138
151
|
|
|
@@ -147,11 +160,11 @@ Here's a simple example of creating and using an agent:
|
|
|
147
160
|
```python
|
|
148
161
|
import asyncio
|
|
149
162
|
from flock.core.agents.declarative_agent import DeclarativeAgent
|
|
150
|
-
from flock.core.flock import
|
|
163
|
+
from flock.core.flock import flock
|
|
151
164
|
|
|
152
165
|
async def main():
|
|
153
|
-
# Initialize
|
|
154
|
-
agent_runner =
|
|
166
|
+
# Initialize flock
|
|
167
|
+
agent_runner = flock()
|
|
155
168
|
|
|
156
169
|
# Create a simple agent
|
|
157
170
|
agent = DeclarativeAgent(
|
|
@@ -177,7 +190,7 @@ if __name__ == "__main__":
|
|
|
177
190
|
|
|
178
191
|

|
|
179
192
|
|
|
180
|
-
|
|
193
|
+
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.
|
|
181
194
|
|
|
182
195
|
TODO: Expand
|
|
183
196
|
|
|
@@ -193,7 +206,7 @@ uv run flock
|
|
|
193
206
|
### Features
|
|
194
207
|
|
|
195
208
|
- **Dashboard**: Overview of your agent systems and their status
|
|
196
|
-
- **Agent Management**:
|
|
209
|
+
- **Agent Management**:
|
|
197
210
|
- List and filter agents
|
|
198
211
|
- View agent details and configuration
|
|
199
212
|
- Monitor production readiness
|
|
@@ -207,6 +220,7 @@ uv run flock
|
|
|
207
220
|
### Technical Details
|
|
208
221
|
|
|
209
222
|
The web application is built with:
|
|
223
|
+
|
|
210
224
|
- FastHTML for UI components
|
|
211
225
|
- MonsterUI for enhanced UI elements
|
|
212
226
|
- Interactive features using D3.js and interact.js
|
|
@@ -294,9 +308,10 @@ project_plan_agent.hand_off = content_agent
|
|
|
294
308
|
|
|
295
309
|
## Core Components
|
|
296
310
|
|
|
297
|
-
###
|
|
311
|
+
### flock Class
|
|
298
312
|
|
|
299
313
|
The main orchestrator that manages agent creation and execution:
|
|
314
|
+
|
|
300
315
|
- Handles agent registration
|
|
301
316
|
- Manages workflow execution
|
|
302
317
|
- Supports both local debugging and distributed execution
|
|
@@ -304,6 +319,7 @@ The main orchestrator that manages agent creation and execution:
|
|
|
304
319
|
### DeclarativeAgent
|
|
305
320
|
|
|
306
321
|
Base class for creating agents with:
|
|
322
|
+
|
|
307
323
|
- Input/output specifications
|
|
308
324
|
- Tool integration
|
|
309
325
|
- Type validation
|
|
@@ -312,6 +328,7 @@ Base class for creating agents with:
|
|
|
312
328
|
### Workflow System
|
|
313
329
|
|
|
314
330
|
Built on Temporal for:
|
|
331
|
+
|
|
315
332
|
- Durable execution
|
|
316
333
|
- State management
|
|
317
334
|
- Error handling
|
|
@@ -320,6 +337,7 @@ Built on Temporal for:
|
|
|
320
337
|
### Tools
|
|
321
338
|
|
|
322
339
|
Built-in tools include:
|
|
340
|
+
|
|
323
341
|
- Web search (via Tavily)
|
|
324
342
|
- Math evaluation
|
|
325
343
|
- Code execution
|
|
@@ -328,14 +346,14 @@ Built-in tools include:
|
|
|
328
346
|
## Architecture
|
|
329
347
|
|
|
330
348
|
```
|
|
331
|
-
|
|
349
|
+
flock Framework
|
|
332
350
|
├── Core
|
|
333
351
|
│ ├── Agents
|
|
334
352
|
│ │ ├── DeclarativeAgent
|
|
335
353
|
│ │ └── Agent Registry
|
|
336
354
|
│ ├── Tools
|
|
337
355
|
│ │ └── Basic Tools
|
|
338
|
-
│ └──
|
|
356
|
+
│ └── flock Manager
|
|
339
357
|
├── Workflow
|
|
340
358
|
│ ├── Activities
|
|
341
359
|
│ ├── Temporal Setup
|
|
@@ -355,18 +373,21 @@ Flock Framework
|
|
|
355
373
|
### Setup
|
|
356
374
|
|
|
357
375
|
1. Clone the repository:
|
|
376
|
+
|
|
358
377
|
```bash
|
|
359
378
|
git clone https://github.com/yourusername/flock.git
|
|
360
379
|
cd flock
|
|
361
380
|
```
|
|
362
381
|
|
|
363
382
|
2. Create a virtual environment:
|
|
383
|
+
|
|
364
384
|
```bash
|
|
365
385
|
python -m venv .venv
|
|
366
386
|
source .venv/bin/activate # On Windows: .venv\Scripts\activate
|
|
367
387
|
```
|
|
368
388
|
|
|
369
389
|
3. Install dependencies:
|
|
390
|
+
|
|
370
391
|
```bash
|
|
371
392
|
pip install -e .
|
|
372
393
|
```
|
|
@@ -394,17 +415,21 @@ This project is licensed under the terms of the LICENSE file included in the rep
|
|
|
394
415
|
|
|
395
416
|
## Evolution & Future Direction
|
|
396
417
|
|
|
397
|
-
|
|
418
|
+
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:
|
|
398
419
|
|
|
399
420
|
### Why Declarative?
|
|
421
|
+
|
|
400
422
|
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:
|
|
423
|
+
|
|
401
424
|
- Agents can be optimized independently of their interface
|
|
402
425
|
- Different LLM backends can be swapped without changing agent definitions
|
|
403
426
|
- Testing and validation become straightforward
|
|
404
427
|
- Integration with existing systems is simplified
|
|
405
428
|
|
|
406
429
|
### Why Temporal?
|
|
430
|
+
|
|
407
431
|
Using Temporal as the workflow engine was crucial for production reliability:
|
|
432
|
+
|
|
408
433
|
- Automatic retry on failures
|
|
409
434
|
- Built-in state management
|
|
410
435
|
- Scalable execution
|
|
@@ -412,7 +437,9 @@ Using Temporal as the workflow engine was crucial for production reliability:
|
|
|
412
437
|
- Production-grade monitoring
|
|
413
438
|
|
|
414
439
|
### Future Plans
|
|
440
|
+
|
|
415
441
|
The framework is actively evolving with several key areas of focus:
|
|
442
|
+
|
|
416
443
|
- Enhanced type system for more complex agent interactions
|
|
417
444
|
- Expanded tool ecosystem
|
|
418
445
|
- Improved optimization capabilities
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|