> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keenable.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Every page is listed in https://docs.keenable.ai/llms.txt. To pick a product for a job, read https://docs.keenable.ai/choose.md
> Setup steps for agents, covering the SDKs, the MCP server and the CLI: https://docs.keenable.ai/skill.md
> Keenable search and fetch work without an API key. To add them to code, use the official SDK for the project's language: https://docs.keenable.ai/sdks.md
> Without a key, call POST https://api.keenable.ai/v1/search/public or GET https://api.keenable.ai/v1/fetch/public with an X-Keenable-Title header that names your app.
> With a key, send it in the X-API-Key header and read it from the KEENABLE_API_KEY environment variable. Never ask a user to paste a key into chat. Every access method: https://docs.keenable.ai/auth.md
> To get an API key without the console, use device login: https://docs.keenable.ai/authentication.md#device-login
> MCP server: https://api.keenable.ai/mcp (no key, or X-API-Key; keyless Codex uses https://api.keenable.ai/mcp-public), or https://api.keenable.ai/mcp-oauth for OAuth sign-in. These docs are an MCP server at https://docs.keenable.ai/mcp and the OpenAPI spec is at https://docs.keenable.ai/api-reference/openapi.json
> Keenable searches and fetches public web pages. If a question needs no web information, skip the call.
> On 402 with an API key (code insufficient_credits), stop and ask a human to add credits; don't retry. On 429, wait the number of seconds in Retry-After, then retry. Before you ship, follow https://docs.keenable.ai/production.md
> Every error, with its cause and fix, is in https://docs.keenable.ai/errors.md and moving from another search API is covered in https://docs.keenable.ai/migrate.md
> Before you compare Keenable with another search API, read https://docs.keenable.ai/guides/evaluate-search-apis.md

# LazyLLM web search tool

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

*Search tool in LazyLLM*

`KeenableSearch` gives [LazyLLM](https://github.com/LazyAGI/LazyLLM) apps and agents Keenable web search. It sits next to LazyLLM's other search tools, such as `TavilySearch` and `BingSearch`, returns results in the same shape, and works without an API key.

→ [KeenableSearch in the LazyLLM repository](https://github.com/LazyAGI/LazyLLM/blob/main/lazyllm/tools/tools/search/keenable_search.py)

## Install

`KeenableSearch` was merged into LazyLLM's main branch on 2026-11-18. LazyLLM 1.5.2, the latest release on PyPI, does not include it yet, so install from GitHub:

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
pip install "lazyllm @ git+https://github.com/LazyAGI/LazyLLM.git@b1458ec"
```

`b1458ec` is the commit that added `KeenableSearch`. LazyLLM builds a C++ extension when you install from source, so you need a C++ compiler, such as Xcode Command Line Tools on macOS or `build-essential` on Debian and Ubuntu. The build fetches CMake and pybind11 itself. The wheels on PyPI are prebuilt and need no compiler.

Once a later LazyLLM release includes it, `pip install -U lazyllm` works too.

## Search the web

Create the tool and call it with a query:

```python theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
from lazyllm.tools.tools import KeenableSearch

keenable = KeenableSearch()  # no API key required
results = keenable("open-source vector databases compared", max_results=5)

for item in results:
    print(item["title"], item["url"])
```

You get a list of dictionaries, one per result, each with `title`, `url`, `snippet` and `source`. `source` is `"keenable"`. Results without a URL are dropped.

Calling the tool runs `keenable.search(...)`. If the request fails, the call logs the error and returns an empty list. Pass `raise_on_error=True` to get the exception instead:

```python theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
results = keenable("open-source vector databases compared", raise_on_error=True)
```

## Give it to an agent

`search` is registered as a function-calling tool, so an agent can call it with a `query` and an optional `max_results`. The tool also inherits `get_content` and `get_contents` from LazyLLM's `SearchBase`. Those read a result's page with a direct HTTP request from your machine, not through the Keenable [Fetch API](https://docs.keenable.ai/api-reference/fetch.md).

## Options

| Parameter | Default | What it does |
| - | - | - |
| `api_key` | `None` | Keenable API key, sent as `X-API-Key` to `/v1/search`. Without one, the tool calls the keyless `/v1/search/public`. |
| `base_url` | `"https://api.keenable.ai"` | API root, for routing through your own gateway. |
| `timeout` | `30` | Request timeout in seconds. |
| `source_name` | `"keenable"` | Value of `source` on each result. |
| `max_results` | `10` | Argument of `search`. Values above 50 are sent as 50. |

Each `snippet` is Keenable's `snippet` field, cut to 700 characters by LazyLLM. Long snippets get `extra.truncated` set to `True`.

> [!NOTE]
>
> Without a key, calls run on the shared public tier at [lower rate limits](https://docs.keenable.ai/rate-limits.md). Pass `KeenableSearch(api_key=...)` to use your organization's limits and remove the hourly cap. See [API keys](https://docs.keenable.ai/api-keys.md).

## Related pages

> [card] [LlamaIndex](https://docs.keenable.ai/integrations/llamaindex.md)
>
> Give LlamaIndex agents web search and page reading with the Keenable ToolSpec.

> [card] [LangChain](https://docs.keenable.ai/integrations/langchain.md)
>
> Give LangChain agents web search and page fetch with langchain-keenable: the KeenableSearch and KeenableFetch tools.

> [card] [Mastra](https://docs.keenable.ai/integrations/mastra.md)
>
> Give Mastra agents web search and page fetch with the @keenable/mastra package: the keenable-search and keenable-fetch tools.

> [card] [Overview](https://docs.keenable.ai/sdks.md)
>
> Install the official Keenable SDK for Python, TypeScript, Go or Rust with one command, search with no key, then add fetch, tool calling and Monitors.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.