search

Free, low-latency web search for Pipecat agents.

Exposes the tools of Keenable’s hosted MCP server — search_web_pages and fetch_page_content — so voice agents can look up current information and read specific pages. Drop them into an LLMContext and the LLM auto-registers their handlers:

Example:

from pipecat.services.keenable.search import KeenableWebSearch

search = KeenableWebSearch()
context = LLMContext(messages=[...], tools=await search.tools())

Search runs against a hosted MCP server powered by Keenable AI. No API key is required — keyless requests use pro mode. Pass api_key= for higher rate limits and access to the lower-latency realtime mode (which requires an account with realtime mode enabled); select it with mode=.

pipecat.services.keenable.search.SearchMode

"pro" (higher quality) or "realtime" (lower latency).

Type:

Search mode

alias of Literal[‘pro’, ‘realtime’]

class pipecat.services.keenable.search.KeenableWebSearch(*, api_key: str | None = None, mode: Literal['pro', 'realtime'] | None = None)[source]

Bases: object

Zero-config web search tool for voice agents.

A thin configuration wrapper around MCPClient for Keenable’s hosted MCP server. tools() connects to the server and returns its tool schemas — searching the web and reading a page — with handlers attached, so the LLM registers them automatically when the context’s tools are advertised.

The configured pro/realtime mode is pinned per call and hidden from the model. The connection is closed automatically at pipeline teardown; call close() only to release it earlier (e.g. on client disconnect).

__init__(*, api_key: str | None = None, mode: Literal['pro', 'realtime'] | None = None) → None[source]

Initialize the web search tool.

Parameters:
  • api_key – API key for higher rate limits and realtime access. When unset, the keyless free tier is used.

  • mode – Search mode — "pro" (higher quality) or "realtime" (lower latency, good for voice; requires an account with realtime mode enabled). When unset, defaults to "realtime" if an API key is present, else "pro".

async tools() → ToolsSchema[source]

Get Keenable’s tool schemas, handlers attached.

Connects to Keenable’s server on first use. Pass the result to an LLMContext and the LLM auto-registers the handlers.

Returns:

A ToolsSchema containing every tool the server advertises.

async start() → None[source]

Open the connection to Keenable’s server.

Idempotent, and called automatically by tools(); call it directly only to connect ahead of time.

async close() → None[source]

Close the connection.

Called automatically at pipeline teardown; call it directly only to release the connection earlier. Safe to call multiple times and from any task.