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 App: https://arslan-ai-chatbot.streamlit.app/
- 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
| Personality | Allowed Topics |
|---|---|
| 🎓 English Teacher | Grammar, writing, literature, vocabulary, essay writing |
| 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.
| Tool | Purpose |
|---|---|
| Python 3.9+ | Core language |
| Streamlit | Web app framework |
| Groq Cloud API | LLM inference (Llama, Gemma, etc.) |
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
- The user selects an AI model and a personality from the sidebar
- On every message, the app sends:
- A system prompt (personality instructions) as the first message
- The full conversation history so the model remembers context
- The Groq API streams the response back token-by-token
- 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
Arslan
GitHub: @Arslan-Codes097