A feature-rich, multilingual AI chatbot desktop application built with JavaFX and powered by the Groq API. Designed for students, educators, and professionals who need a fast, intelligent assistant with a polished native UI.
AI Assistant Pro is a fully-featured desktop chatbot that combines a local FAQ engine (TF-IDF based) with live Groq LLM responses β giving you instant answers for known topics and deep AI reasoning for everything else. It ships with 10 distinct features including voice input/output, multi-language support, session persistence, message pinning, and much more.
| # | Feature | Description |
|---|---|---|
| 1 | π Voice Input | Speak your questions β mic input transcribed in real time |
| 2 | π Text-to-Speech | AI responses read aloud with per-message speak/stop controls |
| 3 | π Chat Search | Full-text search across all sessions with highlighted snippets |
| 4 | π Pin Messages | Pin any message from any chat; view all pins in one panel |
| 5 | πΎ Session Persistence | All chat sessions saved to disk and restored on next launch |
| 6 | π Notification Sound | Synthesised ping tone when AI finishes responding (no audio file needed) |
| 7 | π Word Count & Reading Time | Every message shows word count and estimated reading time |
| 8 | π€ Export Chats | Save conversations as .txt or styled .html files |
| 9 | π Multi-Language UI | Full UI in English, Arabic (RTL), Urdu (RTL), and French |
| 10 | β¨οΈ Keyboard Shortcuts | 20+ shortcuts for power users with a dedicated shortcut reference panel |
- Dual AI Engine β Local FAQ matching (TF-IDF + cosine similarity) for university queries; Groq LLM for open-ended questions
- Multiple AI Models β Switch between
llama-3.3-70b-versatile,llama-3.1-8b-instant,mixtral-8x7b-32768, andgemma2-9b-it - AI Personas β 10 built-in roles: General Assistant, Coding Expert, Science Teacher, Math Tutor, Creative Writer, Language Translator, Doctor Advisor, Legal Advisor, Career Coach, Fitness Trainer
- Dark / Light Theme β Toggle themes live from Settings
- Markdown Rendering β Bot responses rendered with full Markdown support (code blocks, tables, bold, italic, lists)
- Animated Chat Bubbles β Smooth fade-in and slide-up animations on every message
- File Upload β Attach
.txt,.md,.java,.py,.json, or.csvfiles as context - Regenerate Response β Re-ask the last prompt with one click or
Ctrl+R - Adjustable Font Size β Slider from 11 px to 20 px
- Splash Screen β Branded loading screen on launch
src/
βββ main/
βββ java/
βββ com/faqchatbot/
βββ Main.java # JavaFX entry point & window bootstrap
βββ ChatController.java # Central UI controller (input, send, history)
βββ ChatBubble.java # Message bubble component (pin, copy, TTS, stats)
βββ ChatSession.java # Session data model (messages, metadata, JSON I/O)
βββ ChatSearchPanel.java # Feature 3 β cross-session search modal
βββ FAQData.java # Hardcoded FAQ dataset (university Q&A)
βββ FAQEngine.java # TF-IDF + cosine similarity search engine
βββ GroqClient.java # Groq REST API client (multi-model, multi-persona)
βββ SessionManager.java # Disk-based session load / save / delete
βββ Sidebar.java # Session list sidebar with delete support
βββ SettingsPanel.java # Settings modal (API key, model, persona, themeβ¦)
βββ PinManager.java # Feature 4 β in-memory pin store with listeners
βββ PinnedPanel.java # Feature 4 β pinned messages modal
βββ FileHandler.java # TXT/HTML export + file upload reader
βββ MarkdownRenderer.java # Flexmark-based Markdown β HTML renderer
βββ NotificationSoundManager.java# Feature 6 β PCM sine-wave ping generator
βββ I18nManager.java # Feature 9 β i18n string table (en/ar/ur/fr)
βββ KeyboardShortcutsPanel.java # Feature 10 β shortcuts reference modal
βββ SpeechManager.java # TTS engine wrapper
βββ VoiceInputManager.java # Feature 1 β microphone input manager
resources/
βββ style.css # Full dark/light theme stylesheet
βββ assets/
βββ icon.png # App icon
| Layer | Technology |
|---|---|
| Language | Java 17+ |
| UI Framework | JavaFX 21 |
| AI API | Groq Cloud |
| HTTP Client | Java java.net.http.HttpClient |
| JSON | Google Gson + org.json |
| Markdown | Flexmark-Java |
| Audio | javax.sound.sampled (PCM synthesis, no external files) |
| Persistence | JSON files in ~/AIAssistantPro/sessions/ |
| Build Tool | Maven (recommended) |
- Java 17 or higher
- Maven 3.8+
- A free Groq API key
git clone https://github.com/YOUR_USERNAME/ai-assistant-pro.git
cd ai-assistant-pro
mvn clean packagemvn javafx:runOr run the packaged JAR:
java -jar target/ai-assistant-pro-1.0.jar- Launch the app
- Click βοΈ Settings in the header (or press
Ctrl+,) - Paste your Groq API key in the API Configuration field
- Click β Save & Close
Your key is stored in the settings panel for the current session. To persist it across launches, add it to GroqClient.java:
private static String API_KEY = "gsk_your_key_here";| Shortcut | Action |
|---|---|
Enter |
Send message |
Shift + Enter |
New line in input |
Ctrl + R |
Regenerate last response |
Ctrl + L |
Clear chat |
Ctrl + N |
New chat session |
Ctrl + F |
Search all chats |
Ctrl + P |
Open pinned messages |
Ctrl + , |
Open settings |
Ctrl + ? |
Show keyboard shortcuts |
Ctrl + E |
Export chat |
Ctrl + M |
Start / stop mic recording |
Ctrl + S |
Toggle notification sound |
Ctrl + 1β4 |
Switch language (EN / AR / UR / FR) |
Escape |
Close any open dialog |
The UI is fully translated into four languages. Switch instantly from Settings β Language or via Ctrl+1 through Ctrl+4.
| Code | Language | Direction |
|---|---|---|
en |
English | LTR |
ar |
Ψ§ΩΨΉΨ±Ψ¨ΩΨ© (Arabic) | RTL |
ur |
Ψ§Ψ±Ψ―Ω (Urdu) | RTL |
fr |
FranΓ§ais (French) | LTR |
RTL layouts are automatically applied to input fields, result lists, and message snippets.
The built-in FAQ engine answers common university-related questions without an internet connection, including topics like:
- Admission requirements & deadlines
- Tuition fees & scholarships
- Exam schedules & attendance rules
- Hostel, library, transport, and campus facilities
- Transcripts, GPA calculation, and results
It uses a TF-IDF vectoriser with cosine similarity scoring. If the best match scores below the confidence threshold (0.1), the query is automatically escalated to the Groq LLM.
To add your own FAQs, edit FAQData.java:
faqs.put("Your question here?", "Your answer here.");| Format | What you get |
|---|---|
| TXT | Plain-text transcript with timestamps and a decorative header |
| HTML | Styled dark-theme page with coloured user/bot bubbles, ready to open in any browser |
All runtime settings are accessible via the Settings panel (Ctrl+,):
| Setting | Options |
|---|---|
| API Key | Groq key (gsk_β¦) |
| AI Model | llama-3.3-70b Β· llama-3.1-8b Β· mixtral-8x7b Β· gemma2-9b |
| AI Persona | 10 built-in roles |
| Theme | π Dark / βοΈ Light |
| Text-to-Speech | On / Off |
| Notification Sound | On / Off + live test |
| Font Size | 11 px β 20 px slider |
| Language | EN / AR / UR / FR |
<dependencies>
<!-- JavaFX -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>21</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-web</artifactId>
<version>21</version>
</dependency>
<!-- Groq / JSON -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20231013</version>
</dependency>
<!-- Markdown -->
<dependency>
<groupId>com.vladsch.flexmark</groupId>
<artifactId>flexmark-all</artifactId>
<version>0.64.8</version>
</dependency>
</dependencies>Contributions are welcome! Here's how:
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Commit your changes:
git commit -m "Add: your feature description" - Push to the branch:
git push origin feature/your-feature-name - Open a Pull Request
Please keep code style consistent with existing files (JavaFX conventions, descriptive comments, feature-tagged sections).
This project is licensed under the MIT License β see the LICENSE file for details.
UBAIDULLAH WAHEED
π§ ubaidullahwaheed685@gmail.com
π GitHub Β· LinkedIn
- Groq β blazing-fast LLM inference API
- Flexmark-Java β Markdown parsing & rendering
- JavaFX β modern Java UI toolkit
- University FAQ dataset compiled for academic use
β If you find this project useful, please give it a star!
Made with β and Java