Skip to content

FawazFarid/bookbot

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published