ProustGPT is a conversational web application inspired by Marcel Proust and powered by a LLM. It currently supports modes:
- Explore Lost Time: Retrieve relevant passages from In Search of Lost Time using Retrieval-Augmented Generation (RAG).
- Reflect on My Day: Engage in thoughtful and introspective conversation to reflect on daily experiences.
- Enter a query to explore related passages from Proust's novel, In Search of Lost Time.
- Passages are retrieved based on semantic similarity using Sentence Transformers and vector search.
- Engage in introspective conversation with prompts designed to help you reflect on your daily experiences.
- React
- Styled Components
- React Router
- Flask
- llama_cpp (for the LLaMA model)
- Sentence Transformers (for semantic embedding and retrieval)
- Node.js (version 16+ recommended)
- Python 3.x (recommended 3.8+)
- virtualenv (for managing Python virtual environments)
- A compatible LLaMA model installed locally (e.g.,
Meta-Llama-3-8B-Instruct-Q4_K_M.gguf
)
git clone https://github.com/realtobyfu/proust-gpt.git
cd proust-gpt
Navigate to the backend directory:
cd backend
python3 -m venv venv
source venv/bin/activate
Once activated, your terminal prompt will include (venv)
.
Run the following command to install backend dependencies:
pip install -r requirements.txt
Ensure that the LLaMA model is placed at the correct location as specified in server.py
:
model_path = "/path/to/your/llama/model/Meta-Llama-3-8B-Instruct-Q4_K_M.gguf"
In your activated environment, run:
flask run
The backend will start running at http://127.0.0.1:5000
.
Open a new terminal and navigate to the frontend directory:
cd frontend
npm install
npm start
The frontend will start running at http://localhost:3000
.
With both frontend and backend running, open your browser at http://localhost:3000
.
Choose between:
- Explore Lost Time: Enter queries to explore Marcel Proust's text.
- Reflect on My Day: Converse with ProustGPT for reflective guidance.
-
/api/explore_lost_time
(POST)- Retrieves passages from In Search of Lost Time relevant to your query.
-
/api/reflect
(POST)- Provides reflective responses to your messages without retrieval from external sources.
├── backend
│ ├── app.py # Main Flask application
│ ├── parsed.json # Parsed text data
│ ├── requirements.txt # Python dependencies
├── frontend
│ ├── public
│ ├── src
│ │ ├── components
│ │ │ ├── ChatPage.tsx # Main chat page
│ │ └── App.tsx # React app entry point
│ ├── assets
│ ├── package.json # Frontend dependencies
│ └── tsconfig.json # TypeScript configuration
└── README.md # Project documentation
- Complete the 'Combray' gallery page
- Add conversation history support
- Add a French-language interface
- Improve semantic retrieval for better context in Explore Lost Time.
- Fine-tune the reflective prompts for a deeper and richer conversational experience.
- Expand corpus with additional relevant documents.
This project is licensed under the Apache 2.0 License.
- Meta (LLaMA): For providing the large language model.
- Sentence Transformers: For the powerful embeddings.
- The open-source community for helpful libraries and inspiration.
Enjoy your thoughtful conversations with ProustGPT! 🌸📖✨