Coder Social home page Coder Social logo

tmaaefu192 / kindle-gpt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mckaywrigley/kindle-gpt

0.0 0.0 0.0 126 KB

AI search & chat on your Kindle highlights.

Home Page: https://kindle-gpt.vercel.app

License: MIT License

JavaScript 1.20% TypeScript 98.20% CSS 0.60%

kindle-gpt's Introduction

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 (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.

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

Contact

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

kindle-gpt's People

Contributors

mckaywrigley 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.