AI Agent Latency 101: How do I speed up my AI agent?
AI agent latency can be cut in five ways: find the bottleneck first (e.g. with per-step tracing and a waterfall view), reduce perceived latency through UX, make fewer LLM calls, make each call faster, and run calls in parallel. Streaming intermediate steps such as plans, retrieval results or thinking tokens can raise user satisfaction without changing total time, and event-triggered background agents hide latency entirely. General-purpose multi-agent supervisor or swarm setups make many LLM calls, so mixing code with explicitly routed calls reduces them. Smaller models and shorter context speed up individual calls at some cost to accuracy, and guardrail checks, multi-document extraction or multi-model calls can run concurrently.
Related posts
- Break chatbot speed limits with speculative tool calls
incident.io mediumAdeptincident.io cut its incident chatbot's response latency by about 50% (saving 2-3s per interaction) by speculatively executing LLM tool calls in both directions. Tools are started in parallel with the main chat prompt when simple keyword matching suggests they will be needed, and the follow-up chat prompt is run optimistically by assuming the tool succeeded, then re-run on error. Side effects are prevented with a Go write barrier: speculative tools do all their LLM 'thinking' but block before writing until the main prompt confirms the call, otherwise the context is cancelled. The tradeoff is occasional wasted LLM spend, which effectively lets the team buy speed with money.
- Building Long-Running Agents with ScaleDown and Deep Agents
LangChain mediumAdeptThe langchain-scaledown integration offloads context-management decisions in long-running agents (summarizing history, compressing tool results, extracting fields, classifying state) from frontier LLMs to ScaleDown's small, task-specific constrained decoding models, which ScaleDown reports are far faster and cheaper on these narrow tasks. It ships middleware for LangChain and Deep Agents. Summarization replaces history past a trigger fraction. Tool compression adds a compression_query argument that cut a docs page by about 90%. Extraction copies exact values from user messages into agent state. A custom Classify-based circuit breaker can stop looping or drifting runs. ScaleDown calls can also route through the LangSmith LLM Gateway for tracing and spend limits, while open-ended generation stays on a general-purpose model.
- ThunderAgent: 2x Faster Agentic Inference for Synthetic Data Generation at Scale
Together AI hardMasterThunderAgent is a scheduling layer between agent clients and inference backends that treats each multi-turn agentic workflow as a schedulable program instead of independent requests, preventing KV cache thrashing when agents pause for tool calls. Under memory pressure it pauses low-priority programs to raise cache hit rates, then resumes them via a global waiting queue onto the node with the most free capacity, replacing static session pinning. On one 8×H100 node with HiCache at batch 192 it reached 803 vs 390 tokens/s for SGLang, with mean latency cut from 65s to 10.6s. Across 2 to 8 nodes it scaled near-linearly and outperformed SGLang Gateway by up to 2.39×, requiring only a program_id field on OpenAI-compatible requests.
- Speeding up agentic workflows with WebSockets in the Responses API
OpenAI mediumAdept
OpenAI cut end-to-end latency of agentic loops on the Responses API by about 40% by adding a WebSocket mode that keeps a persistent connection with a connection-scoped in-memory cache of prior response state. Follow-up `response.create` calls with `previous_response_id` reuse cached rendered tokens, tool definitions and routing, so safety classifiers and validators process only new input, and postinference work like billing overlaps with later requests. An earlier prototype that modeled the whole rollout as one long-running response blocked on client tool calls was faster still, but it was dropped in favor of keeping the familiar API shape. Earlier sprint work (token and config caching, fewer network hops, faster safety checks) improved TTFT by about 45%, and the WebSocket mode let GPT-5.3-Codex-Spark reach 1,000+ TPS, with partners such as Cline, Vercel and Cursor reporting 30-40% speedups.
- How to Build a Model Router in the Harness
LangChain mediumAdeptRouting each coding-agent thread to one of three model tiers (fast, balanced, performance) cut median cost per thread by 64% versus always using a top frontier model, with no measurable change in merged-PR rate (29.2% vs 27.3%, p=0.49) across 973 threads in Open SWE. The router runs as harness middleware, classifying the first user message against per-tier criteria. Those criteria come from trace-based task analysis and provider guidance, which is why it belongs in the harness rather than a generic gateway. Most threads went to the balanced (56%) or fast (34%) tiers. A fast-only control degraded quality so quickly it was stopped within a day. Future work includes subagent routing and mid-thread re-routing, which carries a prompt-cache cost.