Skip to content

Latest commit

 

History

25 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 KnowledgeFlow AI

KnowledgeFlow AI is a Retrieval-Augmented Generation (RAG) application built from scratch in Python without using high-level frameworks such as LangChain or LlamaIndex. It enables users to upload documents, build a FAISS-based knowledge base, and ask questions using Google Gemini with source citations through a Streamlit web interface.

Live Preview

The website is live and accessible below

Click Here

Features

  • User registration and authentication
  • Secure password hashing with bcrypt
  • Cloud-based user management using Supabase PostgreSQL
  • Multi-format document support (PDF, DOCX, TXT, MD)
  • Sentence-based text chunking
  • Google Gemini Embeddings
  • FAISS vector database
  • Retrieval-Augmented Generation (RAG)
  • AI-powered question answering
  • Source citations
  • Streamlit web interface

Tech Stack

  • Python
  • Streamlit
  • Google Gemini API
  • FAISS
  • Supabase PostgreSQL
  • bcrypt
  • NumPy
  • PyPDF
  • python-docx

Prerequisites

Before running the project, ensure you have:

  • Python 3.11 or later
  • Git
  • Google Gemini API Key
  • Supabase Project

Installation

Clone the repository

git clone https://github.com/vickyy234/KnowledgeFlow_AI.git

cd KnowledgeFlow_AI

Create a virtual environment

python -m venv venv

Windows

venv\Scripts\activate

Linux / macOS

source venv/bin/activate

Install dependencies

pip install -r requirements.txt

Configure environment variables

Create a .env file in the project root.

GEMINI_API_KEY=your_gemini_api_key

DB_HOST=your_supabase_host
DB_PORT=5432
DB_NAME=postgres
DB_USER=postgres
DB_PASSWORD=your_supabase_password

Database Setup

Create a free Supabase project and execute the following SQL:

CREATE TABLE users (
    id SERIAL PRIMARY KEY,
    username VARCHAR(100) NOT NULL,
    email VARCHAR(255) UNIQUE NOT NULL,
    password_hash TEXT NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Running the Application

Start the application:

streamlit run streamlit_app.py

Open the browser:

http://localhost:8501

Using the Application

  1. Register a new account.
  2. Login.
  3. Upload one or more documents.
  4. Build the Knowledge Base.
  5. Ask questions about the uploaded documents.
  6. View the generated answer and source citations.

Supported Documents

Format Supported
PDF
DOCX
TXT
Markdown

Notes

  • User accounts are stored in Supabase PostgreSQL.
  • Uploaded documents and generated knowledge bases are stored locally.
  • Uploaded files in the live demo are temporary and may be removed when the hosting service restarts.
  • Rebuild the knowledge base after adding or modifying documents.

License

This project is licensed under the MIT License.

See the LICENSE file for details.

About

AI-powered Knowledge Assistant built from scratch using Python and Google Gemini with custom RAG, semantic search, and source citations.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages