Inspiration
By the works of Carl Jung. Everyone has a different personality type. Each personality type comes with advantages and disadvantages. That means that each individual has strengths, but also weaknesses.
Carl Jung argues that we all have the same psychological tools available to us, within the collective unconscious (where we can find the psychological structures common to all humanity). Certain people exhibit certain personality types based on their genes and conditioning, but they are by no means permanently fixed. As people individuate and psychologically mature, they become capable of recognising the less developed parts of their self (their shadow), addressing the weaknesses of their personality, and correcting for them - leading to balance and wholeness. With balance and wholeness, an individual is best equipped to confront any challenge.
Most digital tools used today are built to help people work toward their conscious goals, rather than helping them uncover the unaddressed elements of their personality. I.e. To help people fix what they know, rather than what they do not know.
Imagine John Smith has to give a speech at work. He is nervous to speak, in case he comes across as incompetent. He does not want to be judged. Based on how tools commonly work today, most will help John develop confidence by improving self-esteem with specific techniques.
This has two problems: The adoption of advice, motivation and techniques is not always effective, as it is abstract in form. It is harder to follow advice than it is to model it. John never learns why he was nervous in the first place. He took an “emotional vitamin” to give him the strength to give his speech. But will John be able to transfer that to other domains of life? E.g. A first date? Negotiating the purchase of a house? People are unlikely to draw upon a generally abstract technique and apply it to other domains of life.
Instead of simply giving John tips to boost confidence, a personality-informed approach using MBTI could reveal that John is an Introverted Feeling (Fi) type who places strong internal value on competence and fears external judgment disrupting his inner harmony. His anxiety about public speaking may stem not just from a lack of skill, but from a deeper discomfort with being evaluated by others, especially in ways that challenge his self-image.
By understanding this, the tool could guide John to develop complementary traits associated with his less dominant functions, such as Extraverted Thinking (Te), which emphasizes objective communication and external structure.
Through this lens, John learns not just how to appear confident, but how to shift his focus from internal fears to the external purpose of his message. This fosters lasting growth, making him better equipped to handle future challenges across different life domains, and not just speeches, but also dating, negotiations, or conflict.
What it does
This project is a mental health support application that matches users with AI-powered personality coaches based on their MBTI (Myers-Briggs Type Indicator) personality type. The system begins by having users complete a personality assessment that categorizes them into one of 16 MBTI types (INTJ, ENFP, etc.). After determining the user's personality type and current challenges, the application uses a sophisticated matching algorithm to pair them with an appropriate AI coach that complements their personality traits. The backend implements a compatibility scoring system that considers factors such as expertise keywords, age compatibility, gender preferences, emotional state compatibility, and MBTI-specific traits to find the most suitable supporter for each user.
How we built it
The architecture employs a Flask backend with MongoDB for data persistence, and a Streamlit frontend for the user interface. The platform integrates with the Perplexity AI API for generating personalized responses and uses Hugging Face for model hosting. The matching algorithm analyzes user personality dimensions (Introvert/Extrovert, Sensing/Intuitive, Thinking/Feeling, Judging/Perceiving) to assign appropriate coaching styles, calculating compatibility scores based on expertise keywords, age compatibility, gender preferences, and emotional state alignment. The system also generates supporter personas with varying MBTI types, demographics, and expertise areas to provide diverse coaching options.
Key Components and Features
- Personality Assessment: MBTI-based questionnaire that categorizes users into 16 personality types
- AI Matching Algorithm: Pairs users with appropriate coach personas based on personality compatibility
- Personalized Coaching: Four distinct coaching styles (empathetic, analytical, practical, structured) matched to personality dimensions
- Secure Authentication: JWT-based user authentication system with password encryption
- Database Integration: MongoDB storage for user profiles, chat sessions, and supporter personas
- Dynamic Chat Interface: Real-time conversation with AI coaches that maintain consistent personality traits
- Session Management: Creation, summarization, and deletion of multiple chat sessions
- Profile Management: User ability to update personality type and current challenges
- API Integration: Various Modes via APIs like huggingface, OpenAI for generating contextually relevant responses
Tools and Technologies
- Backend: Flask, PyMongo, JWT, bcrypt for authentication
- Frontend: Streamlit for interactive UI components
- Database: MongoDB Atlas for cloud database storage
- Deployment: ngrok for exposing local development server
- Security: JWT tokens for secure API authentication
Challenges we ran into
- Model Selection - Due to a lack of LLMs fine-tuned specifically on psychological and behavioral data, various general conversational LLMs had to be experimented with.
- Agent creation - To craft accurate Agents, the base LLMs have to be provided structured prompts and context, longer the context, the more accurate is the Agent, but it also takes more time and computational overhead. So we had to come up with prompts of optimal length and content to create light and accurate Agents.
Accomplishments that we're proud of
- Shipping an ambitious project in little time.
- Altering the scope to deliver on the mission while coming in hot to the deadline.
- Building a solid working relationship between two strangers.
- Incorporating philosophical development into a product for people who could really need it.
What we learned
- LLMs are not as lightweight as we thought.
- A lot of personality research is sadly not open source.
- How to
What's next for GandalfBot
- Scaling up the application - Vector Databases for faster retrieval, more powerful, fine-tuned LLMs in the backend
- Data Security and Privacy - In the next iterations, our key focus would be on handling sensitive user data with complete security

Log in or sign up for Devpost to join the conversation.