Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arslan.ai — Personality-Based AI Chatbot

An interactive chatbot web app built with Streamlit and the Groq Cloud API. Users can select from 5 AI personalities, each restricted to answering only questions within its own domain. Conversations are streamed in real time and remembered within the session.


🚀 Live Demo

Live App: https://arslan-ai-chatbot.streamlit.app/


✨ Features

  • 5 Distinct AI Personalities — each enforced by a carefully crafted system prompt
  • Personality Enforcement — the chatbot politely refuses off-topic questions
  • Live Model Selection — models are fetched dynamically from the Groq API
  • Streaming Responses — replies stream word-by-word, just like ChatGPT
  • Session Memory — full conversation history is maintained within the session
  • Auto-Reset — switching personality or model automatically starts a new chat
  • New Chat Button — one click to clear the conversation and start fresh

🎭 Personalities

Personality Allowed Topics
🎓 English Teacher Grammar, writing, literature, vocabulary, essay writing
✈️ Travel Guide Destinations, itineraries, travel tips, visa info, hotels
🏆 Sports Expert All sports, player stats, match analysis, fitness, training
🩺 Doctor Health, symptoms, medicine, nutrition, wellness (informational only)
💻 Tech Support Devices, software, OS troubleshooting, networking, cybersecurity

Each personality strictly refuses questions outside its scope using a scripted polite response.


🛠️ Tech Stack

Tool Purpose
Python 3.9+ Core language
Streamlit Web app framework
Groq Cloud API LLM inference (Llama, Gemma, etc.)

📁 Project Structure

Personality-based-ChatBot/
├── app.py               # Main Streamlit application
├── personalities.py     # System prompts for all 5 personalities
├── requirements.txt     # Python dependencies
├── .env                 # Local API key (NOT committed to GitHub)
├── .gitignore           # Excludes .env and secrets from git
└── README.md            # This file

💡 How It Works

  1. The user selects an AI model and a personality from the sidebar
  2. On every message, the app sends:
    • A system prompt (personality instructions) as the first message
    • The full conversation history so the model remembers context
  3. The Groq API streams the response back token-by-token
  4. Changing the model or personality resets the conversation automatically
User Input
    │
    ▼
[System Prompt (personality)] + [Conversation History] + [New User Message]
    │
    ▼
Groq API (selected model)
    │
    ▼
Streamed Response → Displayed in chat → Saved to session history

👤 Author

Arslan
GitHub: @Arslan-Codes097

About

An interactive AI chatbot web app built with Streamlit and Groq. Features 5 distinct personalities that strictly enforce topic boundaries, real-time streaming, and session memory.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages