Git Product home page Git Product logo

bookbot's Introduction

BookBot - AI Book Content Accessibility Experiment

Welcome to BookBot! This application is an experiment in using AI to make book content more accessible by answering real-time questions from readers. This README will guide you through setting up the application locally on your machine.

Prerequisites

Before you begin, make sure you have the following:

  1. Ruby (version 3.1.3)
  2. Rails 7
  3. Node.js
  4. Yarn
  5. An OpenAI API key

Getting Started

  1. Clone this repository to your local machine:

    git clone https://github.com/FawazFarid/bookbot.git
    cd bookbot
  2. Install Ruby gems:

    bundle install
  3. Create and migrate the database:

    rails db:create
    rails db:migrate
  4. Set up your environment variables: Rename the .env.example file to .env:

    cp .env.example .env

    Replace `OPENAI_API_KEY`` with your actual OpenAI API key in the .env file.

  5. Download and place your book PDF in the root folder of the project as book.pdf. Generate and format embeddings for the book using the following command:

    rake manuscript:format
  6. Start the Server:

    bin/dev
  7. Visit http://localhost:3000 to view the application.

Usage

  1. Ask a Question:
  • Enter your question in the text box on the homepage.
  • Click the "Ask Question" button to get a real-time answer based on the book content.
  1. "I'm Feeling Lucky":
  • Click the "I'm Feeling Lucky" button to get a random question from predefined options.
  1. Experiment and Explore:
  • Feel free to experiment with different questions and explore the AI's responses.

Using this Application with your Own Book

This project was designed for the book "The Minimalist Entrepreneur" by Sahil Lavingia. However, you can use this application with your own book by following these steps:

  • Replace the book.pdf file in the root folder of the project with your own book PDF.

  • Generate and format embeddings for the book using the following command:

    rake manuscript:format
  • Change the book title and author, links e.t.c inside the codebase. Some good places to look at include app/javascript/components/ folder and app/services/answer_with_context_service.rb file.

Contributing

Contributions are welcome! If you find any issues or want to enhance the application, please fork this repository, make your changes, and submit a pull request.

bookbot's People

Contributors

fawazfarid avatar

Watchers

 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.