Postulate Chat is an AI chatbot application built using Flask. It employs Langchain for conversational logic, ChromaDB for document storage, and OpenAI for natural language processing. The application comes with login and registration features, protecting the chat routes. It's designed to evolve, with several additional features planned for future releases.
- SQLAlchemy ORM: Automatically creates a MySQL database if it doesn't already exist.
- Websockets: Installed but not currently in use. The plan is to implement real-time AI responses.
- Code Formatting: Auto-formats and styles code blocks using Prism.js.
- ChromaDB Vector Store: Currently global; future updates will support user-specific documents.
- Document Ingestion: Currently supports URLs. Future updates will include PDF, CSV, and other formats.
- Login & Registration: Built-in authentication and route protection.
- ConversationalRetrievalChain with Langchain: Provides the AI chat functionality.
- Flask
- SQLAlchemy
- MySQL
- Websockets
- Prism.js
-
Clone the repository and navigate to the project directory.
git clone https://github.com/evanmschultz/postulate_chat.git cd postulate-chat -
Navigate to the project directory.
-
Install virtual environment using Pipenv:
pipenv install -
Export your MySQL environment variables before running the application. You can set them in the terminal as follows:
export DB_USER=your_mysql_username export DB_PASSWORD=your_mysql_password export DB_HOST=localhost export OPENAI_API_KEY=your_openai_api_key
- Replace
your_mysql_username,your_mysql_password, andhostwith your MySQL username, password, and host location, respectively. - Defaults to
root,rootroot, andlocalhost.
- Replace
-
Export your OpenAI Api key in the terminal as follows:
export OPENAI_API_KEY=your_openai_api_key- Replace
your_openai_api_keywith your OpenAI API key.
- Replace
-
Activate the virtual environment:
pipenv shell -
Run the Flask app:
python3 server.py
- Register for an account.
- Log in to access the chat functionality.
- Go to the settings to ingest documents into ChromaDB.
- Implement Websockets for real-time AI responses.
- Make ChromaDB Vector Store user-specific.
- Add support for PDF, CSV, and other document formats.
- Implement verbosity in ConversationalRetrievalChain.
- Transition all routes to JSON for API-like functionality.
- Modularize chat functionality into 'services'.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
MIT License