Skip to content
← Developer Hub

Developer Hub

Setup Gopher Agent

Cut frontier-model costs by delegating heavy reading to a low-cost raia agent over MCP — with downloadable instructions for Claude and the Gopher agent.

Interactive tool

Token Savings Estimator

See what a Gopher agent saves on your own workload. Enter your model, conversation length and how much each turn reads, and get your estimated cost and context savings. Open the estimator at raiaai.com/gopher

Tech Time with Thomas: why paying frontier-model prices to read raw data is the expensive part of research, and how a Gopher agent changes that.

Gopher Agents: Cut Frontier-Model Costs by Delegating the Heavy Reading

A Gopher agent is a raia agent built on a low-cost model. A premium AI assistant (such as Claude) calls it over MCP to fetch, read and condense information. The premium model does the thinking, and the Gopher does the reading. The Gopher goes out and does the token-heavy work, then brings back only what matters.


The problem it solves

In research-style work, most of an AI assistant's cost is reading, not reasoning.

When an assistant searches the web, opens documents or queries a connected system, the full raw content lands in its context window. A handful of web pages can add 50,000–100,000 tokens. Then two things happen:

  1. You pay premium rates to read it. Frontier models cost roughly 5–30× more per token than fast models like Gemini Flash.
  2. You pay again on every later turn. The conversation's context is sent back to the model with each message. Raw content read in turn 3 is still being paid for in turn 20, even with prompt caching.

Long research conversations also fill the context window. After that, the model starts losing earlier detail or the conversation has to be restarted.

How a Gopher agent works

User ──► Premium model (Claude)
              │  "TASK: find X. RETURN: fields A, B, C"
              ▼
         Gopher agent on raia (cheap model)
              │  searches the web, reads pages, queries MCP connectors,
              │  processes 50k–100k tokens of raw content
              ▼
         Compact result (~1–2k tokens): answer, key facts, sources, gaps
              │
              ▼
         Premium model reasons over the summary and answers the user
  1. The premium model decides a step needs heavy reading and sends the Gopher a self-contained request: what to find, where to look and exactly what to return.
  2. The Gopher does the work at low-cost rates. It can search as many times, read as many pages and query as many sources as it needs.
  3. The Gopher returns a short, structured result with sources and short verbatim quotes.
  4. The premium model only ever sees that result. Its context stays small, and it spends its tokens on reasoning, judgment and writing.

Illustrative savings

The scenario is a 20-turn research conversation. In 10 of those turns, the assistant needs to read about 75k tokens of raw material.

Premium model onlyPremium model + GopherSavings
Cost with prompt caching$13.25$5.25~60%
Cost without caching$86.28$16.23~81%
Premium context at turn 20~831k tokens~103k tokens~8× smaller

Pricing used: Claude Fable 5.1 ($10 input / $50 output per 1M tokens, $0.25 cache read). Gopher on Gemini 3.5 Flash ($1.50 / $9). Each turn is modeled as one call, and real agent turns usually make several, so these figures are conservative. Using a cheaper Gopher model (such as Gemini 2.5 Flash) raises the savings to about 76% with caching.

When to use the Gopher, and when not to

Send to the Gopher:

  • Web research, fact-finding, competitor and market lookups
  • Reading long documents, PDFs, web pages or large tool outputs when only part of them is needed
  • Pulling data from connected systems (CRM, tickets, knowledge bases, databases)
  • Bulk extraction: lists, tables, specs, contact details, comparisons across many items
  • Any step that reads far more than it returns. A useful rule of thumb is more than about 5k tokens read for a much smaller answer.

Keep on the premium model:

  • Reasoning, analysis, planning, writing, editing and coding
  • Judgment calls and anything that depends on the conversation's nuance
  • Short answers the model already knows or that are already in the conversation
  • Exact wording that must be right, such as contract language. Have the Gopher return verbatim excerpts, not summaries.

The contract between the two agents

The pattern only works if both sides follow a strict format.

Request (premium model → Gopher)

TASK:      one clear objective
CONTEXT:   only the background needed to judge relevance
SOURCES:   web | <connector name> | specific URLs or files
RETURN:    the exact fields, table columns or format needed
DETAIL:    brief | standard | full
MAX_WORDS: optional hard cap

The Gopher cannot see the premium model's conversation, so every request has to be self-contained.

Response (Gopher → premium model)

STATUS:     complete | partial | failed
ANSWER:     direct answer, or a table for data requests
KEY FACTS:  one fact per line, tagged [S1], [S2] …
SOURCES:    [S1] Title — URL — "verbatim quote of 25 words or fewer"
GAPS:       what couldn't be found or confirmed, conflicts, assumptions
USAGE:      sources_checked; est_tokens_read; est_tokens_returned

The short quotes let the premium model check important claims without reading the sources itself. Hard length limits (150, 400 or 1,200 words, depending on DETAIL) keep the savings from leaking away.

Setting it up on raia

  1. Create the agent. Pick a fast, low-cost model such as Gemini Flash.
  2. Add the Gopher instructions. Give the agent its role, research rules and the response format above. Tell it that its caller is an AI and that every word it returns costs money.
  3. Enable skills. Turn on the Web skill and connect any MCP integrations or data sources the Gopher should reach.
  4. Expose it over MCP. In the MCP Skill (RAIA MCP tab), write a Server Description and Tool Description that explain when to call the Gopher and the request format. Copy the OAuth Registration URL.
  5. Connect it to Claude. In Claude, go to Settings → Connectors → Add custom connector and paste the URL. The Gopher appears as the tool get-any-info-about-<agent-name>.
  6. Instruct the premium model. Add project instructions that tell Claude when to delegate, how to write requests and how to handle partial or failed results.
  7. Turn off the premium model's own web search in that project, so the Gopher becomes the default way to research.

Best practices

  • Ask for exactly what you'll use. Precise RETURN fields are the main way to keep replies small.
  • Run calls in parallel. Split independent questions into separate Gopher calls instead of sending one large request.
  • Start brief. Ask for more detail only when needed. A narrower follow-up costs less than an oversized first reply.
  • Handle partial results through the Gopher. If the Gopher returns partial, the premium model should send a narrower request rather than doing the reading itself.
  • Spot-check what matters. Check figures that feed decisions against the returned quotes.
  • Measure. Run the same tasks with and without the Gopher and compare premium-model token usage and answer quality.

Limitations

  • Summaries can lose detail. A cheaper model can miss nuance or leave something out. Retries and re-checks reduce the savings, so the pattern fits fetch-and-extract work best, not judgment-heavy reading.
  • Token counts are estimates. Models cannot measure their own token usage. Use raia's usage logs for real numbers.
  • Latency. Each delegation adds a network hop and a second model call.
  • Fixed overhead. For small lookups, the cost of the tool definition, the request and the response can cancel out the savings. The pattern pays off on large reads.
  • Routing is guided by instructions, not enforced. The premium model decides when to call the Gopher based on its instructions. Clear tool descriptions and disabling built-in search make that decision more reliable.

In short: let the expensive model think and the cheap model read. A Gopher agent on raia keeps frontier-model context small, cuts per-conversation cost and lets research conversations run longer without hitting context limits.

Estimate your own savings with the Token Savings Estimatorraiaai.com/gopherTry it