Skip to content

evanmschultz/postulate_chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Postulate Chat

An AI chatbot using Langchain, ChromaDB, and OpenAI

Demo GIF or Video

Table of Contents

Overview

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.

Features

  • 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.

Tech Stack

  • Flask
  • SQLAlchemy
  • MySQL
  • Websockets
  • Prism.js

Installation

  1. Clone the repository and navigate to the project directory.

    git clone https://github.com/evanmschultz/postulate_chat.git
    cd postulate-chat
  2. Navigate to the project directory.

  3. Install virtual environment using Pipenv:

    pipenv install
    
  4. 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, and host with your MySQL username, password, and host location, respectively.
    • Defaults to root, rootroot, and localhost.
  5. Export your OpenAI Api key in the terminal as follows:

    export OPENAI_API_KEY=your_openai_api_key
    • Replace your_openai_api_key with your OpenAI API key.
  6. Activate the virtual environment:

    pipenv shell
    
  7. Run the Flask app:

    python3 server.py
    

Usage

  1. Register for an account.
  2. Log in to access the chat functionality.
  3. Go to the settings to ingest documents into ChromaDB.

To-Do

  • 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'.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published