August 10, 2026

Build LlamaIndex RAG Pipelines with More Accurate Web Context at a Lower Cost

Give LlamaIndex agents and RAG pipelines web search that learns your use case, returned as cited, native Document objects.

clock
4
min read
Copied!

Charlie Klein

linkedin
Director of Product Marketing
No items found.
Build LlamaIndex RAG Pipelines with More Accurate Web Context at a Lower Cost
August 10, 2026

Build LlamaIndex RAG Pipelines with More Accurate Web Context at a Lower Cost

Give LlamaIndex agents and RAG pipelines web search that learns your use case, returned as cited, native Document objects.

clock
4
min read
Copied!

Charlie Klein

linkedin
Director of Product Marketing
No items found.
Build LlamaIndex RAG Pipelines with More Accurate Web Context at a Lower Cost

Today, we're announcing the Nimble integration for LlamaIndex. LlamaIndex agents and RAG pipelines can now search the web through Nimble's Web Search Agents, which learn your use case to return more accurate context at a lower cost. Results come back as native LlamaIndex Document objects, cited and ready to index.

What You Can Do with the Nimble LlamaIndex Integration

The llama-index-tools-nimble package brings Nimble to LlamaIndex through a single tool spec, NimbleToolSpec. Its search() method returns fresh web results as LlamaIndex Document objects, each carrying the page title and source URL in its metadata. Because results arrive as the framework's own native type, they drop straight into an index or query engine with no conversion step, and to_tool_list() plugs the same tool spec into any LlamaIndex FunctionAgent or workflow.

The integration exposes both of Nimble's retrieval modes. For quick facts a single lookup can confirm, the agent uses Nimble Search. For complex questions that require reasoning across multiple sources, it runs a Web Search Agent, which orchestrates the search, extraction, and reasoning itself and returns a cited, structured result as a Document. One retrieves, the other thinks.

With Nimble and LlamaIndex, you can:

  • Ground RAG in use-case-specific data. Web Search Agents learn your sources, success criteria, and output formats, so your index is built from context that matches the use case instead of whatever a generic index happens to surface.
  • Retrieve smarter over time. Every run is captured in a proprietary index, and memory records which retrieval paths worked. Generic tools forget everything after each query. Web Search Agents build on what they already know about your domain, so retrieval compounds in accuracy and efficiency run over run.
  • Cut token costs. Reuse learned retrieval paths and templatized extraction instead of rediscovering where the data lives on every run, and return clean, structured context that takes fewer tokens to process than raw pages.
  • Access more of the web. JS rendering, stealth mode, and a large proxy network reach dynamic, protected, and rate-limited sources that generic search tools return as blank pages.

Every Web Search Agent task generates an auditable Search Plan that shows exactly what was searched, where, and why, and runs return per-claim citations and confidence data. In LlamaIndex, that provenance rides along in the Document, so retrieved context and generated answers trace back to a source and a research date, and you can verify where a fact came from before acting on it.

Web Search Agent runs are also resumable, so a pipeline can start a research task, check its status, and retrieve the structured result when it completes.

from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
from llama_index.tools.nimble import NimbleToolSpec

agent = FunctionAgent(
    tools=NimbleToolSpec().to_tool_list(),
    llm=OpenAI(model="gpt-4o-mini"),
)

response = await agent.run("What has Nimble announced recently?")
print(response)

Cookbook: Build a RAG Index That Researches Its Own Gaps with LlamaIndex

This cookbook builds a LlamaIndex RAG index that researches its own gaps and refuses to answer from stale facts. It runs a tariff research desk: ask a duty question, and the desk answers from what it already holds, or dispatches Web Search Agents to research it and keeps the result. Every fact is dated and cited, and a guard in the retrieval path withholds anything past its shelf life rather than serving it as current. It is a concrete version of the points above: retrieval specialized for the use case, provenance on every fact, and clean structured output instead of raw pages.

Here's how it works:

  • Return each research run as a Document. NimbleAgentToolSpec runs a Web Search Agent and returns the result as a LlamaIndex Document, so research output arrives as the framework's native type and drops straight into the index.
  • Specialize each agent for its slice of the task. For each product and origin, one agent reads the base duty rate from the official schedule, and another establishes which duty overlays are in force. Each one knows what a good result looks like for its narrow job.
  • Index with provenance attached. Every Document carries confidence, per-claim citations, source URLs, and the research date, the same trust data a Web Search Agent returns on any run.
  • Refuse to answer from stale facts. A node postprocessor withholds anything past its shelf life instead of serving it as current. Base rates hold for 90 days, the policy overlays on top of them for 7.
  • Show the gaps beside the answer. Unverified items are listed with the answer, because confidence grades what was claimed, not what was covered.
  • Refresh only what moved. A refresh re-researches only the volatile half and logs the diff against the previous run, reusing everything already in the index.

The repository ships 17 researched facts across 7 tariff codes and 10 product-and-origin combinations, plus six cached code lookups, so the app runs with no billable calls. One fact is deliberately past its shelf life, so the freshness guard has something to catch.

Give LlamaIndex Pipelines Better Web Context with Nimble

LlamaIndex provides the indexing, retrieval, and agent framework. Nimble gives those pipelines web infrastructure that specializes in your use case: it searches, crawls, extracts, and researches live information, learns the most effective paths to the right data, and returns it as native, cited Documents ready to index.

There are generic web indexes, and then there is Nimble. By adapting retrieval to what your agent is trying to accomplish, instead of running the same logic for every use case, Nimble helps LlamaIndex pipelines retrieve more accurate context with fewer searches and lower processing costs, and keep the provenance to prove where it came from.

Together, Nimble and LlamaIndex make it easier to build RAG systems and agents that do more than retrieve from a fixed corpus. They pull in current, use-case-specific web context when they need it, keep it auditable and dated, and turn it into structured output ready to act on.

FAQ

Answers to frequently asked questions

How does the Nimble LlamaIndex integration give agents web search?
plusminus

The llama-index-tools-nimble package provides NimbleToolSpec, whose search() method returns live web results as LlamaIndex Document objects. Call to_tool_list() to pass it to a FunctionAgent or workflow, and the model decides when to search the web to answer with current facts.

When should a LlamaIndex agent use Nimble Search versus a Web Search Agent?
plusminus

Use Nimble Search to retrieve search results or web data your own agent will reason over, especially for high-volume or latency-sensitive lookups. Use a Web Search Agent when you need an answer to a complex question that requires searching multiple sources, extracting, and reasoning across them. One retrieves, the other thinks, and the Web Search Agent returns a cited, structured result as a Document.

How does the Nimble LlamaIndex integration improve accuracy over generic search?
plusminus

Web Search Agents specialize retrieval for your use case. They learn your sources, success criteria, and output formats, and reference a proprietary index of past runs, so they retrieve the information your agent actually needs and go deeper on critical sources than a generic index reaches. Accuracy compounds run over run instead of resetting on every query.

Why does the Nimble LlamaIndex integration return Document objects, and are they citable?
plusminus

Document is LlamaIndex's native type, so results drop straight into an index or query engine with no conversion. Each Document carries the page title and source URL in its metadata, and Web Search Agent runs add per-claim citations, confidence data, and a research date, so answers trace back to a source and you can maintain data lineage.