Skip to main content

A small runtime to trace, replay and debug multi-tool AI agents.

Project description

AgentRelay Website

Enterprise and paid version of the agentRelay library: a full-stack platform for tracing, replaying, and debugging AI agent workflows.

AgentRelay combines:

  • A Python SDK for deterministic tracing and replay
  • A FastAPI backend for ingestion, auth, billing, and realtime streaming
  • A React UI for dashboards, runs, and team workflows

✨ Highlights

1) Observability for Agent Runs

Capture run metadata, tool calls, and timing details to understand what your agents did and why.

Capabilities

  • Run ingestion API for tools and agent events
  • Structured storage of runs + tool calls
  • Real-time streaming for live dashboards

2) Deterministic Replay

Re-execute agent workflows deterministically using recorded tool calls.

Capabilities

  • SDK-based tracing and replay
  • Deterministic replay using stored tool-call history
  • Useful for debugging, regression testing, and CI

3) Resume Mode + Budget Caps

Resume partially completed runs and stop execution once a budget ceiling is reached.

Capabilities

  • Resume a prior run_id and skip completed tool calls
  • Budget caps enforced per session with optional compensations

4) LLM Cost Accounting

Wrap LLM provider calls to record token usage and cost per step.

Capabilities

  • OpenAI, Anthropic, and Ollama wrappers
  • Step-level and run-level cost totals

5) Secure, Multi-Project Access

Built for teams and production deployments.

Capabilities

  • Project-based access control
  • Role-based API keys (viewer/writer/admin)
  • OAuth providers + email/password auth

6) Production Billing Foundation

Stripe-powered billing endpoints with checkout and portal sessions.


🧭 Architecture

agent_relay/        # Python SDK (trace + replay)
backend/            # FastAPI backend (auth, billing, ingest)
ui/                 # React dashboard

🚀 Quick Start

1) Backend (FastAPI)

cd backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

export MONGO_URI="mongodb://localhost:27017/agentrelay"
export JWT_SECRET_KEY="<secure-value>"
export SESSION_SECRET_KEY="<secure-value>"
export FRONTEND_URL="http://localhost:5173"

uvicorn app:app --reload --host 0.0.0.0 --port 8000

2) Frontend (React)

cd ui
npm install
npm run dev

3) SDK usage

from agent_relay.runtime import AgentRuntime
from agent_relay.llm import wrap_openai_call

runtime = AgentRuntime.from_conection_string("sqlite:///agent_relay.db")

def my_tool(x: int) -> int:
    return x + 1

runtime.register_tool("my_tool", my_tool)

with runtime.agent_session("example") as session:
    result = my_tool(2)
    session.set_output({"result": result})

# Resume a run and enforce a budget cap
with runtime.resume_session("example", run_id="<existing-run-id>", budget_limit=1.50) as session:
    result = my_tool(5)
    session.set_output({"result": result})

# Export a run to a file and replay locally
runtime.export_run_to_file("<run-id>", "./run.json")
runtime.replay_run_from_file("example", "./run.json", lambda: my_tool(3))

# Wrap an OpenAI call to capture usage and spend
response = wrap_openai_call(
    model="gpt-4o",
    call=lambda: client.chat.completions.create(
        model="gpt-4o",
        messages=[{"role": "user", "content": "hi"}],
    ),
    input_cost_per_1k=0.005,
    output_cost_per_1k=0.015,
)

🔑 Environment Variables

Backend

  • MONGO_URI – MongoDB connection string
  • JWT_SECRET_KEY – JWT signing key
  • SESSION_SECRET_KEY – Cookie session key
  • FRONTEND_URL – Allowed CORS origin

📜 License

See LICENSE.txt.

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

agent_relay_api-0.1.2.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_relay_api-0.1.2-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file agent_relay_api-0.1.2.tar.gz.

File metadata

  • Download URL: agent_relay_api-0.1.2.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agent_relay_api-0.1.2.tar.gz
Algorithm Hash digest
SHA256 755f191a9f0d05c7d292c4ab8858ca4560d4724f9f83eb50c7b11437297765e1
MD5 62b09d859078ab5c06c63b66b867cf4b
BLAKE2b-256 025009e933b0c457662f9ee02699423fe409d47aa47af6fde637aefde66d6f76

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_relay_api-0.1.2.tar.gz:

Publisher: release.yml on YalmanchiliTejas/agentRelayWebsite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agent_relay_api-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_relay_api-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cf51379fc00dfb7807e06c89e3d0dc3d7502b761461b84c8d3d5894ff9c0f2c2
MD5 a6978d842390d7b09fc5b0714fd808d5
BLAKE2b-256 82309a0725b50b0a7a376c8ac6306508450835f58fd37a0cbb65807620238efa

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_relay_api-0.1.2-py3-none-any.whl:

Publisher: release.yml on YalmanchiliTejas/agentRelayWebsite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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