Skip to content

Latest commit

ย 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– MultiGenAI

An Intelligent Multi-Domain Generative AI Workspace

Status: โœ… Completed & Tested

MultiGenAI is a personalized, general-purpose Generative AI assistant that understands what the user wants automatically and generates context-aware responses.

Instead of forcing users to manually select a domain, MultiGenAI uses an LLM-powered Smart Intent Detection system to understand the user's request and dynamically adapt the response.


๐Ÿš€ Live Demo

Streamlit App



๐Ÿ”— Launch MultiGenAI

---

โœจ Features

  • ๐Ÿง  Smart Intent Detection
  • ๐ŸŽฏ Automatic domain detection
  • ๐Ÿ“Œ Subject detection
  • ๐Ÿ’ก Intent detection
  • ๐Ÿ“ Task detection
  • โšก Urgency detection
  • ๐Ÿค– Qwen LLM powered by Groq
  • ๐Ÿ’ฌ Context-aware conversations
  • ๐Ÿ” User Registration and Login
  • ๐Ÿ”’ Secure password hashing
  • ๐Ÿ‘ค User-specific private chat history
  • ๐Ÿ’พ Persistent SQLite database
  • ๐Ÿ”Ž Chat history search
  • ๐Ÿ†• New Chat management
  • โšก Streaming AI responses
  • ๐Ÿฅ Medical safety-aware responses
  • ๐ŸŒ General-purpose AI capability
  • ๐ŸŽจ Clean dark-themed interface

๐Ÿ–ฅ๏ธ Screenshots

๐Ÿ” Login / Registration

MultiGenAI Login

๐Ÿ’ฌ Main Chat Interface

MultiGenAI Chat

๐Ÿ’ฌ Chat Interface

MultiGenAI Chat Interface

๐Ÿง  Smart Mode

The main feature of MultiGenAI is its Smart Mode.

Users do not need to manually select a domain.

The system automatically analyzes the user's message and identifies:

Domain
Subject
Intent
Task
Urgency

Example

User:

Tomorrow my chemistry exam. Give me 10 MCQs with answers.

MultiGenAI understands:

Domain   โ†’ Education
Subject  โ†’ Chemistry
Intent   โ†’ Exam Preparation
Task     โ†’ Generate MCQs with answers
Urgency  โ†’ High

The detected context is then passed to the Prompt Builder to create a more relevant instruction for the main LLM.


๐Ÿ—๏ธ System Architecture

                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚    User Message   โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ”‚
                              โ–ผ
                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ”‚    Intent Detector    โ”‚
                  โ”‚                       โ”‚
                  โ”‚ โ€ข Domain              โ”‚
                  โ”‚ โ€ข Subject             โ”‚
                  โ”‚ โ€ข Intent              โ”‚
                  โ”‚ โ€ข Task                โ”‚
                  โ”‚ โ€ข Urgency             โ”‚
                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ”‚
                              โ–ผ
                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ”‚    Prompt Builder     โ”‚
                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ”‚
                              โ–ผ
                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ”‚ Conversation Context  โ”‚
                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ”‚
                              โ–ผ
                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ”‚      Qwen + Groq      โ”‚
                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ”‚
                              โ–ผ
                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ”‚    AI Response        โ”‚
                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ” Authentication

MultiGenAI supports real user authentication.

User
 โ”‚
 โ”œโ”€โ”€ Register
 โ”‚      โ”‚
 โ”‚      โ–ผ
 โ”‚   User Account
 โ”‚
 โ””โ”€โ”€ Login
        โ”‚
        โ–ผ
   Authenticated User
        โ”‚
        โ–ผ
      Chat
        โ”‚
        โ–ผ
      user_id
        โ”‚
        โ–ผ
 User-specific Chat History

Each chat is associated with the authenticated user's user_id.

This ensures that one user cannot access another user's conversations through the application's database queries.


๐Ÿ’พ Database

MultiGenAI uses SQLite for persistent storage.

Users Table

users
โ”œโ”€โ”€ id
โ”œโ”€โ”€ name
โ”œโ”€โ”€ email
โ””โ”€โ”€ password_hash

Chats Table

chats
โ”œโ”€โ”€ id
โ”œโ”€โ”€ user_id
โ”œโ”€โ”€ title
โ”œโ”€โ”€ domain
โ””โ”€โ”€ messages

The user_id connects every conversation to its owner.


๐Ÿงฉ Project Structure

MultiGenAI/
โ”‚
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ test_intent.py
โ”‚   โ””โ”€โ”€ test_prompt.py
โ”‚
โ”œโ”€โ”€ screenshots/
โ”œโ”€โ”€ streamlit/
โ”‚
โ”œโ”€โ”€ app.py
โ”œโ”€โ”€ auth.py
โ”œโ”€โ”€ database.py
โ”œโ”€โ”€ intent_detector.py
โ”œโ”€โ”€ prompt_builder.py
โ”‚
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ .gitignore
โ”‚
โ”œโ”€โ”€ .env
โ””โ”€โ”€ multigenai.db

Important

The following files should not be committed to GitHub:

.env
multigenai.db
venv/
__pycache__/

๐Ÿ“ Module Description

File Purpose
app.py Main Streamlit application, UI and chat flow
auth.py User registration, login and password verification
database.py SQLite database initialization
intent_detector.py Detects domain, subject, intent, task and urgency
prompt_builder.py Creates dynamic context-aware prompts
tests/test_intent.py Tests Smart Intent Detection
tests/test_prompt.py Tests Prompt Builder

๐Ÿ› ๏ธ Technology Stack

Programming Language

  • Python

Generative AI

  • Qwen
  • Groq API
  • Large Language Models
  • Prompt Engineering
  • Intent Detection

Framework

  • Streamlit

Database

  • SQLite

Authentication

  • Werkzeug Password Hashing

Python Libraries

  • Streamlit
  • Groq
  • python-dotenv
  • Werkzeug

๐ŸŽฏ Use Cases

MultiGenAI is designed as a general-purpose AI workspace.

๐Ÿ’ป Programming

Example:

Why does my Python code give a ValueError?

MultiGenAI identifies the request as a programming and debugging task.


๐Ÿค– AI & Machine Learning

Example:

Explain overfitting with a real-world example.

The system identifies the topic and provides a practical explanation.


๐Ÿ“š Education

Example:

Tomorrow is my chemistry exam.
Give me 20 MCQs with answers.

The system understands the educational context and exam preparation requirement.


๐Ÿ’ผ Career

Example:

Analyze this Data Science internship job description
and tell me what skills I need.

The system identifies the career-related task and provides relevant guidance.


โœ๏ธ Content Writing

Example:

Write a professional LinkedIn post about my new AI project.

The system adapts the response according to the requested writing task.


๐ŸŒŽ General Questions

Example:

Why is the sky blue?

MultiGenAI can also handle questions outside predefined domains.


๐Ÿฅ Medical Safety

For health-related questions, MultiGenAI follows safety-aware response behavior.

The system is designed to:

  • Provide general educational information
  • Avoid claiming to diagnose users
  • Avoid prescribing personalized medication or dosage
  • Recommend appropriate urgent medical care when symptoms may indicate an emergency

MultiGenAI is an AI assistant and does not replace a qualified medical professional.


๐Ÿ”„ Complete Workflow

User
 โ†“
Authentication
 โ†“
Enter Message
 โ†“
Smart Intent Detection
 โ†“
Domain + Subject + Intent + Task + Urgency
 โ†“
Prompt Builder
 โ†“
Conversation Context
 โ†“
Qwen Model via Groq
 โ†“
Streaming Response
 โ†“
Save Conversation
 โ†“
SQLite Database

๐Ÿงช Testing

MultiGenAI includes separate testing scripts for the Smart Mode components.

Test Intent Detection

python tests/test_intent.py

Test Prompt Builder

python tests/test_prompt.py

These tests help verify the individual components before using them inside the main application.


โš™๏ธ Installation

1. Clone the Repository

git clone <YOUR_GITHUB_REPOSITORY_URL>

Then enter the project directory:

cd MultiGenAI

2. Create Virtual Environment

python -m venv venv

Windows

venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

4. Configure Environment Variables

Create a .env file in the project root:

GROQ_API_KEY=your_groq_api_key

Never upload the .env file to GitHub.


5. Run the Application

streamlit run app.py

The application will open in your browser.

Note: Keep your GROQ_API_KEY private and never commit .env or database files.


๐Ÿ”‘ Environment Variables

Variable Description
GROQ_API_KEY API key used to access the Groq API

๐Ÿง  Why Smart Mode?

Traditional chatbot applications often require users to manually choose a category before asking a question.

MultiGenAI removes that unnecessary step.

Traditional Approach

User
 โ†“
Select Domain
 โ†“
Ask Question
 โ†“
AI Response

MultiGenAI Smart Mode

User
 โ†“
Ask Anything
 โ†“
AI Understands Intent
 โ†“
Builds Context
 โ†“
Generates Response

This creates a more natural and user-friendly AI experience.


๐Ÿ“ Design Philosophy

MultiGenAI follows a modular architecture.

Different responsibilities are separated into different modules:

Authentication
       โ†“
Database
       โ†“
Intent Detection
       โ†“
Prompt Building
       โ†“
LLM Generation
       โ†“
User Interface

This makes the application easier to:

  • Maintain
  • Debug
  • Test
  • Extend
  • Improve
  • Deploy

๐Ÿšง Current Limitations

  • SQLite is currently used for persistent storage.
  • Intent detection depends on an LLM.
  • Groq API usage is subject to model and service limits.
  • Conversation memory is limited by the available context.
  • No external document RAG system is currently integrated.
  • No autonomous AI agent system is currently integrated.

๐Ÿ”ฎ Future Improvements

Possible future improvements include:

  • PostgreSQL or MongoDB integration
  • Google OAuth authentication
  • Advanced long-term memory
  • File upload and document understanding
  • RAG-based knowledge retrieval
  • Multi-model selection
  • Voice interaction
  • Image understanding
  • Tool calling
  • AI agents
  • Personalized user preferences
  • Advanced analytics dashboard

๐ŸŒŸ Future Vision

MultiGenAI is designed as a foundation for a more advanced AI ecosystem.

                    MultiGenAI
                        โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚               โ”‚               โ”‚
      GenAI            RAG            Agents
        โ”‚               โ”‚               โ”‚
   Generation      Knowledge       Autonomous
                    Retrieval        Tasks
        โ”‚               โ”‚               โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ”‚
                  Intelligent AI
                     Workspace

๐Ÿ‘จโ€๐Ÿ’ป Author

Subham Das

B.Tech Computer Science & Engineering

Areas of Interest

  • Artificial Intelligence
  • Machine Learning
  • Deep Learning
  • Natural Language Processing
  • Generative AI
  • Retrieval-Augmented Generation
  • AI Agents
  • Data Science

๐ŸŽฏ Project Goal

The goal of MultiGenAI is to build a practical, intelligent and extensible Generative AI workspace that understands what users actually want instead of forcing them to manually configure how the AI should respond.


๐Ÿ“œ License

This project is created for educational, portfolio and development purposes.

About

An Intelligent Multi-Domain Generative AI Workspace powered by LLMs, Qwen, and Groq, featuring Smart Intent Detection, context-aware conversations, secure authentication, and private chat history.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages