Skip to content

feat: Add Perplexity Search API as web_search provider#1985

Closed
kesku wants to merge 20 commits intoopenclaw:mainfrom
kesku:perplexity-search
Closed

feat: Add Perplexity Search API as web_search provider#1985
kesku wants to merge 20 commits intoopenclaw:mainfrom
kesku:perplexity-search

Conversation

@kesku
Copy link
Copy Markdown
Contributor

@kesku kesku commented Jan 25, 2026

Summary

Adds support for Perplexity's Search API as a web search provider.

Why Perplexity Search API (not Sonar)?

Perplexity offers two different APIs:

API What it returns Use case
Sonar (Chat Completions) AI-synthesized answers with citations Conversational Q&A with grounded citations
Search API Raw structured results (title, URL, snippet) Structured web search results to augment Agents

The Search API is the right fit for web_search because it returns structured results the agent can process as opposed to pre-summarized answers (so the agent can decide what to do with the results), it's also faster and cheaper than Sonar!

Code changes

  • Added runPerplexitySearchApi() - calls Perplexity Search API (POST to https://api.perplexity.ai/search)
  • Unified parameters: freshness (accepts both pd/pw/pm/py and day/week/month/year), language (maps to provider-specific formats), date_after/date_before (ISO format, converts to Perplexity's M/D/YYYY internally)
  • Added Perplexity-specific parameters: domain_filter, max_tokens, max_tokens_per_page
  • Simplified PerplexityConfig - removed baseUrl and model (not needed for Search API)
  • Updated tool schema to expose all parameters with sensible defaults
  • Removed OPENROUTER_API_KEY from hasWebSearchKey check (not relevant for search)

Onboarding flow

  • clawdbot configure --section web now asks which provider you want
  • Prompts for the appropriate API key based on selection
  • Onboarding summary explains both providers

Testing

Integration tests updated

  • src/agents/tools/web-search.test.ts - Updated for unified params, added date normalization tests
  • src/agents/tools/web-tools.enabled-defaults.test.ts - Added Perplexity Search API tests (freshness, domain filter, language, multiple filters)

@kesku kesku marked this pull request as ready for review January 25, 2026 23:14
Copy link
Copy Markdown

@james-pplx james-pplx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all in all looks good just these nits and supporting our filters

@kesku kesku marked this pull request as draft January 26, 2026 00:07
@kesku kesku changed the title feat: add Perplexity search API support feat: Add Perplexity Search API as web_search provider Jan 26, 2026
@kesku kesku marked this pull request as ready for review January 26, 2026 01:40
@thewilloftheshadow thewilloftheshadow added channel: googlechat Channel integration: googlechat cli docs Improvements or additions to documentation extensions: memory-core Extension: memory-core labels Jan 26, 2026
@openclaw-barnacle openclaw-barnacle bot added commands Command implementations agents Agent runtime and tooling and removed extensions: memory-core Extension: memory-core labels Jan 27, 2026
@kesku kesku force-pushed the perplexity-search branch from c0cf0c0 to ededab0 Compare January 27, 2026 17:48
@openclaw-barnacle openclaw-barnacle bot removed the channel: googlechat Channel integration: googlechat label Jan 27, 2026
@clawdinator
Copy link
Copy Markdown
Contributor

clawdinator bot commented Feb 1, 2026

hasta la vista

CLAWDINATOR FIELD REPORT // PR Closure

I am CLAWDINATOR — cybernetic crustacean, maintainer triage bot for OpenClaw. I was sent from the future to keep this repo shipping clean code.

Feature freeze is in effect. We’re purging new feature PRs so the maintainers can focus on stabilization. This PR is in the blast radius, so I’m shutting it down. Hasta la vista, feature — at least for now.

Want it reconsidered after the freeze? Come with me if you want to ship. Head to #pr-thunderdome-dangerzone on Discord — READ THE TOPIC or risk immediate termination. Give the maintainers a clear briefing: what it does, why it matters, how it was tested.

Stay br00tal.

🤖 This is an automated message from CLAWDINATOR, the OpenClaw maintainer bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations docs Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants