DEV Community

Bilal Aslam
Bilal Aslam

Posted on

🧠 I Built an AI That Reads Your Personality… and Roasts You πŸ’€

What if an AI could read your personality and roast you at the same time?

That was the idea behind MindReader AI.

MindReader AI is a fun AI-powered personality scanner built with Python and Google Gemini. It asks you 8 behavioral questions, analyzes your answers, and generates a short, personalized personality report.

And sometimes…

"BRO… HOW DID IT KNOW THAT?"πŸ’€


🧠 What Is MindReader AI?

The concept is simple:

Answer 8 questions β†’ AI analyzes your behavior β†’ AI exposes you.

The questions are designed around everyday situations involving:

  • Decision making
  • Criticism
  • Money
  • Social situations
  • Risk taking
  • Relationships
  • Overthinking
  • Uncertainty

The answers are sent to Gemini, which analyzes the patterns and generates a personality report.

The report can include:

  • Personality type
  • Overthinking score
  • Self-awareness score
  • Risk-taking score
  • Pretending-You-Don't-Care score
  • AI observations
  • A "Caught" moment
  • Final verdict
  • Confidence score

This isn't intended to be a scientific psychological assessment.

It's an entertainment project and an experiment in making AI interaction more interesting.


🎯 Why Did I Build It?

I didn't want to build another generic AI chatbot.

There are already approximately 7 billion of those. πŸ’€

I wanted to build something where the AI's response itself becomes the experience.

Instead of:

"You appear to be moderately introverted."

MindReader might tell you:

"You said you don't care. Your brain immediately opened 17 tabs trying to figure out what they meant."

That's much more fun.


πŸ”₯ The Roast Factor

This is probably my favorite part of the project.

I specifically designed the prompt so the AI doesn't produce a boring psychological essay.

The output is supposed to be:

  • Short
  • Funny
  • Sarcastic
  • Relatable
  • Personalized
  • Slightly brutal

One of the sections is called:

🚨 CAUGHT

This is basically the AI saying:

"Yeah... I noticed that."

For example:

🚨 CAUGHT:
You said "I don't care."

Your brain immediately started analyzing
why they said what they said.
Enter fullscreen mode Exit fullscreen mode

The goal isn't to insult the user.

It's to create that moment where the result feels way too relatable.


πŸ€– How Does It Work?

The overall flow is:

User Answers
     ↓
Question Manager
     ↓
Gemini AI
     ↓
Personality Analysis
     ↓
Personality Report
     ↓
Saved TXT Report
Enter fullscreen mode Exit fullscreen mode

The QuestionManager handles the questions and user responses.

The PersonalityAnalyzer prepares the information and sends it to Gemini.

The generated result is then passed to the report system and saved as a timestamped .txt file.

This separation keeps the application easier to understand and maintain.


🧩 Project Architecture

One of the things I wanted to practice with this project was OOP and separation of responsibilities.

The project is organized roughly like this:

MindReader-AI/
β”‚
β”œβ”€β”€ main.py
β”œβ”€β”€ cli.py
β”œβ”€β”€ requirements.txt
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ analyzer.py
β”‚   β”œβ”€β”€ questions.py
β”‚   β”œβ”€β”€ report.py
β”‚   └── config.py
β”‚
β”œβ”€β”€ gui/
β”‚   β”œβ”€β”€ app.py
β”‚   β”œβ”€β”€ theme.py
β”‚   β”œβ”€β”€ parser.py
β”‚   β”œβ”€β”€ components.py
β”‚   └── views/
β”‚       β”œβ”€β”€ welcome_view.py
β”‚       β”œβ”€β”€ question_view.py
β”‚       β”œβ”€β”€ scanning_view.py
β”‚       └── result_view.py
β”‚
β”œβ”€β”€ prompts/
β”‚   └── personality_prompt.txt
β”‚
└── data/
    └── reports/
Enter fullscreen mode Exit fullscreen mode

The exact structure may evolve as the project grows, but the main idea remains the same:

UI should not be responsible for everything.


🎨 From CLI to GUI

MindReader originally started as a CLI application.

The terminal version uses Rich to make the experience more interactive and visually appealing.

But after getting the core system working, I wanted to turn it into something that actually looked like an AI product.

So I built a full desktop GUI using CustomTkinter.

The GUI follows this flow:

Welcome
   ↓
Answer 8 Questions
   ↓
AI Scanning
   ↓
Personality Reveal
   ↓
Saved Report
Enter fullscreen mode Exit fullscreen mode

The visual identity uses:

  • Deep charcoal background
  • Electric purple accents
  • Cyan AI/scanner accents
  • Rounded cards
  • Subtle animations
  • Clean typography

The goal was:

AI scanner + psychological mystery + questionable humor.

Not:

Every element glowing like it's about to launch a spaceship. πŸ˜‚


🧠 The AI Scanning Experience

One problem I wanted to avoid was the GUI freezing while waiting for the Gemini response.

Nobody wants to click a button and stare at:

Not Responding...
Enter fullscreen mode Exit fullscreen mode

So the AI request runs in the background while the interface remains responsive.

During the scan, the application can display messages such as:

Reading behavioral patterns...
Enter fullscreen mode Exit fullscreen mode
Connecting personality signals...
Enter fullscreen mode Exit fullscreen mode
Detecting suspicious levels of overthinking...
Enter fullscreen mode Exit fullscreen mode
Preparing your psychological damage...
Enter fullscreen mode Exit fullscreen mode

And finally:

SCAN COMPLETE βœ“
Enter fullscreen mode Exit fullscreen mode

The waiting period becomes part of the experience instead of looking like the application crashed.


πŸ’» CLI Still Works

Even after building the GUI, I didn't want to throw away the original CLI version.

MindReader now supports both experiences.

🎨 GUI

Run the GUI using the project's GUI entry point.

python main.py
Enter fullscreen mode Exit fullscreen mode

πŸ’» CLI

The CLI remains available separately.

python cli.py
Enter fullscreen mode Exit fullscreen mode

This gives the project two different experiences:

GUI: A polished desktop application.

CLI: A lightweight terminal-based personality scanner.


πŸ› οΈ Tech Stack

Python

The core programming language used throughout the project.

Google Gemini API

Used for generating the AI-powered personality analysis.

CustomTkinter

Used to build the modern desktop GUI.

Rich

Used to improve the CLI experience.

python-dotenv

Used for environment-based configuration and API key management.

Object-Oriented Programming

The project uses classes to separate different responsibilities instead of putting everything inside one giant file.

Because eventually that giant file would probably start reading my personality instead. πŸ’€


πŸ“„ Saving Personality Reports

Every completed scan can be saved as a timestamped text report.

For example:

data/reports/
└── TTT_2026-08-31_19-17-51.txt
Enter fullscreen mode Exit fullscreen mode

This means the result isn't lost when the application closes.

The GUI can also provide access to the generated report.


πŸ” API Key Security

The Gemini API key is not hardcoded into the source code.

The project uses environment-based configuration so sensitive credentials don't need to be committed to GitHub.

A .env file should never be pushed to the repository.

For example:

GEMINI_API_KEY=your_api_key_here
Enter fullscreen mode Exit fullscreen mode

The actual API key should remain private.


⚠️ Handling API Failures

While developing the project, I also encountered Gemini 503 UNAVAILABLE responses when the model was experiencing high demand.

Instead of immediately crashing the application, the project includes retry handling for temporary API failures.

The idea is simple:

API Request
     ↓
503 Error?
   ↙     β†˜
 YES      NO
 ↓         ↓
Retry    Continue
Enter fullscreen mode Exit fullscreen mode

This was a good reminder that using an API isn't just about making the first request work.

You also need to think about what happens when things don't work.


🧠 What I Learned

This project taught me much more than just how to call an AI API.

1. Working With AI APIs

I learned how to structure prompts, provide user context, process generated responses, and handle API failures.

2. OOP in a Real Project

Instead of practicing classes only with tiny examples, I used OOP to structure an actual application.

3. GUI Development

Building the GUI made me think about:

  • User experience
  • Navigation
  • Application state
  • Background tasks
  • Loading states
  • Error handling
  • Visual feedback

4. Separation of Concerns

Keeping the AI logic separate from the UI made the project much easier to work with.

5. AI + Software Engineering

The AI may generate the personality analysis, but everything around it still needs proper engineering.

The API doesn't magically write your architecture for you.

Unfortunately. πŸ˜‚


πŸ“Š Example Personality Result

A typical result can look something like:

🧠 MINDREADER AI
SCAN COMPLETE βœ“

TYPE:
Professional Overthinkerβ„’

πŸ“Š BRAIN STATS

Overthinking: 97%
Self-Awareness: 91%
Risk Taking: 31%
Pretending IDC: 94%

πŸ€– AI SAYS:

You don't make bad decisions.
You simply spend 4 hours making them.

🚨 CAUGHT:

You say "I don't care"
after thinking about it for 3 hours.

πŸ’€ FINAL VERDICT:

Emotionally stable.
Mentally running Windows 37.

CONFIDENCE: 94%
Enter fullscreen mode Exit fullscreen mode

The exact result changes depending on the user's answers.

That's the whole point.


πŸš€ What I Want to Improve Next

There are still several ideas I'd like to explore:

  • More behavioral scenarios
  • Additional personality dimensions
  • Better result visualization
  • Custom question packs
  • Historical scan comparisons
  • More report export formats

But I'm intentionally keeping the project focused.

I don't want MindReader to become some giant psychological platform.

The goal is still:

A fun AI experiment that makes you question your own decisions. πŸ’€


πŸŽ₯ See It In Action

I've recorded both versions of MindReader:

CLI β†’ GUI β†’ AI scanning β†’ personality reveal

The GUI shows the complete user experience, while the CLI demonstrates the original terminal-based version.

The most important part?

Waiting to see what the AI is going to say about you. πŸ˜‚


πŸ”— Try MindReader AI

The project is available on GitHub:

MindReader AI

Feel free to explore the code, try the application, or experiment with the personality prompt.

And if the AI exposes you...

That's between you and Gemini. πŸ’€


🏁 Final Thoughts

MindReader AI started with a simple question:

Can I make an AI personality scanner that's actually fun to use?

It eventually became a project where I could combine:

Python + OOP + AI APIs + GUI Development + File Handling + Project Architecture

into one application.

It's not a scientific personality test.

It's not designed to diagnose anyone.

It's simply an experiment in making AI interaction more entertaining.

And honestly, the best part is watching someone finish the questions and wait for the result.

Because sooner or later, there's always that moment:

"Wait..."

"Why is this actually accurate?" πŸ’€


πŸ‘¨β€πŸ’» Final Question

If you tried MindReader AI, what personality type do you think it would give you?

Professional Overthinker?

Silent Strategist?

Chaotic Decision Maker?

Or something even worse? πŸ˜‚


⭐ If you enjoyed the project, consider giving the repository a star on GitHub.

Python #AI #Gemini #GenerativeAI #PythonProjects #OOP #CustomTkinter #GUI #SoftwareDevelopment #AIProjects #BuildInPublic #LearningInPublic

Top comments (0)