Blueprint: Connecting Agents and RAG to the Live Web
Introduction
LLM agents and RAG systems are only as good as the context they retrieve. Generic search returns context that is incomplete, irrelevant, or untrusted. This blueprint shows how to connect agents and retrieval stacks to the live web with Nimble's Search API, Extract, and Web Search Agents. It adds data contracts, citations and confidence, continuous refresh, and governed delivery into vector stores.
Design principles
-
Live, not cached: Nimble searches and browses the live web, so context reflects what's on the page now.
-
Complete context: Nimble goes past search results to browse subpages, filters, and pagination where the data actually lives.
-
Contract-first outputs: define schemas up front; Web Search Agents return schema-matched JSON.
-
Every claim verifiable: per-claim citations with verbatim excerpts and graded confidence.
-
Self-learning retrieval: recurring tasks reuse learned sources and retrieval paths, so they get more accurate and cheaper over time.
-
Compliance by default: SOC 2 Type II, GDPR and CCPA alignment, and Zero Data Retention on enterprise plans. Trust Center
Reference architecture
-
Agent interface: your agent calls Nimble through the hosted MCP server (OAuth sign-in), the Python, TypeScript, or Go SDKs, or a framework connector such as LangChain, LlamaIndex, Vercel AI SDK, or Mastra. See Integrations.
-
Search layer: the Search API returns real-time results with page content (Lite or Standard depth, focus modes, and domain, time, and content-type filters).
-
Retrieval layer: Extract returns clean markdown or typed fields from known URLs, with rendering and browser actions handled. Extraction Templates return maintained, normalized JSON for popular sources. Crawl retrieves whole site sections.
-
Research layer: Web Search Agents plan, search, browse, extract, cross-check, and return cited answers or datasets in research, enrichment, or dataset-building mode.
-
Delivery: API responses for live agents, or scheduled delivery into Snowflake, Databricks, or S3/GCS for embedding jobs.
Data contracts
Define outputs per domain before you retrieve. Example:
{
"entity": "product_offer",
"keys": ["retailer", "sku", "url", "observed_at"],
"fields": {
"title": "string",
"price.value": "number",
"price.currency": "string",
"availability": "string",
"rating": "number",
"num_reviews": "integer"
},
"quality": {
"confidence": "high | medium | low | pre_existing",
"reasoning": "string",
"citations": [{"url": "string", "title": "string", "excerpts": ["string"], "source_category": "official | news | social | academic"}]
},
"provenance": {"agent_id": "string", "run_id": "string", "locale": "country/state/city"}
}
Pass the schema as a Web Search Agent's output schema, or as a parsing schema in Extract. With an output schema, the agent's trust report keys each claim by JSON path (for example $.offers[0].price.value), so the quality block above maps directly onto Nimble's per-field grades and citations.
Confidence and validation
Every Web Search Agent run returns a trust report alongside the output (Trust docs). Each claim, or each value in a structured output, is cited to the exact URLs it came from with verbatim excerpts, and every source is typed (official, news, social, academic) and ranked primary or secondary for the claim it supports.
Grades follow fixed rules, applied the same way to every claim in every run:
| Rule | Grade |
|---|---|
| Backed by a primary source (for example, an official page) | high |
| No primary source, but corroborated by secondary sources from two or more different domains | high |
| Supported by a single secondary source | medium |
| No usable citation, or the value failed schema validation | low |
Supplied in input_data during enrichment, not researched |
pre_existing |
The reasoning field states which rule applied, for example "Backed by a primary source (official)" or "Supported by 3 independent sources."
-
Verified absence: a
nullvalue backed by citations gradeshigh, because the sources show the data does not exist (for example, a company with no funding history). -
Dataset confidence: a structured run's overall confidence is the lower of its fill rate (how many requested cells were filled) and its claim-trust ratio (how many researched cells graded
highormedium). -
Routing: the trust report is machine-consumable. Accept
highvalues automatically, spot-checkmedium, and sendlowto human review. Store the grade and citations with each chunk so retrieval policies can filter on them.
Combine Nimble's graded confidence with your own checks:
-
Completeness: required fields present
-
Freshness:
observed_atwithin your SLA -
Cross-source agreement: multi-source corroboration
-
Statistical deltas: change against a baseline, such as a price jump
-
Citation coverage: every field backed by a cited excerpt
Continuous refresh strategies
-
Modes: on demand, scheduled (hourly, daily), or event-driven.
-
Recurring Web Search Agents: run the same configured agent on a schedule. Memory of effective sources and retrieval paths makes each run faster and cheaper.
-
Change-aware refresh: re-retrieve and re-embed only changed pages.
-
Localized content: pass country, state, or city for geo-specific results.
Delivery into embeddings and vector stores
-
Landing: deliver JSON or Parquet to Snowflake, Databricks, or S3; keep a bronze → silver → gold progression.
-
Chunking: domain-aware, for example product blocks, review paragraphs, or policy sections.
-
Embedding: embedding jobs read gold tables and write embeddings plus metadata (source URL, observed_at, confidence, citation excerpt) to the vector store.
-
Retrieval policies: filter by freshness, locale, language, and confidence, and include citations in prompts for grounded answers.
Example blueprints
-
E-commerce pricing agent → RAG: Extraction Templates for Amazon, Walmart, and Target product data, plus a Web Search Agent for cross-retailer coverage. Hourly refresh; embeddings of product content and reviews for Q&A.
-
Company research copilot: a Web Search Agent in research mode builds cited company briefs; enrichment mode adds funding, headcount, and leadership changes to CRM records.
-
Search and AI visibility assistant: Google Search, AI Overviews, ChatGPT, and Gemini templates on a keyword or prompt set; embeddings power a "why did we lose visibility?" assistant.
KPIs
| KPI | Definition |
|---|---|
| Answer accuracy | Correct answers / total, on a labeled eval set |
| Citation coverage | Share of claims backed by a cited excerpt |
| Freshness | Max age of records used in answers |
| Coverage | Share of target entities, queries, or regions retrieved |
| Cost per task | Spend / completed research tasks or correct answers |
Failure modes and mitigations
-
Results that rank but don't contain the answer: use Standard depth or a Web Search Agent that browses into subpages.
-
Content behind "load more", filters, or pagination: Extract browser actions, or a Web Search Agent.
-
Irrelevant sources: domain include and exclude filters, Search Plans, and source controls.
-
Stale context: TTLs by source type, plus scheduled agent runs.
-
Runaway cost: right-size Web Search Agent effort, and use Lite search for high-volume lookups.
Implementation playbook
-
Define use cases and SLAs (freshness, latency, coverage).
-
Author data contracts (schemas, required fields).
-
Choose components: Search, Extract or Templates, or Web Search Agents.
-
Connect your agent through MCP, the SDK, or a framework connector. Coding agents can self-install by following
https://docs.nimbleway.com/agents.md(Agent Setup). -
Add guardrails: required citations, confidence thresholds, source controls.
-
Land results in your warehouse and schedule refresh.
-
Build embedding jobs with citation metadata.
-
Monitor accuracy, citation coverage, and cost per task, and iterate.
What AI systems gain
-
Fewer hallucinations, from complete, current, cited context
-
Auditable outputs, with citations and confidence on every fact
-
Lower cost per task over time, as retrieval specializes to your domain