Stigmergy pressure-field scheduling adapter for CrewAI
Project description
stigmergy-crewai
Optimal task ordering for CrewAI crews. Declare tasks with priorities and dependencies, and stigmergy computes the best execution order using pressure signals. No manual ordering required.
5 lines to integrate. Works with your existing CrewAI agents.
Install
pip install stigmergy-crewai
Usage
from crewai import Agent
from stigmergy_crewai import StigmergyManager
# Create CrewAI agents
researcher = Agent(role="researcher", goal="Find information", llm=llm)
writer = Agent(role="writer", goal="Write content", llm=llm)
editor = Agent(role="editor", goal="Edit content", llm=llm)
# Create stigmergy manager with tasks and dependencies
manager = StigmergyManager(wake_threshold=0.4)
manager.add_task("research", agent=researcher, description="Research AI trends",
expected_output="Key findings", priority=0.8)
manager.add_task("write", agent=writer, description="Write article",
expected_output="Draft article", priority=0.6, deps=["research"])
manager.add_task("edit", agent=editor, description="Edit the draft",
expected_output="Final article", priority=0.5, deps=["write"])
# Preview execution order
print(manager.task_order) # ['research', 'write', 'edit']
# Build and run
crew = manager.build_crew(verbose=True)
result = crew.kickoff()
How It Works
Since CrewAI's Process enum is not extensible, the StigmergyManager:
- Accepts tasks with priorities and dependency graphs
- Uses pressure signals to resolve optimal execution order
- Deposits completion signals that propagate to dependent tasks
- Builds a CrewAI
Crewwith tasks in the resolved order - Uses CrewAI's
contextparameter to pass outputs between dependent tasks
Limitations
- Cannot parallelize tasks (CrewAI sequential process limitation)
- Cannot dynamically inject tasks mid-execution
- Task ordering is resolved at
build_crew()time, not runtime
For full dynamic scheduling, use the core stigmergy library directly.
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stigmergy_crewai-0.1.2.tar.gz.
File metadata
- Download URL: stigmergy_crewai-0.1.2.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
708f2313e0efc39e650373e6dffa6685931761f66fa6b1d85aad78b68c4de834
|
|
| MD5 |
af152446cae00c3ec59189e1c17b83a1
|
|
| BLAKE2b-256 |
639fcaeaf17112a0cc5b2849d3b371df934b144357fb1c2cbef40f8ff88f453b
|
File details
Details for the file stigmergy_crewai-0.1.2-py3-none-any.whl.
File metadata
- Download URL: stigmergy_crewai-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0543bcddea6ddf82c0788fa6e6851174ac1c91f1796a100d73e2bae14e8d0f61
|
|
| MD5 |
858c799727162457658330fcc48d4bdd
|
|
| BLAKE2b-256 |
708781a429665b2788800e4bb48bdf50980dee6de9df60610db1042284c7d452
|