Skip to main content

Stigmergy pressure-field scheduling adapter for AutoGen

Project description

stigmergy-autogen

Replace AutoGen's LLM-based speaker selection with deterministic pressure signals. Stop paying for an LLM call every time you need to pick who speaks next. Tasks, priorities, and dependencies drive selection instead.

One-line integration with AutoGen v0.7+ SelectorGroupChat.

Install

pip install stigmergy-autogen

Usage

from autogen_agentchat.agents import AssistantAgent
from autogen_agentchat.teams import SelectorGroupChat
from stigmergy_autogen import StigmergySpeakerSelector

# Create AutoGen agents
researcher = AssistantAgent("researcher", model_client=model_client)
analyst = AssistantAgent("analyst", model_client=model_client)
writer = AssistantAgent("writer", model_client=model_client)

# Create stigmergy selector with tasks and dependencies
selector = StigmergySpeakerSelector(wake_threshold=0.4)
selector.register_task("research", agent_name="researcher", priority=0.8)
selector.register_task("analyze", agent_name="analyst", priority=0.6, deps=["research"])
selector.register_task("write", agent_name="writer", priority=0.5, deps=["analyze"])

# Use as SelectorGroupChat selector_func
team = SelectorGroupChat(
    participants=[researcher, analyst, writer],
    model_client=model_client,
    selector_func=selector.select_speaker,
)

result = await team.run(task="Begin research on AI trends")

How It Works

The StigmergySpeakerSelector replaces AutoGen's default speaker selection:

  1. Each registered task deposits a pressure signal targeted at its agent
  2. On each turn, signals decay and the selector picks the agent with highest pressure
  3. Task dependencies are enforced — an agent won't be selected until its deps complete
  4. Completion signals propagate pressure to downstream agents

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_autogen-0.1.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

stigmergy_autogen-0.1.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: stigmergy_autogen-0.1.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for stigmergy_autogen-0.1.1.tar.gz
Algorithm Hash digest
SHA256 642eeca9703492b463ad59597520bad13b69632b89e8e7ae4abac8328a894856
MD5 5bde32e5179c24a16c5971229365a664
BLAKE2b-256 649289bfd19b510b6f41758f4dd93278a8c927645077addd832906b380c2cb2f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stigmergy_autogen-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0315eb20439e782cdb7ab23bf0a81103b9c4eb8039b7aa19cee424e9b05300c6
MD5 c803bfd7881448fa158ce6f3d157c99d
BLAKE2b-256 2ae1d82331f73e7039e613eea86a6b0557a9c5a1bc28eb2d4f8bceca329f404b

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