DocsAI Connect / Perplexity

Perplexity

Perplexity prefers its own search engine, but combining the Perplexity API with a bit of code lets you delegate patent-heavy queries — where its native answers fall short — to FindIP. The same pattern works in any custom chatbot built on Sonar API + Function Calling.

Prerequisites

A Perplexity API key (Sonar) plus a FindIP API key. The Spaces UI doesn't allow direct external-tool registration, so code-level integration is the norm.

Setup steps

1

Prepare API keys

Store both keys in separate environment variables.

bash
export PERPLEXITY_API_KEY="pplx-..."
export FINDIP_API_KEY="psk_live_..."
2

Routing logic

Route patent-related queries — keywords like "patent", "applicant", "claim" — to FindIP, and send general web questions to Perplexity Sonar.

python
import os, re, requests

PATENT_HINTS = ("patent", "applicant", "claim", "filing", "invention")

def route(query: str):
  if any(h in query.lower() for h in PATENT_HINTS):
      return "findip"
  return "perplexity"

def call_findip(query):
  return requests.post(
      "https://api.findip.ai/api/v1/search/semantic",
      headers={"X-API-Key": os.environ["FINDIP_API_KEY"]},
      json={"query": query, "top_k": 10},
  ).json()
3

Cite the results

Surface publication_number, title, and applicant from the FindIP response in citation form alongside the Perplexity answer.

Sample prompt

Prompt

"Compare the key OLED-display burn-in compensation patents from LG Display and Samsung Display."

Troubleshooting

Perplexity's own answers lack patent detail.

Perplexity is built on a web index, so patent claims and filing data are fragmentary. Routing patent queries through FindIP is essential.

FindIP — Semantic Patent Search