Skip to content

Latest commit

 

History

History
46 lines (24 loc) · 1.35 KB

README.md

File metadata and controls

46 lines (24 loc) · 1.35 KB

Hao Chen's Tweets GPT

AI-powered search and chat for Hao Chen's Twitter.

All code & data used is 100% open-source.

Online

How It Works

Hao Chen's Tweets GPT provides 2 things:

  1. A search interface.
  2. A chat interface.

Search

Search was created with OpenAI Embeddings (text-embedding-ada-002).

First, we loop over the tweets and generate embeddings for each chunk of text.

Then in the app we take the user's search query, generate an embedding, and use the result to find the most similar passages from the book.

The comparison is done using cosine similarity across our database of vectors.

Our database is a Postgres database with the pgvector extension hosted on Supabase.

Results are ranked by similarity score and returned to the user.

Chat

Chat builds on top of search. It uses search results to create a prompt that is fed into GPT-3.5-turbo.

This allows for a chat-like experience where the user can ask questions about the book and get answers.

Notes

卓越之识论道(Great minds discuss ideas)

平常之识论事(Average minds discuss events)

狹隘之识论人(Small minds discuss people)

——CoolShell.cn 陈皓

R.I.P