CoolFace
Apppublic

Domino675/Knowledge_AI_Base

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes
App README

AI Knowledge Base Assistant

This is a Gradio app that serves as an AI knowledge base assistant, focusing on PyTorch and LLMs. It uses Retrieval Augmented Generation (RAG) to provide accurate answers by referencing a knowledge base of documents.

Overview

This application:

  1. 1.Loads documents from the knowledge base
  2. 2.Splits them into smaller chunks
  3. 3.Creates vector embeddings for each chunk
  4. 4.Stores these in a Chroma vector database
  5. 5.Retrieves relevant documents when questions are asked
  6. 6.Uses an LLM to generate answers based on the retrieved documents

Technologies Used

  • LangChain for document processing and RAG implementation
  • Chroma for vector database storage
  • HuggingFace Embeddings for creating embeddings
  • OpenAI GPT-4o-mini for generating responses
  • Gradio for the user interface

Setup

  1. 1.Clone this repository
  2. 2.Install the required packages with pip install -r requirements.txt
  3. 3.Create a .env file with your OpenAI API key: OPENAIAPIKEY=your-api-key-here
  4. 4.Run the app with python app.py

Usage

  1. 1.Ask questions about PyTorch, LLMs, or general AI concepts in the textbox
  2. 2.View the assistant's responses in the chat interface
  3. 3.Click "Reset Conversation" to start a new conversation
  4. 4.Click "Show Vector Embeddings" to visualize the knowledge base in 2D space

Knowledge Base Structure

The knowledge base is organized into folders:

  • pytorch/: Information about PyTorch framework
  • llm/: Information about Large Language Models

Adding to the Knowledge Base

To add more documents:

  1. 1.Create Markdown (.md) files with relevant information
  2. 2.Place them in the appropriate folder under knowledge-base/
  3. 3.Restart the application to reindex the knowledge base