Inspiration
The seed for MindBridge AI was planted during my grade 9 charity trip to a highland area in Khánh Hòa. Partnering with the University of Medicine and Pharmacy, we provided health counseling to middle-school students. As the lead for ice-breaking activities, I bonded with these students and learned about their daily lives, emotions, and puberty-related concerns.
I noticed a critical gap that day: many students lacked knowledge about their own mental changes and struggled to access trustworthy support. For many teenagers, opening up to family is difficult, and professional counseling is often inaccessible—especially in remote communities.
I realized that "access" is the biggest barrier: not everyone can reach a counselor, but almost everyone can reach technology. This motivated me to build MindBridge AI—a supportive, friend-like chatbot that helps teenagers take small, practical steps when they feel overwhelmed.
What I Built
MindBridge AI is a lightweight designed to address specific teen pain points rather than offering generic conversation. It features four focused modes:
- Health: Calming support, grounding tools, and safe coping steps (strictly non-diagnostic).
- School Stress: Helps prioritize deadlines and breaks homework into manageable tasks.
- Friends: Scripts for apologies, conflict resolution, and setting boundaries.
- Coding: A practical companion for debugging and learning.
Technical Implementation
To create a fast, demo-ready prototype, I built:
- Backend: FastAPI (Python) for high-performance handling of requests.
- Frontend: Vanilla JS (HTML/CSS/JS) for a lightweight, dependency-free UI.
- Memory: Session-based chat history stored in RAM (per
session_id). - UX: Streaming responses (server-sent events) for a fluid, "ChatGPT-like" feel.
- RAG (Retrieval-Augmented Generation): Users can upload notes (TXT/MD/PDF), and the bot retrieves relevant chunks to provide grounded answers.
Google Technology Implementation
To meet the hackathon requirements and improve performance, I architected the backend to run entirely on the Google Gemini API.
- Generative Model: I used
gemini-1.5-flash. I chose this specific model because its low latency is critical for making the chatbot feel like a real-time “friend” rather than a slow machine. - Safety Architecture: I utilized Gemini’s native
system_instructionparameter. This allowed me to “hard-code” the persona (supportive, non-diagnostic) at the model level, ensuring safer responses compared to standard prompt engineering. - RAG & Embeddings: For the “Upload Notes” feature, I implemented
models/text-embedding-004. When a student uploads a PDF or TXT file, the system generates embeddings via thegoogle-generativeaiSDK to perform vector search, allowing the bot to answer questions based strictly on the user’s homework.
Safety & Responsible Design
I am acutely aware of the risks involved when AI interacts with mental health. MindBridge AI is intentionally designed as supportive, not diagnostic:
- Scope: It avoids medical diagnoses or clinical claims.
- Focus: It prioritizes safe coping tools (breathing, journaling, grounding).
- Escalation: It is programmed to encourage seeking real-world professional help for serious situations.
My goal is not to replace professionals, but to provide a friendly bridge that helps teenagers regulate their emotions enough to take the next constructive step.
Challenges Faced
- Balancing Empathy and Safety: My biggest concern was ensuring the bot is supportive without giving dangerous medical advice. I had to carefully tune the system prompts to be warm but strictly non-diagnostic.
- Technical Complexity of Persistence: I wanted users to be able to revisit their past conversations (like a history log), but building a secure database with user authentication was out of scope. Currently, chat history lives in RAM and is lost on refresh—a trade-off made for speed.
- Limitations in AI Reasoning: Unlike massive commercial models (like full ChatGPT), my lightweight implementation sometimes struggles to maintain context over long conversations or "think" through complex logic. It can occasionally be repetitive or forget earlier details.
- Time Constraints: Building an entire Full Stack application (Backend, Frontend, and Logic) solo meant I had to prioritize core features over advanced "nice-to-haves."
- Reliability for Demo: To prevent live failures, I added a Demo Mode so the project can run smoothly during presentation even without API quota or billing issues.
What I Learned
Building this MVP taught me how to translate a social problem into a working prototype:
- Prompt Engineering: Designing system prompts that keep the AI focused on specific "modes."
- State Management: Handling sessions and history manually in a stateless backend environment.
- RAG Implementation: Learning how to chunk, index, and retrieve user-uploaded data to ground the AI's responses.
Built With
- fastapi
- html/css
- openai-api
- python
- rag-(cosine-similarity)
- streaming
- vanilla-js
Log in or sign up for Devpost to join the conversation.