Skip to main content

agentgrid-py

Task routing for production AI agents. Given a task, AgentGrid finds the right agent from your registry based on capabilities, health, and policy — then dispatches.

Install

pip install agentgrid-py
pip install "agentgrid-py[registry]"   # with agentregistry-py
pip install "agentgrid-py[all]"        # with registry + mesh + policy

Quickstart

import asyncio
from agentgrid import AgentGrid
from agentregistry import AgentRegistry, AgentManifest

async def main():
    registry = AgentRegistry()
    registry.publish(AgentManifest(
        id="acme.search-agent", version="1.0.0",
        capabilities=["search", "summarize"],
        framework="langgraph",
    ))

    grid = AgentGrid(registry=registry)

    # Register handler for local dispatch
    async def search_handler(task: str, payload: dict) -> dict:
        return {"output": f"search results for: {task}"}
    grid.register("acme.search-agent", search_handler)

    # Route task to best agent
    result = await grid.route("find quarterly revenue", requires=["search"])
    print(f"Routed to: {result.agent_id} (score={result.score:.2f})")
    print(f"Response: {result.response}")

asyncio.run(main())

Routing Strategies

from agentgrid import RoutingStrategy

# Best capability match (default)
result = await grid.route(task, strategy=RoutingStrategy.BEST_MATCH)

# Round-robin across eligible agents
result = await grid.route(task, strategy=RoutingStrategy.ROUND_ROBIN)

# Least loaded agent
result = await grid.route(task, strategy=RoutingStrategy.LEAST_LOADED)

# Broadcast to all eligible agents
results = await grid.broadcast(task, requires=["handle_event"])

Stack

agentgrid    → routing       which agent handles what task
agentmesh    → events        connects agents via pub/sub
agentplane   → policy        governs agent behaviour
agentregistry → discovery    what agents exist and their capabilities

Apache 2.0 · PyPI

Release files for agentgrid-py 0.1.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 agentgrid-py 0.1.0
File Size Uploaded
agentgrid_py-0.1.0.tar.gz 9.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agentgrid-py 0.1.0
File Interpreter ABI Platform
agentgrid_py-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.3 kB

Release files / agentgrid_py-0.1.0.tar.gz

Download URL agentgrid_py-0.1.0.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
bc357c2d1c1ea85ffc6455317de8661ffd42d16a06ad4cc8b32ef3ade494f6e3
BLAKE2b-256 checksum
How to use checksums
7b5a8c162bd0b23cc301d8a92f8a2653341bd1b5375178784356a87aabff7f6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / agentgrid_py-0.1.0-py3-none-any.whl

Download URL agentgrid_py-0.1.0-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c90f5c851dd293aa0be8273dab3ef2b2ab2944274a6c3add2b5595c3382fde23
BLAKE2b-256 checksum
How to use checksums
49e73bccee23f6f00079729063b458d6077f12d440af9fe399b162c4ab6c1297
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.1.0 This release

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