The Jane Austen Literary Assistant is an LLM-powered chatbot that uses RAG (Retrieval Augmented Generation) to answer questions about Jane Austen's works. The system processes and understands the complete works of Jane Austen, providing detailed responses to user queries about plots, characters, themes, and literary analysis.
Live App: Jane Austen Literary Assistant
- Interactive question-answering interface
- Pre-loaded demo questions for quick exploration
- Comprehensive coverage of Jane Austen's major works: Pride and Prejudice (1813), Sense and Sensibility (1811), Emma (1815), Mansfield Park (1814), Persuasion (1817), Northanger Abbey (1817), Lady Susan (1871), Love and Friendship.
- Backend: Python, Flask
- Frontend: HTML, CSS, Bootstrap
- AI/ML: LangChain, OpenAI GPT
- Vector Database: Chroma
- Document Processing: LangChain Text Splitters
- Containerization: Docker
- Deployment: Render
JaneAustenChatBot/
├── LICENSE
├── README.md
├── data/
│ ├── processed/ # Processed text chunks
│ ├── vector_db/ # Vector embeddings database
│ └── raw/ # Original text files
├── src/
│ ├── __init__.py
│ ├── base.py # Utility functions
│ ├── data_ingestion.py # Text processing
│ └── data_preprocessing.py # Vector database creation
├── templates/
│ └── index.html # Web interface
├── requirements.txt
├── Dockerfile
└── app.py # Main Flask application
git clone https://github.com/aphdinh/JaneAustenChatBot.git
cd JaneAustenChatBot
pyenv virtualenv 3.11.0 janeaustenchatbot
pyenv activate janeaustenchatbot
pip install -r requirements.txt
Create a .env
file in the root directory with your personal API keys or other secrets:
OPENAI_API_KEY=your_api_key_here
LANGCHAIN_API_KEY=your_api_key_here
LANGCHAIN_TRACING_V2=true
python src/data_ingestion.py
python src/data_preprocessing.py
python app.py
Docker ensures that the chatbot runs in a consistent environment across different machines. The following two steps can be used with the Dockerfile to build the container and image for local testing!
- Build the Docker image:
docker build -t janeaustenchatbot .
- Run the container:
docker run -p 5000:5000 janeaustenchatbot
- Create a new web service on Render:
- Select the GitHub repository.
- Choose a runtime (
Python 3.11.0
). - Add the necessary environment variables (
OPENAI_API_KEY
, etc.).
- Set up a start command:
python app.py
- Deploy and access the app!
We thank Project Gutenberg for providing access to Jane Austen’s literary works. This project is powered by OpenAI’s GPT models, enabling nuanced and context-aware responses. The frontend design draws inspiration from Regency-era aesthetics, reflecting the historical charm of Austen’s time.