Worked Example: 10-Step Analyst & Competitive Research Agent
Research agents behave completely differently from transactional support bots. Instead of short 4-turn lookups, a research agent decomposes a topic, executes multiple web or internal-corpus searches, reads long excerpts, identifies gaps, runs follow-up queries, and synthesizes a cited brief.
The pre-loaded preset models 150 deep research reports per day on Gemini 3.8 Flash ($0.75/1M input, $0.075/1M cached input, $3.75/1M output introductory Paid Tier rates) paired with 40% routing to Gemini 3.5 Flash-Lite ($0.30/1M input, $0.03/1M cached input, $2.50/1M output) for intermediate query planning and snippet filtering.
Starting from a 4,800-token base context (2,200 system instructions, 1,400 search/browser schemas, 1,200 research brief), each of the 10 steps appends 2,400 tokens of retrieved evidence and emits 650 output tokens. By Step 10, a single turn sends 26,400 input tokens (27,050 peak context tokens), accumulating 156,000 total input tokens before retries. Factoring a 60% cache-hit rate, 12% retry rate for rate-limited or empty scrapes, 8 paid search/scrape calls at $0.005 each ($0.0400/task), an 88% completion rate without manual intervention, and a P90 1.35x variance buffer produces the exact daily and monthly numbers rendered above.
Controlling Retrieval Bloat Before Step 6
- Summarize Scrapes Out-of-Band: Never dump 8,000 tokens of raw HTML boilerplate directly into the main orchestrator's message array. Extract relevant paragraphs with a fast economy model first, then append only 400â800 tokens of distilled evidence.
- Enforce Hard Step Caps: Without a strict
max_stepsguard, research agents caught in ambiguous citation loops can burn 25+ turns on a single run. Pair hard step caps with early-exit criteria. - Check Context Window Margins Early: Notice in the comparison table above how 128K-context models stay safe at 10 steps with 2,400-token payloads, but pushing tool-result payloads to 6,000 tokens across 20 steps narrows your choices to 400Kâ1M context models.
Related Tools & Architecture Guides
Use the Agent Framework Picker to compare RAG-focused frameworks like LlamaIndex Workflows against stateful graph engines like LangGraph. To test shorter transactional workloads, switch to the Customer Support Agent Cost Calculator, or inspect repository-heavy engineering loops in the Coding Agent Cost Calculator. For deeper optimization strategies, read How to Reduce AI Agent Costs.