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.

AutoGen's default selection burns an LLM call per turn to decide who speaks. At 100+ turns that's real money and latency for a routing decision. Stigmergy makes the same decision in sub-millisecond time using pressure signals, and the cost doesn't change at 10,000 turns.

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.2.0.tar.gz (4.7 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.2.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: stigmergy_autogen-0.2.0.tar.gz
  • Upload date:
  • Size: 4.7 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.2.0.tar.gz
Algorithm Hash digest
SHA256 579380057dfe1633ba287d49f7e46a7b713d5cf0893b4aa03f19810e276de2a4
MD5 9a6ade4f698d6ff1415c403cdd80cb4f
BLAKE2b-256 bc9c3b05f9836026f70f512eb6912c9cb60196085e54c6f8ce83471dab9d1136

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stigmergy_autogen-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d25803eb2459383d97c95d7554d0e578926e4e8a2ab31d6272f46d5979bfdd0
MD5 7cfc755c335c57a1c9e63457a3658c14
BLAKE2b-256 84bcdabce4a0bc22efa7a15d8348d84c36907473a07d9a102f180e12914b38d8

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