Skip to main content

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:

  1. Accepts tasks with priorities and dependency graphs
  2. Uses pressure signals to resolve optimal execution order
  3. Deposits completion signals that propagate to dependent tasks
  4. Builds a CrewAI Crew with tasks in the resolved order
  5. Uses CrewAI's context parameter 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

stigmergy_crewai-0.1.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stigmergy_crewai-0.1.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file stigmergy_crewai-0.1.1.tar.gz.

File metadata

  • Download URL: stigmergy_crewai-0.1.1.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

Hashes for stigmergy_crewai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c4201e7cd5c7c4c93986a33a543ea1894793deb81ec02c9875615a9ca44e8fa9
MD5 cb91827c879a64c3bb8d6c1b33ca9b06
BLAKE2b-256 9b8d067e7e51ff26f7d61f07c303624f40570c5c3318f0e9ee61058ca0a7e58f

See more details on using hashes here.

File details

Details for the file stigmergy_crewai-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for stigmergy_crewai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4ba351545f4848ecf1130e9e7a468ef0e0cd9045c9a76baad0d0e61c241339b9
MD5 b15d11849466c1ee09f6b0fd62e69de8
BLAKE2b-256 704fd6576c71b26f326458056d436cc4c17a932f88e9e7666389e1ace1564011

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page