Skip to content

About

Enterprise AI data assistant with RAG, role-based access control, dynamic UI chat (Groq/LangChain), and multi-modal data support

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Covalence AI β€” Enterprise Data Assistant

Secure, AI-powered access to enterprise data through intelligent chat, role-based access control, and Retrieval-Augmented Generation.

License: MIT React Next.js FastAPI LangChain Groq

Revolutionizing secure and efficient access to enterprise data through AI-powered interactions.


πŸ“– Overview

Enterprises struggle to give employees secure, efficient access to corporate data. Traditional systems lack scalability, real-time querying, and reliably enforced role-based permissions β€” leaving fragmented access points and complex interfaces that hurt productivity and raise security risks.

Covalence AI solves this by combining advanced machine learning, role-based access control (RBAC), and dynamic AI chat interfaces. Employees interact with corporate data through natural language; every request is filtered through an ML-based access-control decision engine before retrieval, and responses are grounded with Retrieval-Augmented Generation (RAG) for accuracy.

Built by team India AI with Groq-powered RAG and dynamic UI generation.


✨ Features

πŸ€– AI-Powered Data Access

  • Natural-language queries over enterprise data with accurate, context-aware answers
  • RAG architecture (LangChain + Chroma vector store) for grounded, source-aware responses

πŸ›‘οΈ Intelligent Access Control

  • ML-based decision engine (Random Forest classifier) analyzes every access request against user role, department, data sensitivity, and request intent
  • Role-based permissions enforced across admin and employee experiences

πŸ“„ Multi-Modal Data Support

  • Process and extract insights from PDFs, CSVs, images, YouTube videos, and audio (Whisper transcription)
  • Unified embeddings pipeline indexes heterogeneous sources into a vector database

🧩 Dynamic UI Generation

  • Chat interface that renders context-aware UI components (charts, tables, forms) based on query intent
  • Powered by the Vercel AI SDK with Groq / OpenAI / xAI model support

πŸ“Š Admin Console

  • Real-time analytics: system usage, access patterns, and flagged requests
  • User & permission management, data upload controls, and settings

πŸ‘” Employee Workspace

  • Chat assistant, document browsing, data uploads, access requests, and AI action suggestions

🧱 Tech Stack

Layer Technologies
Frontend (Dashboard) React 18, TypeScript, Vite, TailwindCSS, Chart.js, Recharts, Framer Motion
Chat (Dynamic UI) Next.js 14, Vercel AI SDK, Groq, OpenAI, xAI, React Markdown
ML Backend Flask, FastAPI, PyTorch, TensorFlow, scikit-learn (Random Forest), transformers
RAG Pipeline LangChain, LangChain-Groq, Chroma DB, OpenAI embeddings, Hugging Face
Data & Media pandas, numpy, PyPDF, moviepy, faster-whisper, youtube-transcript-api
Storage Chroma vector database, Vercel KV
HTTP Client Axios

πŸ“‚ Project Structure

CovalenceAI-main/
β”œβ”€β”€ frontend/                    # React + TypeScript admin/employee dashboard (Vite)
β”‚   └── src/
β”‚       β”œβ”€β”€ pages/               # Admin & employee pages (Dashboard, Analytics, Chat…)
β”‚       β”œβ”€β”€ layouts/             # Admin & employee layouts
β”‚       β”œβ”€β”€ contexts/            # Auth & theme context providers
β”‚       β”œβ”€β”€ services/            # API client
β”‚       └── routes/              # Protected route guards
β”œβ”€β”€ chat-dynamic/                # Next.js AI chat with dynamic UI generation
β”‚   β”œβ”€β”€ app/                     # Next.js app router
β”‚   β”œβ”€β”€ components/              # Chat & UI components
β”‚   β”œβ”€β”€ public/                  # Static assets
β”‚   └── .env.example             # API key template
β”œβ”€β”€ ml/                          # ML & RAG services (Flask)
β”‚   β”œβ”€β”€ app.py                   # Flask API: access control + RAG queries
β”‚   β”œβ”€β”€ all_embeddings_of_files.py   # Embeddings pipeline & query answering
β”‚   β”œβ”€β”€ decision_logic_access_control.py  # ML access decision logic
β”‚   β”œβ”€β”€ pdf_rag.py / rag_for_csv.py / rag_for_video.py  # Per-format RAG
β”‚   β”œβ”€β”€ faster-transcription.ipynb    # Whisper transcription notebook
β”‚   └── requirements.txt
└── convulance-mohit/            # FastAPI query classifier + corporate grounding
    β”œβ”€β”€ app.py                   # FastAPI server (query classification API)
    β”œβ”€β”€ main_model.py            # Core classification & query processing
    β”œβ”€β”€ access_control_model.py  # Access control model logic
    β”œβ”€β”€ corporate_grounding.py   # Corporate data grounding
    └── requirements.txt

πŸš€ Getting Started

Prerequisites

  • Node.js v16+ (v20+ recommended)
  • Python 3.8+
  • npm or yarn
  • API keys: Groq and OpenAI (for LLM + embeddings)

1️⃣ Clone the Repository

git clone https://github.com/comrade-era/CovalenceAI-main.git
cd CovalenceAI-main

2️⃣ Configure Environment Variables

Copy the template and add your keys:

cp chat-dynamic/.env.example chat-dynamic/.env.local

Set the following (see .env.example at the repo root for all options):

Variable Description
GROQ_API_KEY Groq API key (LLM inference for RAG & chat)
OPENAI_API_KEY OpenAI API key (embeddings)
VITE_GOOGLE_API_KEY Google API key (frontend, optional)

3️⃣ Run the ML Backend

cd ml
pip install -r requirements.txt

# Generate the ML model artifacts (.pkl) the API loads at startup.
# The trained Random Forest + label encoders are git-ignored, so a fresh
# clone must regenerate them before the server will start:
python final_classification_model_training.py

python app.py

4️⃣ Run the Chat Application

cd ../chat-dynamic
npm install
npm run dev
# This starts Next.js AND the ML server (see dev:all script)

5️⃣ Run the Admin Dashboard

cd ../frontend
npm install
npm run dev

6️⃣ Run Everything Together

cd chat-dynamic
npm run dev:all

πŸ”Œ API Overview

ML Backend (Flask β€” ml/app.py)

  • POST /chat β€” RAG-grounded chat answering with access control
  • Access requests evaluated by the Random Forest classifier + label encoders

Query Classifier (FastAPI β€” convulance-mohit/app.py)

  • POST /classify β€” determines if a query is appropriate for the employee dataset
  • POST /query β€” processes a user query with corporate grounding
  • Auto-generated docs at / (Swagger) and /redoc

πŸ§ͺ Testing

# Frontend lint & build
cd frontend && npm run lint && npm run build

# Chat build
cd chat-dynamic && npm run build

# ML server (sanity check)
cd ml && python -c "import app"

🧬 Future Scope

  • πŸ“ˆ Enhanced ML models for more accurate access-control predictions
  • πŸ” Advanced security features, including biometric authentication
  • 🌐 Multi-language support for global enterprises
  • πŸ”„ Integration with additional enterprise systems and data sources
  • πŸ“± Mobile application for on-the-go data access

πŸ‘€ Author

Dev Pandey β€” @comrade-era


πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.

About

Enterprise AI data assistant with RAG, role-based access control, dynamic UI chat (Groq/LangChain), and multi-modal data support

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages