This is a submission for the GitHub Finish-Up-A-Thon Challenge
What I Built
Alright, honest moment — MindPal started as a Discord bot. One of those projects you build at 2am because you think "what if people could just type /cbt and get a cognitive restructuring exercise?" Cool concept. It worked. People used it.
But every time someone typed a command, something felt off.
You don't process a breakup with slash commands. You don't sit with grief in a Discord server where someone's gaming next door. You don't talk about your relationship patterns in the same app where you argue about League of Legends builds.
So the bot sat there. Half-finished. Collecting dust for months.
Then this challenge showed up. 373 commits later, here we are.
I looked at the repo, looked at the original commit history, and thought — the bones are good. The idea is real. The shape is wrong.
I killed the bot. Rebuilt MindPal from scratch as a private web app.
Not a chatbot. A thinking space.
What MindPal Actually Does
Here's the difference between MindPal and every other AI chat wrapper out there: MindPal doesn't react to your last sentence. It reads the room.
When you type something, MindPal runs a full internal reasoning chain before it responds. You can watch it happen — there's a "Thinking..." indicator that shows real elapsed time, then collapses into a "Thought for 4.2s" accordion you can expand to see exactly what it considered.
It checks your memory graph. It scans the conversation for patterns. It reads your nervous system state. It picks an intervention strategy. And THEN it talks to you.
That's not marketing copy — that's literally the prompt architecture. Six clinical steps run inside a hidden thought block before a single word reaches you.
Here's what landed in the final product:
- Voice input — talk to it instead of typing, because sometimes you can't type what you feel
- Structured memory graph — MindPal remembers your relationships, patterns, goals, coping tools, and what you've been avoiding. Not as raw chat logs. As atomic, categorized memory nodes
- Memory inspector — open settings, see an AI-generated summary of everything MindPal knows about you. Edit or delete anything. Full control
- Clinical framework RAG — CBT, DBT, ACT, Motivational Interviewing. Actual technique guidance grounded in retrieved clinical content, not vibes
- Safety routing — before the LLM even sees your message, a classifier checks if you're in crisis. If you are, the response pipeline changes completely. No cognitive exercises during a panic attack
- Two response modes — Standard mode thinks before it responds. Pro mode runs a full six-step clinical chain with pattern analysis, nervous system reads, and psychoeducation
- Firebase auth + guest mode — sign in to sync across devices, or stay local. Your choice
- Cloud chat sync — pick up where you left off on any device
- Provider fallback chain — if one AI provider goes down, MindPal switches to the next one mid-conversation
The Last 10 Days: What Changed Everything
The version I had 10 days ago worked. You could chat, it would respond, memory existed. But it was held together with duct tape. Here's what the last sprint fixed:
The Tool System
MindPal used to guess. "What time is it?" — the LLM would hallucinate a time. "Do you remember what I said about Maya?" — it would make something up or say "I don't have access to that."
I built a server-side tool framework with 7 registered tools. Time queries, memory search, user profile lookup, chat history search, web search — all running on the backend with real Firestore data. The chat router pattern-matches your message and pre-executes relevant tools before the LLM even starts generating.
No more hallucinated timestamps. No more fake "I remember" when it doesn't.
The Thinking Indicator
This one's small but it matters. When MindPal is thinking, you see animated dots and "Thinking..." — and it stays that way until the actual response begins. Not until the first token. Until the response delimiter hits the stream.
So if the model spends 6 seconds reasoning through its clinical chain, you see "Thinking..." for 6 real seconds. Then it snaps to "Thought for 6.0s" with a checkmark, and the response starts appearing.
I rewrote the stream parser twice to get this right. The first version finalized the indicator on the first chunk, so it always showed "Thought for 0.3s" even when the model was deep in its reasoning. That's dishonest UI. Fixed it.
Usage & Quota System
Real rate limiting. Not the fake kind where you tell users "limited" and then don't enforce it.
Dual rolling windows — 5-hour window with 50 credits, weekly window with 500 credits. Standard messages cost 1 credit, Pro costs 2. Both windows run independently. The more restrictive one wins.
Before every single API call, the frontend runs a pre-flight check. If you're out of credits, you see a banner above the chat input with time until reset. No leaked API calls. No surprise errors.
This wasn't just about cost — it's about fairness. When you're running a free service for people who might be going through the worst day of their year, you need to make sure one person doesn't burn through the entire API budget.
Mental Health Dashboard
Settings now has a Mental Health tab — second in the tab order, right after General. PHQ-9 and GAD-7 bar charts built with pure CSS flexbox (no chart library). When MindPal Pro builds clinical observations through conversations, the data shows up here: presenting problems, suspected patterns, treatment direction.
When there's no data yet, the charts show greyed-out sample bars with a realistic downward trend. Not "No data found." Not an empty box. A preview of what this space will look like as the relationship builds.
Memory Inspector Rewrite
The old memory panel said "MindPal remembers number durable items" and showed a list. Useless.
Now it generates a natural-language summary: "Your name is Omar. You prefer brief tone, Arabic. You'd rather avoid feeling sad exactly — just empty. You've told me about Maya. I've noticed patterns around breakup and shutting down. Your goals include emotional healing and reconnecting with friends."
No bold text. No item counts. Just what MindPal knows about you, written like a person would say it. Click "Manage" and a modal opens with every memory atom — edit, pin, or delete individually.
Settings Overhaul
Tab order reorganized: General → Mental Health → Usage → Memory → Data Controls → Security → Account. Core features up top, admin stuff at the bottom.
Toggle controls only respond to the toggle, not the label text (this was a bug that drove me crazy — clicking the description text toggled the switch).
Last item in every section has no trailing border. Padding adapts to content. Sign out button moved to the right. Arabic language option fixed. Small things, but the difference between "developer project" and "product."
The Self: REVIEW: Bug
The funniest bug in the whole project. MindPal's Pro mode runs a 6-step reasoning chain inside its Thought block. Step 6 was called "SELF-REVIEW." The LLM — being an LLM — sometimes interpreted this as an instruction to write "Self: REVIEW:" at the beginning of its visible response.
So users would see: "Self: REVIEW: Before proceeding, I want to ensure that my response is tailored to your specific needs."
That's the model's internal monologue leaking into the conversation. Fixed it three ways: renamed the step to "QUALITY CHECK" in the prompt, added an explicit rule ("NEVER start the Balanced Reframe with Self:"), and added a regex strip in the frontend parser as a safety net.
Demo
Live demo: MindPal Demo
GitHub repo: MindPal GitHub Repo
The walkthrough shows the actual product — landing flow, chat, voice interaction, thinking indicator, memory, and the idea behind the whole thing.
The Comeback Story
MindPal sat in a repo for months. Not because it was a bad idea — because it was in the wrong shape.
Here's what the commit history looks like — initial commit December 2023, then silence until the rebuild:
The Discord bot had the right intention. Give people coping strategies. Provide cognitive restructuring exercises. Offer grounding techniques when anxiety hits.
This is what the original bot looked like — real crisis resources, real safety routing, even back then:
And it worked. When someone typed something dangerous, the bot caught it and responded with real hotlines, coping tips, and resource links — not a generic "I'm sorry to hear that":
But a Discord bot can't remember who you are across conversations. It can't give you a private space to think out loud. It can't match the weight of what people bring to it.
When I decided to rebuild, I didn't start with features. I started with one question: what does someone actually need at 3am when they can't sleep because their thoughts won't stop?
Not a chatbot. Not a therapist replacement. Not another wellness app with meditation timers and breathing exercises.
They need a place to dump everything in their head, and something on the other side that holds it, sorts it, and says the right thing back. Something that remembers them. Something that knows the difference between "I'm fine" and what they actually mean.
That's the product. The technical features — memory graphs, clinical RAG, safety routing, tool execution — exist because that core need demanded them. The memory system exists because you shouldn't have to re-explain your breakup every time you open the app. The safety routing exists because when someone is in crisis, a cognitive exercise is the wrong answer. The voice input exists because sometimes you can't type what you feel.
The 10-day sprint wasn't about adding features to a list. It was about closing every gap between "this is a demo" and "this is something someone could actually use at their lowest moment."
I'm not done. But for the first time, MindPal feels like the product it was supposed to be from the beginning.



Top comments (1)
This project started as a small Discord bot idea, then turned into a full AI support web app with voice input, memory, cloud sync, safety routing, RAG-grounded coping tools, and a real product flow.
The hardest part wasn’t making the AI reply — it was making the system understand the situation before answering.
Demo: youtu.be/ZuNH2GgVs_g