Coder Social home page Coder Social logo

sharonmordechai / ai-assistant-with-vector-store Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 3.0 520 KB

The AI Assistant uses OpenAI's GPT models and Langchain for agent management and memory handling. With a Streamlit interface, it offers interactive responses and supports efficient document search with FAISS. Users can upload and search pdf, docx, and txt files, making it a versatile tool for answering questions and retrieving content.

Python 100.00%
artificial-intelligence data-science faiss langchain llms machine-learning open-ai streamlit vector-store

ai-assistant-with-vector-store's Introduction

AI Assistant

The Streamlit app for the AI Assistant can be found here. You're welcome to give it a try!

ai-assistant-demo.gif

Overview

The AI Assistant is an intelligent conversational tool leveraging the power of OpenAI's GPT models to provide insightful and interactive responses. Built with Langchain for advanced agent management, memory handling, and tool creation, the assistant offers a seamless user experience through a Streamlit-based interface.

Additionally, it incorporates FAISS for efficient document search capabilities, allowing users to upload and search through PDF, DOCX, and TXT files. This versatile assistant is designed to assist users with answering questions, providing information, and retrieving relevant content from uploaded documents.

This tool is built on a combination of cutting-edge technologies:

  • OpenAI: For conversational AI capabilities.
  • Langchain: For managing agents, memories, and tools for the AI assistant.
  • Streamlit: For the interactive user interface.
  • FAISS: For creating a vector store to support document search capabilities.

Features

  • Interactive chat interface with the AI Assistant.
  • Choose between OpenAI's GPT-4 and GPT-3.5-turbo models.
  • Upload and search through PDF, DOCX, and TXT documents.
  • Clear chat history and update document storage.

Installation Guide

Before installing the project, ensure you have the following installed:

  • Python (version 3.8 or higher)
  • pip (Python package installer)

macOS

# Install Python 3.x using Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew update
brew install python

# pip is already installed with Python 3.x on macOS.

Linux (Ubuntu/Debian)

# Install Python 3.x:
sudo apt update
sudo apt install python3

# Install pip (Python Package Installer):
sudo apt update
sudo apt install python3-pip

Windows

Install Python 3.x using Windows Installer:

  • Download the latest Python 3.x installer from Python official website.
  • Run the installer and select "Add Python to PATH" during installation.
  • Click "Install Now" to install Python 3.x.
  • The pip package is included by default with the Python installer for Windows.

How to Run the Application

To run the application, follow the steps below:

  1. Install Required Packages:

    # Install packages
    python -m pip install -r requirements.txt

    This command will install all the necessary dependencies listed in the requirements.txt file.

  2. Run the Application:

       # Run application
       streamlit run main.py

    This command will start the application and execute the main.py script, allowing you to interact with the application.

  3. Setting-up and Using the Pre-Commit Linters (Optional):

    # Installing dev package
    python -m pip install -r dev-requirements.txt
    
    # Installing pre-commit hooks (after this, linters will run before commits)
    pre-commit install
    
    # Running pre-commit hooks manually on all files
    pre-commit run --all-files

How to Use the AI Assistant

  • OpenAI API Key:

    • Enter your OpenAI API key in the sidebar to access the assistant. Choose OpenAI model:
  • Select the desired model from the dropdown list:

    • GPT-4 or GPT-3.5-turbo.
  • Temperature:

    • Adjust the temperature slider for the assistant's response generation.
  • Clear Chat History:

    • Click the "Clear History" button to clear the chat history.
  • Upload a File:

    • Use the file uploader to support vector store capabilities based on uploaded files. Supported formats include PDF, DOCX, and TXT.

About

This AI assistant is based on OpenAI and is designed to answer questions based on its training knowledge. Additionally, it features a document upload capability using a vector store.

Please note that this is a beta tool, and any feedback is appreciated to enhance its performance.

Author

  • Sharon Mordechai.

ai-assistant-with-vector-store's People

Contributors

eyalfrish avatar sharonmordechai avatar

Stargazers

 avatar  avatar

Watchers

 avatar Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.