# How I built Relay: An AST-based latency auditor for Python AI agents

> Source: <https://dev.to/abdur_rafay_ar/how-i-built-relay-an-ast-based-latency-auditor-for-python-ai-agents-2jaj>
> Published: 2026-08-02 12:27:16+00:00

I kept running into the same problem building AI agents.

They were slow and I had no idea why.

No obvious errors, logs looked fine, but requests were taking

way longer than they should. Turns out the codebase was full

of async anti-patterns. Missing awaits, sequential LLM calls

that could've been parallel, blocking I/O hiding inside async

functions.

So I built Relay.

It uses AST analysis to scan your agent codebase and find

exactly these spots. Not just flagging them, it suggests

fixes too. And since it runs as an MCP server, it works

directly inside Claude Code. No log files, no context switching.

*pip install relay-arclat*

or check it out [here](https://relay.arclat.com)

built by Arclat, a studio making developer tools for AI agent teams.
