Skip to main content

Overview

KeenableWebSearch exposes web search and page reading capabilities to your Pipecat agents through a hosted MCP server powered by Keenable AI. It provides two tools that can be registered directly with your LLM context:
  • search_web_pages: Search the web for current events, news, or facts with optional site and date-range filters
  • fetch_page_content: Read the text content of a specific web page
Pass await search.tools() to your LLMContext and the LLM auto-registers the tool handlers, allowing your agent to answer questions about current events and information beyond the model’s training data.

Keenable AI

Learn more about Keenable’s web search and MCP services

Example

Complete voice agent example with web search

Installation

Prerequisites

API Key (Optional)

No API key is required to use Keenable web search — it works keyless by default using the free tier with pro mode. However, you can optionally provide an API key for:
  • Higher rate limits
  • Access to realtime mode (lower latency, ideal for voice agents)
If you choose to use an API key, pass it to the constructor as api_key, for example api_key=os.getenv("KEENABLE_API_KEY"). The service does not read the environment itself.

Configuration

str | None
default:"None"
API key for higher rate limits and access to realtime mode. When unset, the keyless free tier is used.
Literal["pro", "realtime"] | None
default:"None"
Search mode: "pro" for higher-quality results, or "realtime" for lower latency (requires an account with realtime mode enabled). None selects "realtime" when an API key is provided, otherwise "pro".

Available Tools

When you call await search.tools(), the following tools are registered:

search_web_pages

Search the web with optional filters:
  • site: Limit results to a specific domain
  • date_range: Filter by date range
  • mode: Automatically set to the configured mode (pro or realtime)

fetch_page_content

Read the full text content of a specific web page by URL.

Usage

Basic Setup

Complete Voice Agent

Manual Connection Management

The connection to Keenable’s server is managed automatically, but you can control it explicitly if needed:

Notes

  • The connection to Keenable’s server is opened on the first call to tools() and closed automatically at pipeline teardown
  • The configured mode (pro or realtime) is pinned per request and hidden from the model
  • realtime mode requires an account with realtime mode enabled; keyless access defaults to pro mode
  • The start() method is idempotent and called automatically by tools()
  • The close() method is safe to call multiple times and from any task