DEV Community

Abdur Rafay
Abdur Rafay

Posted on

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

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.

how it works

  • scans your Python codebase statically
  • finds async bottlenecks (missing awaits, unparallelized calls, etc)
  • surfaces fixes inline in your editor

try it

pip install relay-arclat

or check it out here

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

Top comments (0)