A tool for extracting character interaction graphs from novels.
This pipeline processes novels in chunks using OpenAI models to generate:
- Character relationships – Identifies and maps all connections between characters.
- Character descriptions – Provides summaries of each character.
- Interaction details – Explains character interactions in depth.
-
Create and activate a virtual environment:
uv venv source .venv/bin/activate uv lock uv sync
-
Set your OpenAI API key:
export OPENAI_KEY='<your_api_key>'
-
Make the script executable:
chmod +x generate.sh
-
Generate the character graph for a novel:
./generate.sh karamazov # Or use: solitude, master-and-margarita, war-and-peace
Would you like to see a specific book visualized in the graph? Open an issue so I can pick it up or get your hands dirty and open a PR.