Skip to main content
Nimble’s Search API provides real-time web search by browsing the live web with headless browsers rather than querying pre-built indexes. The tool handles JavaScript rendering, dynamic content, and complex navigation flows, making it suitable for agent workflows that need access to current web data including content behind pagination, filters, and client-side rendering.

Overview

Integration details

ClassPackageSerializableJS supportPackage latest
NimbleSearchToollangchain-nimblePyPI - Version

Tool features

Returns artifactNative asyncReturn dataPricing
title, URL, content (markdown/plain_text/HTML), metadataFree trial available
Key Features:
  • Fast mode & Deep mode: Deep mode (default) for full content extraction with JavaScript rendering, or Fast mode for quick SERP-only results
  • AI-generated summaries: Optional concise answers alongside raw search results
  • Domain and date filtering: Filter by specific domains or date ranges for precise results
  • Topic-based routing: Optimized routing for general, news, or location-based queries
  • Flexible output formats: plain_text, markdown (default), or simplified_html
  • Production-ready: Native async support, automatic retries, connection pooling

Setup

The integration lives in the langchain-nimble package.
pip install -U langchain-nimble

Credentials

You’ll need a Nimble API key to use this tool. Sign up at Nimble to get your API key and access their free trial.
import getpass
import os

if not os.environ.get("NIMBLE_API_KEY"):
    os.environ["NIMBLE_API_KEY"] = getpass.getpass("Nimble API key:\n")

Instantiation

Now we can instantiate the tool:
from langchain_nimble import NimbleSearchTool

# Basic usage - uses environment variable for API key
tool = NimbleSearchTool()

Use within an agent

We can use the Nimble search tool with an agent to give it dynamic web search capabilities. Here’s a complete example using LangGraph:
import os
import getpass

from langchain_nimble import NimbleSearchTool
from langchain.agents import create_agent
from langchain.chat_models import init_chat_model

if not os.environ.get("OPENAI_API_KEY"):
    os.environ["OPENAI_API_KEY"] = getpass.getpass("OpenAI API key:\n")
if not os.environ.get("NIMBLE_API_KEY"):
    os.environ["NIMBLE_API_KEY"] = getpass.getpass("Nimble API key:\n")

# Initialize Nimble Search Tool with deep search for comprehensive results
nimble_tool = NimbleSearchTool(
    k=5,
    deep_search=True,
    parsing_type="markdown"
)

# Create agent with the tool
model = init_chat_model(model="gpt-4o", model_provider="openai", temperature=0)
agent = create_agent(model, [nimble_tool])

# Ask the agent a question that requires web search
user_input = "What are the latest developments in quantum computing? Include only sources from academic institutions and reputable tech publications."

for step in agent.stream(
    {"messages": user_input},
    stream_mode="values",
):
    step["messages"][-1].pretty_print()
================================ Human Message =================================

What are the latest developments in quantum computing? Include only sources from academic institutions and reputable tech publications.

================================== Ai Message ==================================
Tool Calls:
  nimble_search (call_abc123)
 Call ID: call_abc123
  Args:
    query: quantum computing latest developments 2025
    deep_search: True
    include_domains: ['mit.edu', 'stanford.edu', 'nature.com', 'science.org', 'ieee.org']
    k: 5

================================= Tool Message =================================
Name: nimble_search

[{"title": "Breakthrough in Quantum Error Correction | MIT News", "url": "https://news.mit.edu/quantum-error-correction", "content": "# Quantum Error Correction Breakthrough\n\nResearchers at MIT have achieved a significant milestone in quantum error correction...\n\n## Key Findings\n- New error correction codes reduce computational overhead\n- Scalability improvements for larger quantum systems...", "rank": 1}, {"title": "Quantum Computing Advances | Nature", "url": "https://www.nature.com/articles/quantum-2024"...

================================== Ai Message ==================================

Based on recent academic and technical sources, here are the latest developments in quantum computing:

**Error Correction:**
- MIT researchers have achieved breakthroughs in quantum error correction
- New codes significantly reduce computational overhead

**Hardware Advances:**
- Improved qubit coherence times and stability
- Progress toward fault-tolerant quantum computing...
[Agent continues with comprehensive summary]

Advanced configuration

The tool supports extensive configuration for different use cases:
ParameterTypeDefaultDescription
num_resultsint10Maximum number of results to return (1-20)
deep_searchboolTrueDeep mode (default) for full content extraction, or Fast mode (False) for SERP-only results
topicstr”general”Optimize search for specific content types: “general”, “news”, or “location”
include_answerboolFalseGenerate AI-powered summary answer alongside search results
include_domainslist[str]NoneWhitelist specific domains (e.g., [“wikipedia.org”, “.edu”])
exclude_domainslist[str]NoneBlacklist specific domains to filter out
start_datestrNoneFilter results after date (YYYY-MM-DD or YYYY)
end_datestrNoneFilter results before date (YYYY-MM-DD or YYYY)
parsing_typestr”markdown”Output format: “plain_text”, “markdown”, or “simplified_html”
localestr”en”Search locale (e.g., “en-US”)
countrystr”US”Country code for localized results (e.g., “US”)
api_keystrenv varNimble API key (defaults to NIMBLE_API_KEY environment variable)

Best Practices

Fast mode vs Deep mode

  • Deep mode (deep_search=True, default):
    • Full content extraction from web pages
    • Best for detailed analysis, RAG applications, and comprehensive research
    • Handles JavaScript rendering and dynamic content
  • Fast mode (deep_search=False):
    • Quick SERP-only results with titles and snippets
    • Optimized for high-volume queries where speed is critical
    • Lower cost per query

When to use include_answer

  • Enable include_answer=True when you want a concise, AI-generated summary in addition to the raw search results
  • Useful for quick insights without processing all the raw content yourself

Filtering tips

  • Domain filtering: Use include_domains for academic research or when you need trusted sources. Use exclude_domains to filter out unwanted content types
  • Date filtering: Combine start_date and end_date for time-sensitive queries or recent news
  • Topic routing: Use topic parameter to optimize search for general web content, news articles, or location-based information

Performance optimization

  • Choose the right mode: Use Fast mode (deep_search=False) for high-volume queries where speed matters; Deep mode (default) for comprehensive content extraction
  • Use async operations (ainvoke) when running multiple searches concurrently
  • Tune num_results to the minimum number of results needed to reduce response time
  • Leverage domain filtering to focus on quality sources and reduce noise

API reference

For detailed documentation of all NimbleSearchRetriever features and configurations, visit the Nimble API documentation.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.