Skip to content

Add KeenableSearchTool (keyless web search)#2522

Open
ilya-bogin-keenable wants to merge 1 commit into
huggingface:mainfrom
keenableai:keenable-search
Open

Add KeenableSearchTool (keyless web search)#2522
ilya-bogin-keenable wants to merge 1 commit into
huggingface:mainfrom
keenableai:keenable-search

Conversation

@ilya-bogin-keenable

Copy link
Copy Markdown

Adds a KeenableSearchTool backed by the Keenable Search API.

Unlike the key-gated backends (GoogleSearchTool, ApiWebSearchTool) it is keyless by default — the public endpoint needs no account or API key (rate-limited to 1,000 req/hour). An optional KEENABLE_API_KEY only lifts the rate limit; it is never required. It uses the shared web_search tool name and mirrors ApiWebSearchTool's shape (per-second rate limit + markdown output), so agents select it like any other search backend:

from smolagents import CodeAgent, KeenableSearchTool, InferenceClientModel

agent = CodeAgent(tools=[KeenableSearchTool()], model=InferenceClientModel())  # keyless
agent.run("What are the latest developments in retrieval-augmented generation?")

Context: the maintainer of txtai suggested smolagents as the right home for this (neuml/txtai#1127) — txtai already adapts smolagents tools, so this unblocks that ecosystem too.

Changes:

  • default_tools.pyKeenableSearchTool + __all__ export (not added to TOOL_MAPPING since it shares the web_search name, same as ApiWebSearchTool/GoogleSearchTool)
  • docs/source/en/reference/default_tools.md — reference entry
  • tests/test_default_tools.py — keyless vs keyed endpoint selection + no-results handling

Verified: 3 new tests pass, ruff clean, and the keyless endpoint was self-tested live.

🤖 Generated with Claude Code

Adds a KeenableSearchTool backed by the Keenable Search API. Unlike the
key-gated backends it is keyless by default (public endpoint,
rate-limited); an optional KEENABLE_API_KEY only lifts the rate limit. It
mirrors ApiWebSearchTool's shape (rate limit + markdown output) and the
existing `web_search` tool name, so agents select it like any other
search backend.

- default_tools.py: KeenableSearchTool + __all__ export
- docs: default_tools reference
- tests: keyless/keyed endpoint selection + no-results

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant