Nimble’s Search API provides real-time web search by browsing the live web with headless browsers rather than querying pre-built indexes. This retriever handles JavaScript rendering, dynamic content, and complex navigation flows—making it suitable for RAG applications that need access to current web data, including content behind pagination, filters, and client-side rendering.We can use this as a retriever. It will show functionality specific to this integration. After going through, it may be useful to explore relevant use-case pages to learn how to use this retriever as part of a larger chain.
Installation
Usage
Now we can instantiate our retriever:Use within a chain
We can easily combine this retriever into a RAG chain for question-answering:Advanced configuration
The retriever supports extensive configuration for different use cases:| Parameter | Type | Default | Description |
|---|---|---|---|
k | int | 10 | Maximum number of results to return (1-20) |
deep_search | bool | True | Deep mode (default) for full content extraction, or Fast mode (False) for SERP-only results |
topic | str | ”general” | Optimize search for specific content types: “general”, “news”, or “location” |
include_answer | bool | False | Generate AI-powered summary answer alongside search results |
include_domains | list[str] | None | Whitelist specific domains (e.g., [“wikipedia.org”, “.edu”]) |
exclude_domains | list[str] | None | Blacklist specific domains to filter out |
start_date | str | None | Filter results after date (YYYY-MM-DD or YYYY) |
end_date | str | None | Filter results before date (YYYY-MM-DD or YYYY) |
parsing_type | str | ”markdown” | Output format: “plain_text”, “markdown”, or “simplified_html” |
locale | str | ”en” | Search locale (e.g., “en-US”) |
country | str | ”US” | Country code for localized results (e.g., “US”) |
api_key | str | env var | Nimble 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
- Ideal for RAG applications requiring complete content
- Best for detailed research and building knowledge bases
- Handles JavaScript rendering and dynamic content
-
Fast mode (
deep_search=False):- Quick SERP-only results with titles and snippets
- Optimized for performance-sensitive applications
- Best for high-volume queries where speed is critical
- Lower cost per query
Filtering strategies
Domain filtering:- Use
include_domainsfor focused research (academic, government, trusted sources) - Use
exclude_domainsto filter out forums, social media, or unreliable sources - Combine both for precise control over source quality
- Set
start_dateandend_datefor time-sensitive queries - Essential for recent news, current events, or dated information
- Formats: “YYYY-MM-DD” (specific) or “YYYY” (year-only)
- Use
topic="news"to optimize for current events and news articles - Use
topic="location"to optimize for local business and geographic queries - Use
topic="general"or omit for standard web search
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 - Tune result count: Start with smaller
kvalues and increase as needed - Use async: Leverage
ainvoke()for concurrent queries - Cache strategically: Consider caching frequent queries
- Filter wisely: Domain and date filters reduce noise and improve relevance
API reference
For detailed documentation of allNimbleSearchRetriever features and configurations, visit the Nimble API documentation.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.