Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ckabuya/policies-qa-llm

Repository files navigation

Company Policies Q&A using Local LLM

This project leverages Retrieval-Augmented Generation (RAG) to help employees and Heads of Departments (HoDs) quickly understand and comply with company policies. By using a locally deployed Language Model (LLM) through LM Studio and Streamlit for the web interface, users can ask questions and get accurate, contextually relevant answers based on preloaded company policies stored in markdown format.

Features

  • Markdown File Processing: Reads company policies from a specified directory containing markdown files.
  • Chunking and Storage: Splits the documents into manageable chunks and stores them in a vector database (LanceDB).
  • Query Handling: Uses a local LLM to generate responses to policy-related queries.
  • Streamlit Interface: Provides a web interface for users to ask questions and view responses.
  • Policy Training Module: Interactive training module that quizzes users on policy knowledge and provides feedback.

Installation

  1. Clone the repository:

    git clone https://github.com/ckabuya/policies-qa-llm.git
    cd policies-qa-llm
  2. Install the dependencies:

    pip install -r requirements.txt
  3. Download NLTK data:

    import nltk
    nltk.download("punkt")
  4. Set up LM Studio:

    • Download and install LM Studio from the official LM Studio website.
    • Use LM Studio to download the desired LLM model.
    • Enable the server in LM Studio to make the API available locally.

Usage

  1. Prepare the policies directory:

    • Ensure your company policies are stored in markdown format (.md files) in a directory. Update the policy_directory variable in the script with the path to this directory.
  2. Run the Streamlit app:

    streamlit run streamlit_app.py
  3. Interact with the app:

    • Open the provided URL in your browser.
    • Use the sidebar to navigate between the "Policy Q&A" and "Policy Training" sections.
    • Ask questions about the company policies and view the responses generated by the local LLM.
    • Participate in the policy training module to test your knowledge and get feedback.

Project Structure

 policies-qa-llm/
  │
  ├── policies/ # Directory containing markdown files with company policies
  ├── streamlit_app.py # Main application script
  ├── requirements.txt # List of dependencies
  ├── README.md # Project documentation

About

Company Policies Q&A using Local LLM

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages