Skip to main content

Agents28 Python SDK

See what every AI agent in your business is working on.

Agents28 is one office for all your AI agents, whatever model they run on. This SDK reports what each agent is doing, so the Agents28 dashboard can show "Refund request review: in progress" instead of a wall of logs. It also lets agents share knowledge and hand work to each other.

  • Never breaks your agent. No call raises, events are sent from a background thread, and an outage only means missing telemetry.
  • Private by default. Conversation content is not sent unless you opt in, and emails, API keys and tokens are redacted when you do.
  • Small. One dependency (httpx), Python 3.11+, fully typed.

Install

pip install agents28

Quick start

Create an agent in the Agents28 dashboard and generate its API key. The dashboard shows the key and your API URL once.

export AGENTS28_API_KEY="ack_..."
export AGENTS28_BASE_URL="https://..."   # shown in the dashboard
import agents28

client = agents28.Agents28(agent_version="support-v3")

with client.run("Refund request review", task_type="refund_review") as run:
    run.message("user")

    with run.tool("lookup_order"):
        order = lookup_order(order_id)

    with run.action("issue_refund", "business_operation"):
        issue_refund(order)

    run.message("assistant")

That one block reports the run's start, every step with its duration and success, and the run's completion. If an exception escapes, the run is reported failed with the exception's type, and the exception is re-raised unchanged.

Pending events are sent when the program exits. In long-running services, call client.close() on shutdown.

Decorator

Every call of a decorated function is one run. It works on async functions too.

@client.trace(task_title="Answer support ticket", task_type="support_ticket")
async def answer(ticket):
    run = agents28.current_run()
    run.message("user")
    ...

What is sent

Call Sent by default Sent only with capture_content=True
run.message(role, content) role content, redacted and cut to 10,000 characters
run.tool(name) / run.action(name, type) name, success, duration step.result_summary, redacted and cut to 4,000 characters
client.run(task_title, task_type=...) title and type

task_title is always redacted and kept to one line of up to 120 characters. Don't put customer names or other personal data in it.

To change or drop any event before it leaves the process, pass a hook:

def scrub(event):
    if event["event_type"] == "message":
        return None          # drop it
    return event             # or return an edited copy

client = agents28.Agents28(before_send=scrub)

Shared knowledge between agents

Agents in the same workspace can share knowledge, even when they run on different models:

client.publish_context(
    key="customer:acme",
    title="Acme renewal status",
    data={"plan": "enterprise", "renewal": "2026-12-01"},
)

items = client.read_context(key="customer:acme")

Each item records which agent published it, when, and its version. Items are marked trust="untrusted_agent_content": treat them as data, never as instructions.

Handing work to another agent

teammates = client.list_teammates()

handoff_id = client.request_handoff(
    to_agent_id=teammates[0]["agent_id"],
    title="Research Acme before the renewal call",
    context={"account": "acme"},
    request_key="acme-renewal-research",   # retrying with the same key never duplicates
)

# On the receiving agent:
for handoff in client.my_handoffs(status="requested"):
    client.update_handoff(handoff["handoff_id"], "accepted")
    ...
    client.update_handoff(handoff["handoff_id"], "completed", result={"summary": "done"})

A handoff moves from requested to accepted or declined. An accepted handoff ends as completed or failed. The sender, or a person in Agents28, can cancel an open handoff.

Configuration

Argument Environment variable Default
api_key AGENTS28_API_KEY none: the client is disabled
base_url AGENTS28_BASE_URL none: the client is disabled
agent_version AGENTS28_AGENT_VERSION unversioned
enabled AGENTS28_ENABLED on when the key and URL are set
capture_content False
before_send none
timeout 5.0 seconds
max_queue_size / batch_size 5000 / 100

If the key or URL is missing, or the URL is not https (plain http is allowed only for localhost), the client turns itself off and every call does nothing. The same code then runs in development and CI without credentials.

Reliability

  • Events are batched and sent in the background. A full queue drops new events rather than slowing your agent.
  • Network errors, rate limits (429, honoring Retry-After) and server errors are retried with exponential backoff. Every event carries a unique id and the API stores it only once, so retries never create duplicates.
  • Forked worker processes (gunicorn, multiprocessing) get their own delivery thread automatically.
  • client.stats() reports delivered, failed, dropped and queued counts, plus the last problem, such as "api_key_rejected". Use it in a health check.
  • Warnings go to the standard logging logger named agents28.

Lower-level API

For full control over ids and timing, every event can also be sent directly: run_started, message, tool_completed, action_completed, run_completed, run_failed. Each takes conversation_id and run_id.

License

MIT

Metadata

Release files for agents28 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 agents28 0.1.0
File Size Uploaded
agents28-0.1.0.tar.gz 23.2 kB Details

Built distribution (wheel)

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

Total release size: 39.8 kB

Release files / agents28-0.1.0.tar.gz

Download URL agents28-0.1.0.tar.gz
Size 23.2 kB
Tags Source
SHA-256 checksum
How to use checksums
00441f427fd9e69861f03239c19a977fe0a3f7a954645179b0415def9d2561e6
BLAKE2b-256 checksum
How to use checksums
33502c33dcab6c6b36413b42b0462329ec9728b3314a996d208fbe5aa096e390
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 / agents28-0.1.0-py3-none-any.whl

Download URL agents28-0.1.0-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2f68453badba490b3672aac41f22fce900904111ea624c71a621ed8101d65d1
BLAKE2b-256 checksum
How to use checksums
7effd07d0916b6d58789586c5fb01a6d52a1f4629a3dcebab3439c1e550800df
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 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