Skip to main content

Agent-Gantry

Universal Tool Orchestration Platform for LLM-Based Agent Systems

Context is precious. Execution is sacred. Trust is earned.

Agent-Gantry is a Python library (v0.20.0) for building agents that can discover, select, and execute the right tools without flooding every prompt with every schema your organization owns. It combines semantic retrieval, provider schema conversion, secure execution, framework bridges, MCP/A2A interoperability, persistence adapters, and observability into one tool orchestration layer.

Documentation

The project documentation is now an Astro + React + TypeScript site with an implementation journey, interactive tool lifecycle walkthrough, integration matrix, and production operations guidance.

npm install
npm run dev      # local docs server
npm run build    # type-check and static build
npm run preview  # verify the generated site styling

Start with the rich docs in src/pages/index.astro. The published site lives at codehalwell.github.io/Agent-Gantry.

Install

uv add agent-gantry
# or
pip install agent-gantry

Useful extras:

uv add "agent-gantry[openai]"
uv add "agent-gantry[anthropic]"
uv add "agent-gantry[google-genai]"
uv add "agent-gantry[lancedb,nomic]"
uv add "agent-gantry[mcp,a2a]"
uv add "agent-gantry[agent-frameworks]"
uv add "agent-gantry[all]"

Quick start

from openai import AsyncOpenAI
from agent_gantry import AgentGantry, set_default_gantry, with_semantic_tools

client = AsyncOpenAI()
gantry = AgentGantry()
set_default_gantry(gantry)

@gantry.register(tags=["weather"])
def get_weather(city: str) -> str:
    """Get the current weather for a city."""
    return f"The weather in {city} is 72°F and sunny."

@with_semantic_tools(limit=3, dialect="openai")
async def ask_llm(prompt: str, *, tools=None):
    return await client.chat.completions.create(
        model="gpt-5.5",
        messages=[{"role": "user", "content": prompt}],
        tools=tools,
    )

await ask_llm("What's the weather in San Francisco?")

Agent-Gantry automatically fingerprints registered tools, syncs definitions to the configured vector store, retrieves semantically relevant tools, and converts schemas to the requested provider dialect.

Framework integration in one line

Use the same registry with any supported framework. Install the framework SDK you use; Gantry imports it only when it builds native tools or live hooks.

# Native LangChain tools, ready for model.bind_tools(tools).
tools = await gantry.framework("langchain").select("What's the weather?", limit=3)

# Dynamic Pydantic AI tools, reselected on every model turn.
from pydantic_ai import Agent
agent = Agent("openai:gpt-5.5", toolsets=[gantry.framework("pydantic-ai").live(limit=3)])

# Discover all twelve integrations without installing their SDKs.
from agent_gantry import supported_frameworks
print(supported_frameworks())

Framework names preserve adapter types for editor completion. Hyphenated names such as google-adk and openai-agents also work. Existing adapter classes and imports remain available. See the integration recipes for each framework's install command, static tools, and live selection hook.

Core capabilities

  • Semantic tool routing: reduce prompt context by retrieving top-k relevant tools instead of injecting every tool.
  • Register once, run anywhere: emit schemas for OpenAI (Chat Completions and Responses), Anthropic, Gemini, Mistral, Groq, and Microsoft Agent Framework dialects — plus the framework-native adapters, MCP, and A2A paths below.
  • Secure execution: run tools through policies, capabilities, timeouts, retries, rate limits, circuit breakers, callbacks, and telemetry. Batch and streaming tool calls are supported via execute_batch() and execute_tool_calls().
  • Persistence and retrieval: use in-memory defaults, LanceDB, Qdrant, Chroma, pgvector, OpenAI/Azure/Nomic/sentence-transformers embeddings, and Cohere / cross-encoder / Jev rerankers.
  • Framework coverage: Microsoft Agent Framework plus LangChain, LangGraph, LlamaIndex, CrewAI, Google ADK, Pydantic AI, OpenAI Agents SDK, Haystack, Agno, Strands Agents, and DSPy.
  • MCP both ways: consume local (stdio) and remote (Streamable HTTP / SSE) MCP servers, and serve your registry to Claude Desktop, Claude Code or any remote client with gantry.serve_mcp() / agent-gantry serve-mcp --module my_app.tools — two meta-tools instead of the whole tool list.
  • A2A both ways: discover and call remote A2A agents as tools with add_a2a_agent(), and serve your own registry as an A2A agent (Agent Card at /.well-known/agent.json) with gantry.serve_a2a().
  • Skills, retrieved by meaning: load any Agent Skills (SKILL.md) directory with gantry.add_skills_from_directory(...) and inject only the skills relevant to each prompt.
  • Bundled Claude Skill: install with agent-gantry install-skill --claude or target a project-local skills directory.
  • Observability: emit retrieval/execution telemetry to the console, OpenTelemetry, or Prometheus, and track token savings with the built-in metrics helpers.
  • Selection without embeddings: point a decision model at the catalogue instead of a vector store. JevSelector replaces embed-then-search for tools, skills and MCP servers; JevReranker refines the shortlist when the catalogue is too large to send. Both fail open to semantic routing.

Agent-Gantry supports Python 3.10–3.14. CrewAI's current SDK requires Python 3.10–3.13; the agent-frameworks extra includes it only on those versions.

Selecting tools without a vector store

Semantic routing embeds the query and searches. A selector asks a decision model directly, which needs no embedder, no vector store and no sync — and can return nothing when nothing fits, which top-k cannot express.

from agent_gantry import AgentGantry, JevSelector

gantry = AgentGantry(selector=JevSelector(threshold=0.3))  # reads TYPESAFE_API_KEY

@gantry.register(tags=["email"], examples=["show my messages", "any new mail"])
def list_inbox(limit: int = 10) -> list[str]:
    """List the most recent messages sitting in the inbox."""
    return []

@gantry.register(tags=["email"], examples=["email Bob about the meeting"])
def send_email(to: str, body: str) -> str:
    """Send an email message to a named recipient."""
    return "sent"

# With a key, this honours the negation and returns list_inbox alone.
# Without one, selection fails open and semantic routing answers instead.
tools = await gantry.retrieve_tools("show my messages, but do not send anything")

The same selector covers retrieve_skills() and retrieve_mcp_servers(). Above a few hundred entries, keep semantic search and refine it instead:

from agent_gantry import AgentGantry, JevReranker

gantry = AgentGantry(reranker=JevReranker())   # reorders the vector-search shortlist

Write examples=[...] on your tools before reaching for either: on our own benchmark that moved the default embedder from 1/5 to 5/5, more than any model change did. See agent_gantry/adapters/selectors/README.md for the measured trade-offs.

Manual retrieval and execution

from agent_gantry import AgentGantry
from agent_gantry.schema.execution import ToolCall

gantry = AgentGantry()

@gantry.register(tags=["finance"])
def calculate_tax(amount: float) -> float:
    """Calculate US sales tax for an amount."""
    return amount * 0.08

tools = await gantry.retrieve_tools("What is the tax on $100?", limit=5)
result = await gantry.execute(ToolCall(
    tool_name="calculate_tax",
    arguments={"amount": 100.0},
))

Development

uv sync --all-extras
uv run pytest
npm install
npm run build

License

MIT

Metadata

Release files for agent-gantry 0.20.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 agent-gantry 0.20.0
File Size Uploaded Provenance
agent_gantry-0.20.0.tar.gz 462.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for agent-gantry 0.20.0
File Interpreter ABI Platform
agent_gantry-0.20.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.0 MB

Release files / agent_gantry-0.20.0.tar.gz

Download URL agent_gantry-0.20.0.tar.gz
Size 462.6 kB
Tags Source
SHA-256 checksum
How to use checksums
72528d8acc5b7e7b06fde4c13600a0bc3097b8bed07a9ac2b256c1078a5b3a62
BLAKE2b-256 checksum
How to use checksums
1f4ab6dd09b1e7748e051f0a88c283c675bc196df70418000607cab2f62e3d48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Release files / agent_gantry-0.20.0-py3-none-any.whl

Download URL agent_gantry-0.20.0-py3-none-any.whl
Size 573.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e27fbef7e14583b93f5d65b3a61ada719c29e32fa154bc0d3d04a5a16ff82677
BLAKE2b-256 checksum
How to use checksums
9d10b7959d534f0f324d22b65d97ddebfd7e9f5d56783c6a39562884826fe176
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Security for agent-gantry 0.20.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for agent_gantry-0.20.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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