• Stars
    star
    1,064
  • Rank 43,399 (Top 0.9 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 1 year ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple Perplexity AI clone.

Clarity AI

Clarity is simple perplexity.ai clone. Use the code for whatever you like! :)

If you have any questions, feel free to reach out to me on Twitter.

Clarity AI

How It Works

Given a query, Clarity fetches relevant, up-to-date information from the web and uses OpenAI's API to generate an answer.

The app works as follows:

  1. Get query from user
  2. Scrape Google for relevant webpages
  3. Parse webpages for text
  4. Build prompt using query + webpage text
  5. Call OpenAI API to generate answer
  6. Stream answer back to user

Requirements

Get OpenAI API key here.

Running Locally

  1. Clone repo
git clone https://github.com/mckaywrigley/clarity-ai.git
  1. Install dependencies
npm i
  1. Run app
npm run dev

Improvement Ideas

Here are some ideas for how to improve Clarity:

  • Speed up answers by replacing link scraping with the Google Search API (scraping was used to circumvent cost + rate limits)
  • Add "follow up" searches
  • Improve the prompt
  • Get sources working in non text-davinci-003 models
  • Train your own model to use for answer synthesis

Credits

Shoutout to Perplexity AI for the inspiration. I highly recommend checking their product out.

This repo is meant to show people that you can build powerful apps like Perplexity even if you don't have a large, experienced team.

LLMs are amazing, and I hope Clarity inspires you to build something cool!

More Repositories

1

chatbot-ui

AI chat for every model.
TypeScript
27,035
star
2

ai-code-translator

Use AI to translate code from one language to another.
TypeScript
3,829
star
3

paul-graham-gpt

AI search & chat for all of Paul Graham’s essays.
TypeScript
2,622
star
4

chatbot-ui-lite

A simple chatbot starter kit for OpenAI's chat model using Next.js, TypeScript, and Tailwind CSS.
TypeScript
918
star
5

prompts

My favorite AI prompts.
832
star
6

ai-brainstore

A proof-of-concept of a brain for an AI agent.
TypeScript
681
star
7

repo-chat

Use AI to ask questions about any GitHub repo.
Python
596
star
8

wait-but-why-gpt

AI search & chat for all Wait But Why posts.
TypeScript
343
star
9

kindle-gpt

AI search & chat on your Kindle highlights.
TypeScript
254
star
10

naval-gpt

AI search & chat for Naval Ravikant's Twitter thread "How To Get Rich."
TypeScript
163
star
11

nba-cba-ai-chat

Use AI to ask questions about the new 676-page NBA CBA.
TypeScript
122
star
12

storybook-ai

Use AI to write complete stories.
TypeScript
113
star
13

the-network-state-gpt

AI search & chat for Balaji Srinivasan's "The Network State."
TypeScript
66
star
14

takeoff-school-your-1st-ai-app

Learn to code your 1st AI app in 21 lines of Python in ~30min!
Python
58
star
15

mckaywrigley

Config files for my GitHub profile.
29
star
16

web-app-starter

TypeScript
23
star
17

generative-ui-experiments

16
star
18

takeoff-openai-assistants

Join Takeoff for full tutorial.
14
star
19

takeoff-vercel-ai-sdk

TypeScript
6
star
20

typescript-starter

TypeScript
5
star
21

buildware

TypeScript
3
star
22

takeoff-todo-app

Source code for the Todo App from Section 2 of "Building Full-Stack Apps with AI" on Takeoff.
TypeScript
2
star
23

takeoff-openai-api

TypeScript
2
star
24

takeoff-google-gen-ai-api

TypeScript
2
star
25

takeoff-openrouter-api

2
star
26

takeoff-mistral-api

TypeScript
2
star
27

takeoff-groq-api

TypeScript
2
star
28

takeoff-perplexity-api

TypeScript
2
star
29

takeoff-notes-app-starter

TypeScript
1
star
30

takeoff-anthropic-api

1
star