Skip to main content
This guide shows how to get started with the Keenable tools for LangChain Python. For all Keenable features and settings, see the rest of these docs. Keenable is web search infrastructure for AI labs and agents, built on its own crawler and an independent index of over 100 billion documents. Search and fetch run over REST, MCP and a CLI.

Overview

Details

Features

  • KeenableSearch queries the Keenable search API and returns a list of result dictionaries, 10 per search.
  • KeenableFetch fetches a page and returns its main content as markdown.
  • Pricing: with an API key, 100,000 free requests a month, no card required, then $4 per 1,000. One search or fetch is one request. Calls without a key and failed calls aren’t billed. See pricing.
  • Without an API key, both tools use Keenable’s keyless public endpoints: 1,000 requests an hour and 10 a second per IP address. With a key, the limit is 10 requests per second per organization by default. See rate limits.
  • All search filters are per call, so an agent can vary them per query.
  • Rate limit (429), auth (401) and credit (402) errors, network timeouts and malformed responses reach the agent as an error string instead of crashing the agent loop.
  • Both tools support await tool.ainvoke({...}); the request runs in a worker thread.

Setup

Install the langchain-keenable package. An API key is optional.

Credentials

Create a key under API keys in the console and set it as KEENABLE_API_KEY:
Set API key
Without KEENABLE_API_KEY, the tools call the keyless endpoints.

Installation

The Keenable tools live in the langchain-keenable package:

Instantiation

Initialize tool instance
mode defaults to "pro" (deeper retrieval). It can be set as a class default and overridden per call.

Invocation

Directly

KeenableSearch takes query and optional filters: site (restrict to a domain), published_after and published_before (YYYY-MM-DD), and acquired_after and acquired_before, bounds on the date Keenable indexed the page (YYYY-MM-DD). objective (optional, at most 1,000 characters) says what the search is for: what the query leaves out and what earlier searches found. Keenable ranks results by query and objective together, but retrieval reads only query, so put the words that matter in query. Pass objective for multi-step or ambiguous questions, not every search. KeenableFetch takes url.
Call tool
Output
Each search result has title, url, description, snippet, published_at and acquired_at. The fetched page has url, title, content, description, author, published_at, image, favicon, truncated and total_chars.

As a ToolCall

ToolCall
Called with a tool call, the tool returns a ToolMessage whose content is the results as a JSON string.

Within an agent

Agent with tool
The agent sets site and published_after on its own. Its first tool call:
After a few more searches, it fetches each release post and answers:
Output

Use through MCP

LangChain’s MCPAdapter turns an MCP server’s tools into LangChain tools. Keenable’s hosted MCP server gives the agent search_web_pages and fetch_page_content:
The langchain.mcp namespace requires langchain[mcp]>=1.4.0 and is in beta. See MCP server for the tools and their parameters.

API reference

For all Keenable features and settings, see the rest of these docs: rate limits, errors and the search API. Moving from another search tool? See the migration guides.

LlamaIndex

Give LlamaIndex agents web search and page reading with the Keenable ToolSpec.

Haystack

Add web search and page fetch to Haystack pipelines with the Keenable components.

LazyLLM

Search the web from LazyLLM with KeenableSearch, a built-in search tool that works without an API key. Install LazyLLM from its main branch.

Tool calling

Give an LLM web search and page fetch as tools. Pass the SDK’s TOOLS to any OpenAI-compatible chat completions client and run each call with run_tool_call.