Skip to main content

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

Metadata

Release files for stigmergy-autogen 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stigmergy-autogen 0.2.0
File Size Uploaded
stigmergy_autogen-0.2.0.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stigmergy-autogen 0.2.0
File Interpreter ABI Platform
stigmergy_autogen-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / stigmergy_autogen-0.2.0.tar.gz

Download URL stigmergy_autogen-0.2.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
579380057dfe1633ba287d49f7e46a7b713d5cf0893b4aa03f19810e276de2a4
BLAKE2b-256 checksum
How to use checksums
bc9c3b05f9836026f70f512eb6912c9cb60196085e54c6f8ce83471dab9d1136
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release files / stigmergy_autogen-0.2.0-py3-none-any.whl

Download URL stigmergy_autogen-0.2.0-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d25803eb2459383d97c95d7554d0e578926e4e8a2ab31d6272f46d5979bfdd0
BLAKE2b-256 checksum
How to use checksums
84bcdabce4a0bc22efa7a15d8348d84c36907473a07d9a102f180e12914b38d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page