Skip to content

If you want to see how rag works this repository is made for you.

License

Notifications You must be signed in to change notification settings

kmanu225/rag-pki-expert-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔐 PKI Expert System with RAG

🎯 Goals

Develop an expert system for Public Key Infrastructure (PKI) using a text-based knowledge base and Retrieval-Augmented Generation (RAG) to provide accurate, context-aware responses.


✨ Features

  • 🔍 Retrieval-Augmented Generation (RAG) Leverages vector search via ChromaDB and text generation using open models from Hugging Face or OpenRouter.

  • 📚 Automated Knowledge Processing Automatically chunks and indexes documents from the knowledge/ folder for efficient and fast retrieval.

  • 💬 Interactive Dialog Interface Supports both command-line and Gradio-based user interfaces for interactive expert consultation.

  • 🧩 Modular Architecture Components like the LLM, vector store, and prompt logic are modular and easily replaceable.


🗂️ Project Structure

.
├── Dockerfile                     # Docker container setup
├── LICENSE                        # License file
├── README.md                      # Project documentation
├── db/
│   ├── chroma_db/                 # ChromaDB local vector database files
│   ├── docker-compose.yml         # Docker configuration for ChromaDB
│   └── otel-collector-config.yaml # OpenTelemetry collector config (if used for observability)
├── docs/
│   └── architecture.png           # System architecture diagram
├── requirements.txt               # Python dependencies
├── src/
│   ├── __pycache__/               # Python cache files (can be ignored)
│   ├── app.py                     # Main application entry point
│   ├── embedding_storage.py       # Embedding storage & retrieval logic
│   ├── media_to_text.py           # (Optional) Convert media (audio/video) to text for indexing
│   ├── rag.py                     # Core RAG implementation
│   └── knowledge/                 # Directory for source documents (.txt, .pdf, etc.)
└── test/
    ├── demo.ipynb                 # Jupyter notebook for testing & exploration
    └── uploads/                   # Folder for uploaded files (used in demos/tests)


🧱 System Architecture

System Architecture


⚙️ Prerequisites


🚀 Getting Started

1. Update Your System

sudo apt update

2. Build and Run the Docker Vector Database

cd db
docker-compose up --build
cd ..

3. Set Environment Variables

export OPENROUTER_API_KEY=your_openrouter_api_key
export HF_TOKEN=your_huggingface_token

4. Create and Activate a Virtual Environment

python3 -m venv .venv
source .venv/bin/activate

5. Install Dependencies

pip install -r requirements.txt

6. Run the app

python3 src/app.py

About

If you want to see how rag works this repository is made for you.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published