Bing.com search chat with AI
Google BARD AI
You.com
Model card
Versions

Perplexity AI

Short description: Perplexity AI is an AI-powered search and sharing tool. It allows users to create, explore and share topics that interest them, and receive personalized answers with citations to its sources from an AI assistant to any question. What sets it apart from other traditional AI tools, is that Perplexity AI allows users to choose from the received sources (Internet, Youtube, Wiki, Reddit etc.).

Perplexity powers its 'answer engine' with Azure OpenAI Service | Microsoft for Startups Blog
AI-powered search engine Perplexity AI lands $26M, launches iOS app | TechCrunch
What Is The Perplexity Ai And How It Works? - Free AI (techzmag.com)
Perplexity AI - Wiki | Golden Llama
2: Open Foundation and Fine-Tuned Chat Models | Meta AI Research

Description:

Launched on 7 December 2022 by Andy Konwinski, Aravind Srinivas, Denis Yarats and Johnny Ho, Perplexity AI, or simply Perplexity, is a powerful web search engine that uses the architecture based on large language models (LLMs). Perplexity AI is capable of generating natural language processing (NLP) responses displaying the sources from which the model got inspired. The model has been trained on a massive dataset of text and code and can revolutionize the way people search on the internet.

Architecture:

Architecture description: Perplexity’s architecture consists of two main components: the web application and the API, which are connected via REST API.

Web application: This is the front-end part of Perplexity AI that handles user interaction and shows responses. The web interface has different components displayed such as search box, sources, chat window, import/export, copilot or navigation bar.

API: The back-end part of Perplexity AI, the API is responsible with processing the requests from the users and generating responses. Perplexity AI uses the FastAPI web framework for building the APIs together with Python 3.6+ programming language.

Perplexity uses OpenAI's GPT-3 model, which is trained on large amounts of textual data from the Internet. Perplexity AI also uses its own models that are trained on specialized domains and sources such as Wikipedia, Stack Overflow, and others. Perplexity AI combines these models using an ensemble approach to get the best answer to the user's question. Perplexity AI also uses post-processing and ranking techniques to improve the quality and relevance of answers.

Perplexity AI runs on the Microsoft Azure cloud platform, which provides high-performance computing resources and access to the OpenAI service. To interact with the user, Perplexity AI operates with a chatbot that supports conversational style and context. Perplexity AI uses various tools such as graphs, tables, maps, and images to visualize responses.

Key Technical Features:

You can find the technical documentation of the API, by clicking the next link: https://docs.perplexity.ai/docs/getting-started

Software Architecture

Perplexity AI uses Python as the main programming language, which makes it easier to integrate other third parties applications. For performance and other operations, Perplexity also uses C++, JavaScript or React.

Accessing the API

For integrating Perplexity AI into your application, you can access the available API key after authenticating. The API key has no expiration date, being available anytime until it gets refreshed or deleted manually.

alt Source: https://docs.perplexity.ai/docs/getting-started

Example of an API endpoint:

https://api.perplexity.ai/chat/completions

In order to run the above endpoint using a tool like Postman, you will need to add a few body parameters such as: the model (llama, codellama, mistral), messages, max_tokens and use the authorization key.

The next syntax, called curl command, will send a POST request to the Perplexity Chat API to generate a completion for the string “Write a poem about a cat” from the “content” of the message.

alt

The response received from the API will return a JSON text response containing the completion of the content, similar to the next code snippet:

alt

Frameworks:

Model Transformers: The open-source library for loading and fine-tuning large language models, using natural language processing (NLP). Model Transformers provides a unified API for training models from a variety of sources like Google AI, OpenAI and so. Perplexity AI uses Model’s datasets to load and pre-process the data from different sources.

Example of code snippet using Model Transformers:

alt

The code snippet shows a real example of using Model Transformer’s library. The text_prompt contains the message "Translate the following sentence into French: I love you." and needs to be translated to French. The generation of the response accepts few parameters, like the text_prompt that needs to be translated and the maximum length accepted, of 100 tokens length.

The print(completion) command will output the desired result, showing the text translated in French:

alt

TensorFlow: TensorFlow is the most popular open-source framework for building and training machine learning models, developed by Google Brain team. Perplexity AI also uses the OpenAI which is implemented in TensorFlow, offering a great set of tools and resources from high-level APIs for building the models, to low-level APIs for customizing them and a large library of pre-trained models for common tasks.

Example of code snippet integrating TensorFlow with Perplexity AI:

alt

The example from the code snippet loads the GPT-4 model using also the Model Transformers library. The function answer_question(question) will handle the prompt question defined in the question_answering_prompt and question variable. The code will generate a completion response answering to "What is the capital of France?" with a length of 100 tokens long.

The output response displayed in the console:

alt

Pytorch: Pytorch open-source library for machine learning models is based on Torch library and designed in a modular and flexible manner, so that it can easily optimize and speed up things. Perplexity AI uses Pytorch for various tasks like computer vision, natural language processing and speech recognition.

Code example of integrating Pytorch library with Perplexity AI:

alt

Using again the Model Transformes library to load the GPT-4 model, the above code snippet prompts the request to write a Python function that reverses a string and generates a completion afterwards. The output result from the console should print the reversed string, up to 100 tokens long in the Python programming language. You can check the result right here:

alt

ElasticSearch is a distributed analytics and search engine used with Perplexity AI to improve the search relevancy and retrieval of the information displayed. ElasticSearch tool can search through large volumes of texts and indexes, making it easier for users to find and discover the information they requested.

  • Improved search relevance: ElasticSearch uses different techniques aiming to improve the relevance and accuracy of search findings, such as natural language processing and machine learning. This can help users to find the information they need more quickly and easily.
  • Scalability: ElasticSearch was designed to be scalable, in order to handle large volumes of datasets like text data without interfering with the models performance. This is important for Perplexity AI, which generates large amounts of text data.
  • Flexibility: ElasticSearch is a flexible search engine that can be customized and personalized to meet the specific needs of different users and various tasks, handling a large amount of workloads. Having such a variety of use cases, Perplexity’s AI can handle ElasticSearch integration very well with different tasks like search-driven applications, customized search results, search for plain text generated by Perplexity etc.

Flask is a web framework, a module of Python, dedicated for small and large web applications, based on the Werkzeug WSGI toolkit and the Jinja2 template engine. Perplexity AI uses Flask because it’s scalable and has a small and easy-to-extend core. Called also a microframework, Flask does not include ORM (Object Relational Manager) or features based on objects.

Another example of a code snippet using Flask with Perplexity AI:

alt

For integrating Flask with Perplexity AI, you can use the Model Transformers collection, best known for its natural language processing (NLP) capabilities.

The above code creates a Flask application using Perplexity’s GPT-4 LLM. Flask is imported as an extension library. The application aims to generate a text using /generate-text routing via a GET and a POST request. Using the routing inside a web browser, you can enter a text prompt in the text box with a length of 100 token long displayed and play with it. The application will eventually generate a completion for the text from the prompt and display it to you.

This generated code using Flask can be easily extended in order to create more complex functionalities, such as allowing users to choose between various creative content, specify maximum length of the output completion response, integrate other third party libraries for more complex operations and so on. Flask is an easy microframework that allows users to build custom applications, like chatbots, virtual assistants, learning platforms etc.

Other libraries used by Perplexity AI to develop the search engine, accuracy and speed are React, Redux or FastAPI and other several custom-built frameworks. Perplexity AI is a complex tool with various needs that integrates many specific APIs and built-in libraries.

Hardware architecture:

Perplexity’s hardware architecture is similar to other architectures used in large language models (LLMs). Depending on the LLM and the global scope, the most commonly used processors are TPUs and GPUs. Perplexity AI also uses the hardware architecture for its GPT-4 LLM such as:

TPUs (Tensor Processing Unit) are dedicated processors designed for maximizing matrix multiplication operations and accelerating machine learning workloads. Developed by Google Cloud, TPUs are perfectly suited for training and deploying large language models in production. Perplexity AI uses the GPT-4 LLM so nonetheless the TPUs are the best choice for such complex systems to train and deploy models.

GPUs (Graphics Processing Unit) the second most used processor for accelerating machine learning workloads and various tasks, such as natural text creation, translating languages and other tasks. Perplexity AI uses Nvidia’s GPUs to deploy its GPT-4 LLM. These specialized electronic circuits are designed to rapidly manipulate and alter memory to accelerate the creation and manipulation of images, videos or 3D animation.

Areas of application:

  • Perplexity AI can be used for research as it can quickly find relevant information on any topic and provide it in a convenient format.
  • Perplexity AI can be used for education as it can assist students and teachers in learning and teaching different subjects by answering questions and providing explanations.
  • Perplexity AI can be used for entertainment as it can generate interesting and original content such as poems, stories, code, essays, songs, celebrity parodies and more using its words and knowledge.
  • Perplexity AI can be used for businesses as it can help companies and customers with up-to-date information about products, services, prices, reviews, etc.
  • Perplexity AI can be used in the healthcare industry, helping doctors diagnose diseases, or offering the necessary support to patients, answering medical questions and acting like a customer support.

Key Benefits

  • Perplexity AI has high accuracy in answering compared to other traditional search engines as it uses advanced machine learning algorithms and large language models that are able to understand natural language and context of questions.
  • Perplexity AI has great speed in answering questions as it has access to a huge amount of information on the internet and can quickly analyze and filter it.
  • Perplexity AI has a wide reach in answering as it can answer questions on any topic and area of expertise and generate real-time data on user request.
  • Perplexity AI can help users learn new things and explore different perspectives and options, scrolling between reliable and accurate sources. It looks for the relevant up-to-date response from the Internet in real-time
  • Perplexity AI has a friendly interface with various viewing modes answering as it communicates with the user in a conversational manner and provides links to sources of information for further study.

Limitations and disadvantages:

  • Perplexity AI may have some errors in its answers, as it cannot always guarantee the complete accuracy and relevance of the information it finds due to the controversial sources available on the internet. Perplexity’s dependence on the available data, might offer biased information.
  • Perplexity AI may have some trouble understanding some questions, especially if they are too complex, subjective, unclear, or contain non-standard terms or expressions. Human intervention is needed to offer concrete and easy keywords until the model is trained on more datasets regarding complex topics.
  • Perplexity AI may have some limitations in the vocabulary, language ambiguity and creativity understanding. Lack of human judgment and contextual insight might be misinterpreted by the Perplexity AI, so human intervention is a must.
  • Perplexity AI may have some limitations in content generation, as it may not always be able to create unique and high-quality content that meets the user's requirements and expectations.

Tools and Libraries:

  • Perplexity AI uses Python as the main programming language to develop its engine because of its simplicity and versatility compared to other programming languages. Python can be used for a great variety of tasks, such as data processing or model training.
  • Perplexity AI also uses C++ programming language for improving the performance of the model, helpful in creating the back-end functionality, mathematical operations, algorithms and developing new features.
  • Perplexity AI uses JavaScript as well as a front-end programming language for developing the interface of Perplexity AI and other user interfaces, like text boxes, search boxes, uploading files, navigation bars, settings, import and export files.
  • Perplexity AI uses PyTorch as its core library to work with large language models such as GPT-3 and GPT-J, which are capable of generating natural language text.
  • Perplexity AI uses Google’s TensorFlow open-source library for machine learning in order to implement neural network architectures, train models on large datasets and deploy the models in a production environment.
  • Perplexity AI uses NumPy open-source library for scientific computing together with Python, that supports multidimensional arrays, any mathematical procedures and linear algebra.
  • Perplexity AI uses ElasticSearch as its primary search engine to index and store information from various sources on the Internet.
  • Perplexity AI uses Flask as the main framework to build its web interface, which allows users to ask questions and get answers in a conversational way.

Recommendations for selection:

  • Perplexity AI is recommended to be chosen by those who want to get quick and accurate answers to their questions, as well as those who want to improve their knowledge and skills in various fields.
  • Perplexity AI is recommended to be chosen by those who want to experiment with generating a variety of content, check different sources, as well as those who want to have fun and learn something new and interesting.
  • Perplexity AI is the recommended choice for those who want to customize their experience depending on their goals and preferences, and for those who want to control the level of detail and creativity of their responses.
  • Perplexity AI is recommended also cost wise especially when comparing it to other search engines that takes into consideration the speed, quality or accuracy. Perplexity offers a great deal and a variety of models at different prices depending on the needs of the users.

Known Notes:

  • Perplexity AI was created in 2021 by a team of back-end engineers Aravind Srinivas, Denis Yarats, Johnny Ho, and Andy Konwinski, who were interested in the potential of artificial intelligence and large language models to solve conversational search problems.
  • Perplexity AI was named after the concept of perplexity, which refers to the degree of uncertainty or complexity of a text. The lower the perplexity, the better the model understands the text.
  • Perplexity AI uses GPT-3.5 (free version), GPT-4 (copilot) and GPT-J as the main language models for generating natural language text. GPT-3 and 4 is one of the most powerful and advanced language models available today, capable of generating text on almost any topic. GPT-J is an open source alternative to GPT-3 that has similar features and capabilities.
  • There is a public beta version available for users that signed up to Perplexity Pro Subscription. Perplexity Pro offers the copilot feature more often for comprehensive answers (300+ per day), upgraded AI models to Claude 2 or GPT-4, unlimited file upload and customer support, for 20$/month or $200/year.
  • Perplexity introduced one of the latest experiments from Perplexity Labs: LLaMa Chat that promises a faster way to chat with Meta AI’s Llama-2, available right here. Perplexity’s LLaMAs (Learn and Model for Any Application) are trained on massive datasets of text and code and it’s a powerful source for various tasks.
  • Perplexity AI has raised over 26$ million in funding and reached approximately 288K searchers per month, compared to the year before.
  • Perplexity AI released a Google Chrome extension called “Perplexity - AI Companion” and an iOS application “Perplexity AI”. Both applications are still under dev
  • elopment, but they have already been used by a variety of people.

Known Applications:

  • Perplexity AI was used to create Perplexity Quiz, an interactive quiz game where users can test their knowledge on various topics and compete against other players.
  • Perplexity AI was used to create Perplexity Poetry, a service to generate poems based on predefined parameters such as theme, style, rhyme and meter.
  • Perplexity AI was used to create Perplexity Code, a service for generating code according to given specifications such as programming language, functionality and input data.
  • Perplexity Search is a search engine using Perplexity AI’s LLM to create more comprehensive, accurate, up-to-date and informative search results. It’s a quick tool that handles numerous requests and outputs engaging results based on the prompt’s requests.
  • Perplexity Writer, your writer assistant is there to generate and improve users writing style and grammar. This makes it a great tool for journalists, academicians, and other generating texts jobs.
  • Perplexity Knowledge Base is a knowledge base tool that uses Perplexity AI’s large language models to index and organize information from a variety of sources, like Wikipedia, Internet, Youtube etc.

Perplexity AI is still a new search engine company on the market, but has been already used to develop a numerous other applications and third parties libraries, including: chatbots (skilled with natural and informative dialogs with users), virtual assistants (skilled with performing tasks such as booking appointments, offering customer support), educational (helping students and teachers with school materials), creative tools (perfect for artists, writers, musicians).

Leave a review

My assessment: