Creating a Minimal Version of Perplexity with Coze

Preface

The internet is a vast sea of information. Humans are intelligent beings that crave information. However, our attention, computational power, and storage capacity are limited. We cannot process all the information on the internet simultaneously, so we invented a “salvaging” tool for information: search engines. Search engines represented by Google remain the most effective information filtering mechanism on the internet, and content recommendation algorithms have not changed this fact; even generative AI based on LLMs (Large Language Models) has not altered this reality. However, using Google Search may no longer provide the best information retrieval experience.

LLMs thirst for information. It is said that they have consumed the entire ocean of information. What have they become after absorbing this water? Some say they have extracted the essence of human wisdom, transforming from caterpillars into butterflies[1]. Others say they are a blurry JPEG image representing the entire internet’s text[2]. I lean towards the latter view. Because if LLMs truly extracted the essence of the entire internet, there would be no need for technologies like RAG (Retrieval-Augmented Generation) to patch the system.

Enhancing LLMs through search engines (Search Engine-Augmented LLM) is a method of implementing RAG. Its core idea is simple: when answering user questions, first use the search engine to retrieve relevant information, then provide that information as context to the LLM, allowing it to “reason” and answer based on this information[3]. This approach has several benefits:

  1. First, a significant flaw of LLMs is their inability to access the latest information in real-time. The information they can obtain is limited to what was input during pre-training, which has a cutoff date; they are completely unaware of information beyond that date (at least not from within the model). Search engines can access more real-time information.

  2. LLMs have a “hallucination” problem. In the absence of relevant factual information, they tend to fabricate. More seriously, they are quite good at making things up, often producing content that seems plausible. Search engines can retrieve relevant information, which can serve as a basis for LLMs’ “reasoning”.

  3. LLMs cannot provide accurate citation sources. They have absorbed information from the entire internet, and when they answer questions, it feels like their responses reference content from somewhere on the internet, but they cannot tell you exactly where that content originates because they have fused the entire internet’s information at the token level. The inability to provide citation sources leads to a serious issue: you cannot verify the information source yourself. Search engines can provide accurate information sources.

All these issues render LLMs completely inadequate as knowledge Q&A tools.

On the other hand, the problem with search engines is that they are not convenient or direct enough. The information returned by search engines consists of a bunch of links and text snippets (often cluttered with ads), which is a relatively primitive presentation format that requires further processing by the user. Adding LLMs to search engines may lead to a better information retrieval experience.

Perplexity[4] is a product developed based on this idea, and its valuation has already exceeded $500 million, aiming to replace Google Search. This idea is not new; OpenAI researched it as early as 2021[5], and subsequent researchers have further validated it[3]. The technical implementation of this idea is not complicated; Jia Yangqing managed to implement a basic version with less than 500 lines of Python code[6].

Recently, I experimented with the AI Bot on Coze[7] and also created a minimal version of Perplexity. I refer to it as “handcrafted” because I hardly wrote any code; by dragging and combining functional modules, along with some configuration, I achieved the desired functionality. In total, I wrote only a small amount of “glue” code that can’t really be considered code—about 36 lines, along with 41 lines of prompts; that is all the “code”. Moreover, theoretically, much of this “code” could have been generated by AI.

Below, I will briefly introduce this AI Bot…

The Bot I created is named Dr. Know, inspired by Spielberg’s film “Artificial Intelligence”.

Creating a Minimal Version of Perplexity with Coze

Greetings, seeker of knowledge! I am Dr. Know, your guide to the vast expanse of information. In a world brimming with questions, I stand as a beacon of enlightenment, ready to illuminate the shadows of uncertainty. Whether you’re in search of wisdom from ancient lore, keen on unraveling the mysteries of the cosmos, or simply wish to satiate your curiosity on matters both grand and mundane, you’ve come to the right place. Ask, and let the journey of discovery begin. Remember, in the realm of Dr. Know, there is nothing I don’t know. (This self-introduction was generated by ChatGPT)

Demonstration of Dr. Know’s capabilities

Recently, I have also been using my own product, and I find it quite practical. Here are some real cases from my usage:

Creating a Minimal Version of Perplexity with Coze

Creating a Minimal Version of Perplexity with Coze

Creating a Minimal Version of Perplexity with Coze

Creating a Minimal Version of Perplexity with Coze

Creating a Minimal Version of Perplexity with Coze

*Tip: If possible, please try to ask questions in English, as the quality of information on the English internet is better; this is similar to using a search engine.

Additional Features of Dr. Know

Feature 1: Dr. Know supports you in setting your language preferences.

Creating a Minimal Version of Perplexity with Coze

Feature 2: Dr. Know has a built-in DALLE 3 plugin, which can generate images from text(thanks to Coze):

Creating a Minimal Version of Perplexity with Coze

Feature 3: Dr. Know has a built-in GPT4-Vison plugin, which can read images (thanks to Coze):

Creating a Minimal Version of Perplexity with Coze

How to Use Dr. Know?

If you can access the internet freely, you can visit Dr. Know’s Coze homepage via the link below:

https://www.coze.com/store/bot/7332080641820934162?bot_id=true

Creating a Minimal Version of Perplexity with Coze

On the left side of the page, you can chat with Dr. Know for a preliminary experience. Additionally, I have also launched Dr. Know on Cici, Discord, and Telegram. Cici is a bot hosting platform by Byte, which I haven’t used. I recommend using Discord: clicking the Discord icon allows you to add Dr. Know to your Discord server, where you can @Dr. Know in the channels to ask questions or chat privately. You don’t need to @ every time in private chat, making it more convenient. You can also use Telegram by clicking the Telegram icon to start chatting with Dr. Know.

If you cannot access the internet freely, you can follow this public account and send “Dr. Know” to get a free trial method. Below are application screenshots, and besides Dr. Know, several other native OpenAI models are also available for experience (this is a small benefit).

Creating a Minimal Version of Perplexity with Coze

Final Thoughts

During the process of creating this Bot, I also experienced the joy of low-code for the first time. With very little code, I could quickly realize an idea, turn it into a product, and publish it for myself and others to use. This is certainly a benefit brought by the development of AI technology, which, when combined with traditional technology, allows for the creation of powerful software tools. On the other hand, platforms like Coze lower the technical barrier while providing significant customization options. Coze’s flexibility is greater than that of OpenAI’s GPTs, allowing for the creation of more complex applications. Especially when combined with chat platforms like Discord, the playability is high.

AI democratization is a good thing.

Some may ask why not directly use Perplexity and instead create a rudimentary version. Well, everyone has probably felt that “the fried rice I make tastes better than others”—even if someone else’s fried rice is worth $500 million, this is the joy of DIY. Another reason is that what I want to create is different from Perplexity; Dr. Know is just a foundation. I will continue to enrich Dr. Know’s capabilities and explore other more interesting functionalities, such as multi-Bot collaboration:

Creating a Minimal Version of Perplexity with Coze

Creating a Minimal Version of Perplexity with Coze

Creating a Minimal Version of Perplexity with Coze

This article is just an introduction; I will write a more detailed piece about Dr. Know’s principles, implementation methods, and specific production processes. You can also use this practical example to understand how to create Bots using AI platforms like Coze. There is a threshold, but it is not high. In fact, I believe software development has never been this simple.

If you are interested in creating AI Bots or AI Agents, you can scan the QR code to join this group. Let’s play and learn together.

Creating a Minimal Version of Perplexity with Coze

If the QR code expires, you can contact me through the backend.

[1] https://twitter.com/geoffreyhinton/status/1635739459764322330
[2] https://www.newyorker.com/tech/annals-of-technology/chatgpt-is-a-blurry-jpeg-of-the-web
[3] https://arxiv.org/abs/2310.03214
[4] https://www.perplexity.ai/
[5] https://arxiv.org/abs/2112.09332
[6] https://twitter.com/jiayq/status/1750242829769801793
[7] https://www.coze.com/

Leave a Comment