Code Monkey home page Code Monkey logo

clarity's Introduction

Clarity

Welcome to Clarity, the recipe for a perplexity.ai clone!

If you're looking for a way to improve your understanding and gain clarity on any topic, this repo has got you covered.

Usage

index.js has the basic skeleton you need to intergrate this recipe in your own project.

What is Perplexity?

With perplexity.ai, users can input search queries and receive summaries of top search results including sources. However, with this recipe, you are shown how to achieve similar results in just five simple steps!

The steps for reproduction

This repo shows how you can get similar results to perplexity.ai using the following steps:

  1. Create search query from the input of the user
    • The user creates a query then submits it to ChatGPT for ChatGPT to make a query out of it.
  2. Extract urls from the search query
    • The query is submitted to a search engine, in this case DuckDuckGo, which returns urls.
  3. Extract the content from x amount of urls
    • Take some urls and read the innerText content of it cutoff at around 2-3k tokens so there is room for a ChatGPT response which maxes out at about 4k tokens.
  4. Make a summary of the content
    • The response of the previous step is the summary of the query. And because it loops x amount of urls you get multiple summaries, knowing the sources.
  5. OPTIONAL Make a summary of all the summaries for the response
    • It can be helpful to have a summary of the summaries, but it is not recommended to get sources from this, as they might be scrambled or contaminated.

clarity's People

Contributors

spaghettifibonacci avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.