Skip to main content

AgentFrameRelay

Define agents and tools independently from the framework that executes them.

MVP

  • Framework-neutral @tool
  • Pydantic/JSON schemas
  • Framework-neutral Agent
  • Runtime adapter interface
  • LangChain and CrewAI agent runtimes
  • OpenAI Agents and Google ADK agent runtimes
  • LiteLLM agent runtime and OpenAI-compatible tool schemas
  • MCP/FastMCP tool registration
  • Native escape hatch
  • Capability discovery
  • Optional dependencies

Quick start

from agentframerelay import Agent, tool

@tool
def search_customer(customer_id: str) -> dict:
    """Retrieve a customer."""
    return {"customer_id": customer_id}

agent = Agent(
    name="customer-agent",
    instructions="Help with customer lookup.",
    tools=[search_customer],
    runtime="langchain",
)

print(agent.run({"input": "Find customer 123"}))

Install an adapter only when needed:

pip install "agentframerelay[langchain]"
pip install "agentframerelay[crewai]"
pip install "agentframerelay[openai]"
pip install "agentframerelay[litellm]"
pip install "agentframerelay[google-adk]"
pip install "agentframerelay[mcp]"

The core is intentionally framework-neutral. Adapters isolate framework API churn.

Core execution API

Agent.run() always returns an AgentResult with the native framework output, the runtime name, and optional metadata. RuntimeResult remains available as a backward-compatible alias.

Tools validate annotated inputs before direct execution and raise public, framework-neutral exceptions such as ToolInputError and ToolExecutionError. Asynchronous tools support await tool.ainvoke(...); calling tool.invoke(...) from synchronous code runs them safely when no event loop is active.

from agentframerelay import tool

@tool
async def fetch_customer(customer_id: int) -> dict:
    """Retrieve a customer."""
    return {"customer_id": customer_id}

customer = await fetch_customer.ainvoke("123")

Tool portability

An AgentFrameRelay tool retains its original typed Python function and can be adapted for each supported tool protocol:

@tool
def add(a: int, b: int) -> int:
    """Add two integers."""
    return a + b

langchain_tool = add.to_langchain()
crewai_tool = add.to_crewai()
litellm_schema = add.to_litellm()
google_adk_tool = add.to_google_adk()
openai_agents_tool = add.to_openai_agents()
native_mcp_function = add.to_mcp()

For FastMCP, register the original function directly through the relay tool:

add.register_mcp(mcp)

The Google ADK runtime creates an in-memory session by default. Pass user_id, session_id, state, session_service, or run_config to Agent.run() when your application needs to control ADK session handling. MCP is a tool protocol integration, not an Agent runtime.

Integration examples

Credential-backed smoke scripts live in examples/integrations/; they are kept separate from the automated tests/ suite. The LiteLLM, OpenAI Agents, and Google ADK examples load credentials from .env and assert that the original AgentFrameRelay tool function executed.

Metadata

Release files for agentframerelay 0.1.1

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

Source distribution (sdist)

Source distribution for agentframerelay 0.1.1
File Size Uploaded Provenance
agentframerelay-0.1.1.tar.gz 18.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for agentframerelay 0.1.1
File Interpreter ABI Platform
agentframerelay-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 35.4 kB

Release files / agentframerelay-0.1.1.tar.gz

Download URL agentframerelay-0.1.1.tar.gz
Size 18.8 kB
Tags Source
SHA-256 checksum
How to use checksums
90c2b4da3afd3735647f20140628d70c03d520a0020263cb18a8eed18a2a7521
BLAKE2b-256 checksum
How to use checksums
6cd9eca81640305c0b00f9aae6142d9627e23053fda9523c6137496381100509
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 Aug 28, 2026.

Transparency log

Release files / agentframerelay-0.1.1-py3-none-any.whl

Download URL agentframerelay-0.1.1-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ec0eddc55369c16edfa31810070644efb19c5f805215d268fb658c7def0a13e
BLAKE2b-256 checksum
How to use checksums
1a1f1a499f793f375fb747d7d22f508ee49d5149ec8e9097081048de6b9cf55b
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 Aug 28, 2026.

Transparency log

Security for agentframerelay 0.1.1

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 agentframerelay-0.1.1.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 Aug 28, 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