Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mckaywrigley/kindle-gpt
AI search & chat on your Kindle highlights.
https://github.com/mckaywrigley/kindle-gpt
Last synced: 3 months ago
JSON representation
AI search & chat on your Kindle highlights.
- Host: GitHub
- URL: https://github.com/mckaywrigley/kindle-gpt
- Owner: mckaywrigley
- License: mit
- Created: 2023-03-08T22:17:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-03-10T21:34:46.000Z (over 1 year ago)
- Last Synced: 2024-01-22T10:08:09.329Z (5 months ago)
- Language: TypeScript
- Homepage: https://kindle-gpt.vercel.app
- Size: 123 KB
- Stars: 244
- Watchers: 6
- Forks: 24
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license
Lists
- awesome-chatgpt - kindle-gpt - Search and chat on your Kindle highlights. (Web apps / Hosted and self-hosted)
- awesome-ChatGPT-repositories - kindle-gpt - AI search & chat on your Kindle highlights. (Others)
- awesome-chatgpt - kindle-gpt - Search and chat on your Kindle highlights. (Web apps / Hosted and self-hosted)
- my-awesome - mckaywrigley/kindle-gpt - 03 star:0.3k fork:0.0k AI search & chat on your Kindle highlights. (TypeScript)
- my-awesome-stars - mckaywrigley/kindle-gpt - AI search & chat on your Kindle highlights. (TypeScript)
README
# Kindle GPT
AI search & chat on your Kindle highlights.
Supports .csv exporting of your embedded data.
Code is 100% open source.
Note: I recommend using on desktop only.
## How It Works
### Export Kindle Notebook
In the Kindle App you can export your highlights as a notebook.
The notebook provides you with a .html file of your highlights.
### Import & Parse Kindle Highlights
Import the .html file into the app.
It will parse the highlights and display them.
### Generate Embeddings
After parsing is complete, the highlights are ready to be embedded.
Kindle GPT uses [OpenAI Embeddings](https://platform.openai.com/docs/guides/embeddings) (`text-embedding-ada-002`) to generate embeddings for each highlight.
The embedded text is the chapter/section name + the highlighted text. I found this to be the best way to get the most relevant passages.
You will also receive a downloaded .csv file of your embedded notebook to use wherever you'd like - including for importing to Kindle GPT for later use.
### Search Embedded Highlights
Now you can query your highlights using the search bar.
The 1st step is to get the cosine similarity for your query and all of the highlights.
Then, the most relevant results are returned (maxing out at ~2k tokens, up to 10).
### Create Prompt & Generate Answer
The results are used to create a prompt that feeds into GPT-3.5-turbo.
And finally, you get your answer!
## Data
All data is stored locally.
Kindle GPT doesn't use a database.
You can re-import any of your generated .csv files at any time to avoid having to re-embed your notebooks.
## Running Locally
1. Set up OpenAI
You'll need an OpenAI API key to generate embeddings and perform chat completions.
2. Clone repo
```bash
git clone https://github.com/mckaywrigley/kindle-gpt.git
```3. Install dependencies
```bash
npm i
```4. Run app
```bash
npm run dev
```## Contact
If you have any questions, feel free to reach out to me on [Twitter](https://twitter.com/mckaywrigley)!