This project generates a dependency tree of intellectual influences for a given book, tracing the lineage of cited works and bibliographies recursively. It uses OpenAI's GPT-4 API to analyze and build a directory-style hierarchy of sources that influenced the selected book.
- Enter a book title and author to generate a dependency graph.
- Visualizes the intellectual lineage in a directory-style tree.
- Web interface for easy use.
- The backend (Flask) receives a book title and author, then queries the OpenAI API to generate a dependency tree.
- The frontend (HTML/JS) allows users to input book details and view the generated tree.
-
Clone the repository:
git clone https://github.com/moonwalkwoods/book-dependency-tree.git cd dependency-nest
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
- Create a
.env
file in the root directory with your OpenAI API key:OPENAI_API_KEY=your_openai_api_key_here
- Create a
-
Run the server:
python app.py
The server will start on
http://localhost:8002
. -
Open the web interface:
- Open
index.html
in your browser, or navigate tohttp://localhost:8002
if served directly.
- Open
- Enter the book title and author in the input fields.
- Click Generate Graph.
- View the generated dependency tree in the output area.
- Python 3.8+
- Flask
- Flask-CORS
- openai
- dotenv
GNU GENERAL PUBLIC LICENSE