Used to check for browser translation.
用于检测浏览器翻译。
ブラウザの翻訳を検出する

Use AIGNE to build a knowledge search similar to Perplexity within 10 minutes

Robert
Jun 5, 2024 · edited
B
Blogs
cover

With our no-code application engine AIGNE, we can create an app similar to Perplexity.ai in less than 10 minutes, without writing a single line of code!

The following video will give you a general understanding of what Perplexity is and how we use AIGNE to implement it.

Below are the links, you can experience them by yourself:

Of course, the Demo App we made in 10 minutes, though similar in functionality, still has some distance in detail from the flagship work of a company valued at $1 billion.😂 I believe readers can understand that this is just a demo.

What is Perplexity.ai?#

Perplexity.ai is a conversation-based search engine based on artificial intelligence, which can use natural language to predict text to answer queries.

It is the world's first search engine to integrate dialogue and links, capable of recognizing and responding to vague or abstract natural language queries. The company was founded in 2022, headquartered in San Francisco, and has raised over $165 million in funding, with a valuation of over $1 billion.

The following is the answer to the question "What is ArcBlock" on Perplexity, which integrates information from various sources:

image.png

The implementation principle of Perplexity#

The basic principle of Perplexity is actually very simple, by using search engines to find information related to user queries, allowing large language models to organize the search results into more readable and complete content. Recently, search engines like Google, Bing, etc. all have started to display more readable summary information on search result pages, and the principle behind their implementation is similar.



For example, searching "What's ArcBlock" directly on Google gives the following results:

image.png

You can see that there is actually a considerable amount of relevant information on this page, but we need to read and summarize it one by one. In the past, when we did research using search engines, this was often the case. What Perplexity does is automate this summarization under the support of a large language model.

A more complex and in-depth implementation can also use multi-round dialogue mechanisms supported by large language models or similar mechanisms like CoT (Chain of thoughts) to further study and refine the content, using multiple different search engines, and going deeper into internal links to obtain more content, thereby drawing more comprehensive conclusions.

Achieve in 10 minutes with AIGNE#

Using AIGNE to implement Perplexity is very simple, you just need to define an AI Agent to easily achieve it, so if you know the above principles and can proficiently use AIGNE, you can completely implement this basic version in 10 minutes.

Inputs#

Each AI Agent in AIGNE contains three parts: input-processing-output.

Our AIGNE input has a unique design: our input can come from another Agent. This is a "functional" or "modular" design approach that allows for a very simple and elegant way to address problems that may be very complex or difficult to describe from a procedural perspective.

image.png

Here our input, in addition to one from the user asking about question, has another input, which is searchResult, that is the return result of the Search Engine, and the call of the Search Engine is an installable Agent in AIGNE, that users can use directly.

image.png

Currently we only provide the built-in Google Search, but this can be expanded as needed, by installing new Blocklets or by implementing an Agent to connect to any other external search API.

Processing #

Here we use the Prompt from the large language model. Here is the way prompt is written in our Demo:

Use the following context as your learned knowledge, inside <context></context> XML tags.
<context>
{{ searchResult }} 
</context>
When answer to user:
- If you don't know, just say that you don't know.
- If you don't know when you are not sure, ask for clarification.
Avoid mentioning that you obtained the information from the context.
And answer according to the language of the user's question.

If there are obviously irrelevant items in the list of the context, ignore those.

When possible, categorize the answers as lists for easy reading.

Write a comprehensive report at least 3 paragraph and try the best to cover everything in the context.

It can be seen that searchResult is used as part of the prompt, and during execution, Google search results are filled in this place.

This prompt is very simple and straightforward, you can write this prompt in your own language, and you can make your requirements for LLM as detailed as possible. You can try to modify it yourself and experience the changes brought by these prompt modifications. This process will help you understand how the large language model works.

Outputs#

If there is some "magic" in AIGNE, then all this "magic" is defined in the output section:

image.png

You can see that we support many different variables in the output of each AI Agent, and users can continuously expand these variables. Any of these output variables can be bound to the page structure template (Layout) and component template defined by our Pages Kit, thus rendering various required results.

In Mockplexity, we only use a few of the most basic templates provided by the system, such as simple chat. This template is similar to a conversation interface, but we have turned off common elements in the conversation such as usernames and avatars. As for the output of the content, we display search results in list form and output content in Markdown format. These combinations form an interface similar to Perplexity.

image.png

You can define these output variables one by one in AIGNE Studio, which is key to creating rich and colorful application output effects, and here you can combine and extend with Blocklets to create endless combinations, so you can define almost any interface needed for an application using this method.

Here is the final of Mockplexity running, you can modify and adjust it yourself to experience what changes it will produce.

image.png

Other projects similar to Perplexity#

Perplexity did give many people a dazzling feeling when it was introduced, but soon everyone realized it was just a better user interface, so quite a few other projects also adopted similar styles to achieve interfaces similar to it.

There are also many open source projects that demonstrate how one can implement similar effects by themselves, interested developers can search and discover many similar open source implementations.

In addition to different implementations, we also see some products using similar interfaces to perform specific functions. For example, devv.ai is a search service dedicated to solving developers' problems. It uses a interface similar to Perplexity, but its main source of information is software development-related services.

image.png

How to turn this Demo into a real product#

The demo app we made in 10 minutes, while functionally similar, still has some shortcomings in details, such as user experience, design style, and functional completeness, compared to the flagship work of a company valued at 1 billion dollars.

Believe readers can understand that this is just a demo, it is to demonstrate basic functionality and potential, but how to further optimize and improve based on this demo, become a more mature product? Here I have some ideas, can be used as a primer:

  • Support for more search backends, such as searches from private enterprise data, is the greatest advantage brought by decentralized deployment.
  • As a search interface for specific businesses, interfaces similar to Perplexity have proven their user-friendliness, allowing the functionality generated by this AIGNE to be combined with one's own business search.
  • Combined with other features, you can save the content searched out by Mockplexity to your own notes, blog or knowledge base (this can be done using our Discuss Kit Blocklet) to form a research notes knowledge system.

More innovative application ideas need to be explored by you. A crucial point is that the applications built by AIGNE are decentralized applications based on the ArcBlock platform, which has more advantages in data privacy, security, private deployment, etc. compared to SaaS services like Perplexity.


2.0.175