ResuWrite is an AI-powered novel generation system that transforms a person's resume into a creative story. Using a series of specialized LLM chains, the system analyzes a resume, creates a character profile, and then generates a complete novel with chapters, plots, and events tailored to that character.
graph TD
subgraph Input
resume[Resume PDF]
subject[Subject]
genre[Genre]
author[Author]
end
subgraph Chains
MC[MainCharacterChain]
TC[TitleChain]
PC[PlotChain]
CC[ChaptersChain]
WC[WriterChain]
end
subgraph Output
profile[Character Profile]
title[Novel Title]
plot[Full Plot]
chapters[Chapters List]
book[Complete Novel]
doc[Word Document]
end
resume --> MC
MC --> profile
profile --> TC
subject --> TC
genre --> TC
author --> TC
TC --> title
profile --> PC
subject --> PC
genre --> PC
author --> PC
title --> PC
PC --> plot
profile --> CC
subject --> CC
genre --> CC
author --> CC
title --> CC
plot --> CC
CC --> chapters
profile --> WC
genre --> WC
author --> WC
title --> WC
plot --> WC
chapters --> WC
WC --> book
book --> doc
chapters --> doc
title --> doc
ResuWrite uses Groq as the LLM provider, leveraging powerful language models like llama-3.3-70b-versatile or mixtral-8x7b-32768 through the LangChain integration.
The system is composed of five specialized LLM chains:
- Purpose: Analyzes a resume and creates a character profile
- Input: PDF resume
- Output: Textual description of the person's profile
- Process: Loads and splits PDF, combines content, and runs through LLM
- Purpose: Generates an appropriate title for the novel
- Input: Subject, genre, author, and character profile
- Output: Novel title
- Process: Considers all inputs to create a genre and author-appropriate title
- Purpose: Creates a complete plot for the novel
- Input: Subject, genre, author, profile, and title
- Output: Detailed plot description
- Process: Uses a helper chain to generate storytelling attributes, then creates a full plot
- Purpose: Generates a structured chapter list
- Input: Subject, genre, author, profile, title, and plot
- Output: Dictionary of chapters and their descriptions
- Process: Creates a prologue, numbered chapters, and an epilogue
- Purpose: Writes the actual content for each chapter event
- Input: Genre, author, title, profile, plot, previous events, chapter summary, and current event
- Output: Paragraphs of story content
- Process: Maintains continuity while generating new content for each event
- PDF Loading: Uses
PyPDFLoaderto extract text from resumes - Word Document Creation: Uses
python-docxto format and save the final novel
- Clone the repository
- Install dependencies:
pip install python-dotenv langchain-groq langchain pypdf2 python-docx
- Create a
.envfile with your Groq API key:GROQ_API_KEY=your_api_key_here
- Place a resume PDF in the
./docsfolder - Edit the
main()function inapp.pyto set your desired:- Subject
- Author name
- Genre
- Resume file name
- Run the application:
python app.py
- The generated novel will be saved as a Word document in the
./docsfolder
.
├── app.py # Main application code
├── .env # Environment variables (API keys)
├── docs/ # Input and output documents
│ ├── Divija_Prof.pdf # Example resume
│ └── Generated_Novel.docx # Output file
├── README.md # This file
└── requirements.txt # Dependencies
- Resume Analysis: The system begins by loading and analyzing a resume PDF
- Character Creation: A profile is generated based on the resume content
- Story Framework: Title, plot, and chapter structure are created
- Content Generation: Each chapter is populated with events and paragraphs
- Document Creation: The final novel is formatted and saved as a Word document
You can customize the system by:
- Modifying the prompt templates in each chain
- Adjusting the LLM parameters (temperature, model)
- Adding additional chains for more complex story elements
- Expanding the event generation for more detailed chapters
- The quality of the generated novel depends on the resume content and LLM capabilities
- Long novels may require multiple API calls and can be time-consuming
- The current implementation uses a simplified approach to event generation
- Implement more sophisticated event planning
- Add character relationship mapping
- Include theme and motif analysis
- Provide style customization options
- Create a web interface for easier use
- langchain-groq
- langchain
- python-dotenv
- PyPDFLoader
- python-docx
This project is licensed under the MIT License.