Connecting to Perplexity AI


Launched in 2022, Perplexity AI revolutionizes the search experience by offering conversational interactions, thanks to its use of natural language processing. This isn't your typical search engine spitting out links; instead, it delivers direct, succinct answers using language models similar to those developed by OpenAI.

For those looking to integrate HARPA AI with Perplexity.AI, there are two straightforward pathways: an OpenRouter connection or a simple REQUEST step. This guide dives into both methods, but before we get into the nuts and bolts, let's take a moment to set side by side the search capabilities of Perplexity AI with the built-in Search Agent Command, highlighting the nuanced differences and advantages.

# HARPA Search Agent vs. Perplexity AI

For a fair comparison, we chose the GPT-3.5 connection in HARPA AI, which significantly lags behind the GPT-4 in search performance. The connection to Perplexity was made through OpenRouter, with the most advanced model selected - Perplexity: PPLX 70B Online.

# Test 1. Simple query

The Quick Search option in the Search Agent was used:

Simultaneously, the same question was asked on the Perplexity web version. The quality of the answer is quite superficial and significantly inferior to the advanced, paid version of Perplexity: PPLX 70B Online.

Let's take a clarifying question from here and ask it.

Follow up question

Both options performed equally well, except that the HARPA AI Search Agent provided a link to download the Tor Browser:

It's worth noting that the Perplexity web version also helped the user find this link, whereas the API version is limited to text responses only.

# Test 2. Complex query

This comparison will be an excellent marker for understanding the principles of operation of two different search agents, which were asked one question: What annual percentage yield is considered an average benchmark for a good real estate investment in 2023?

The DEEP RESEARCH option was used in the /Search Agent command, corresponding to the complexity of the query in connection with GPT-3.5.

As we see, the question does not mention the country or region where we want to make a real estate investment, however, Perplexity made an incorrect assumption and provided us with answers about the current situation in the US and the differences between states, which we did not ask about. The question was asked from Finland, where our company is located.

Moreover, the user was not provided with links for in-depth study of the question. Presumably, this problem with Perplexity AI is due to the mixing of local SERP results into the analysis result, and local SERP results are taken either from the region where the Perplexity server is located or from a fixed country. We cannot suggest any other explanation for this fact.

The HARPA AI Search Agent, conducting this search automatically divides one question into sub-questions, obtaining SERP information not only from your query but also from two additional sub-queries:

  • Current average real estate investment APY?
  • Factors influencing 2023 real estate APY?

Because of this, the search result is more relevant to the given question.

The Perplexity AI web version made the same mistake, spoiling the result of the issue, making it irrelevant to the search query.

Let's use a clarifying question from here and ask it for comparison.

Follow up question

Both search agents handled this question equally well. It is worth noting that the question is basic, does not require additional knowledge and web search.

The web version of Perplexity also performed well:

# Comparison results

Our comparison experiments show that even with the condition of a free connection with GPT-3.5, HARPA AI's responses to complex questions are more relevant and allow the user to get a comprehensive answer to the first request and all subsequent follow-ups. The identified problem with Perplexity AI is that this search system exclusively uses Google SERP results in the US region as its basis for providing data, which can be irrelevant to the user's query.


If you're still interested in connecting with Perplexity, we'll describe it in the following chapters.

# Connecting HARPA AI to Perplexity AI

# Connecting to Perplexity via OpenRouter.

  1. Follow this guide to set up your OpenRouter.
  2. On the model search page, find Perplexity models.

  1. Choose a model. In our comparison, we used the most advanced one: Perplexity: PPLX 70B Online.
  2. Go to the model's page via the link and copy its name (e.g., perplexity/pplx-70b-online) into the API KEY connection menu in HARPA AI.

  1. The connection setup is complete, and you can start asking your questions to Perplexity.

# Connecting to Perplexity via REQUEST step

  1. Register on the Perplexity.AI website.
  2. Add your payment information in your profile.
  3. Select your model available for API connection.
  4. Create a custom command in HARPA AI.
  5. Add the first ASK step, which will inquire about your search query and save it as the parameter {{query}}.

  1. Create a convenient model selector for yourself through the second ASK step.

- label: ๐Ÿ”Š sonar-medium-online (8x7B | 12k)
  value: sonar-medium-online
- label: ๐Ÿ”ˆ sonar-small-online (7B | 12k)
  value: sonar-small-online
- label: ๐Ÿ’Ž gemma -7b-it
  value: gemma-7b-it
- label: ๐Ÿ’Ž gemma-2b-it
  value: gemma-2b-it
- label: ๐ŸŒช๏ธ mixtral-8x7b-instruct
  value: mixtral-8x7b-instruct
- label: ๐Ÿ’ก mistral-7b-instruct
  value: mistral-7b-instruct
- $custom
  1. Add the REQUEST step that will fetch a response via the API based on your {{query}}, using the connection model specified in the {{model}} parameter. Don't forget to include your API key from your Perplexity account.

  1. Add the GPT step that will extract the text from the JSON response obtained through the API.

Extract the content/answer provided by the assistant from the following JSON response:
\\ * Provide only the extracted text and nothing else.
  1. Your connection is set up.
Contact us
HomeUse CasesGuidesPrivacy PolicyTerms of Service