Building Socio: Adding AI Insights to a React Native Habit Tracker

I’ve always wanted to build a habit tracker. Having used so many of them, I wanted to build something which also has a social aspect. With that thought, I built Socio. I also wanted to make use of AI in a meaningful way, where it would guide and help users instead of annoying them. I felt through the app, you should get actionable insights and ways to improve on your habit building journey.
What the AI Actually Does
When you log a habit, Socio analyzes your patterns and gives you three things:
A specific action to take next
Encouragement based on your actual progress
Sometimes a relevant pop culture reference (if it fits)
Example: Complete your workout 3 days in a row, and you might see:
"Push for day 4 tomorrow by logging before noon. Three days strong - that's your best streak this month. As Rocky says, 'It ain't about how hard you hit...'"
Simple idea. Execution? Not so much.
Challenges
The “Honey” Problem:
AI generated content is prone to hallucinations, which makes guardrails critical. Early versions of the AI feature kept calling users "honey," "sweetie," and "dear". Not exactly what you want in a professional habit coaching app. Worse, it occasionally generated offensive text. I decided to add Gemini’s safety settings and write better prompts to tackle this. I ended up spending more hours on content filtering than on the actual API integration.
const safetySettings = [
{
category: HarmCategory.HARM_CATEGORY_HARASSMENT,
threshold: HarmBlockThreshold.BLOCK_ONLY_HIGH,
},
{
category: HarmCategory.HARM_CATEGORY_HATE_SPEECH,
threshold: HarmBlockThreshold.BLOCK_ONLY_HIGH,
},
{
category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT,
threshold: HarmBlockThreshold.BLOCK_ONLY_HIGH,
},
{
category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT,
threshold: HarmBlockThreshold.BLOCK_ONLY_HIGH,
},
];
The safety settings eliminated the offensive content, but created a new problem: the AI became robotic. Responses like "Good job!" and "Well done!" felt generic and lifeless. More prompt engineering was needed to find the sweet spot, professional yet personable, safe but not sterile. After testing lot of prompts, I finally found a working prompt. I added system instructions along to further block out any offensive text.
const prompt = `I'm tracking these habits: ${habitNames}. My overall completion rate is ${percent}%.
I've completed ${completions.length} habit tasks so far. Analyze my habit data and provide a
personalized, insightful message about my progress patterns, any correlations you notice,
and actionable advice to improve further.`;
The Cost Problem:
Generating insights every time habit data changes gets expensive fast. The solution is simple, cache generated insights and only create new ones once per day. Right now it's generating after every habit log because it's early access - I wanted to see how people actually use it. But daily generation is the smarter approach for production.
What’s Coming Next
Better, Smarter Insights: The current implementation is basic. There's a lot of room for improvement - more context, better pattern recognition, more personalized content.
Tone Selection: Let users choose their coaching style: playful, motivating, analytical, supportive. Same data, different delivery. Would feel more personal and elevate user experience.
AI generated push notifications: Smart reminders that actually motivate instead of generic reminder notifications.
Multiple AI models: Currently only Gemini is supported. I would like to add support for more models like ChatGPT and Claude. Let users pick their preferred model. Different models have different personalities.
Final Thoughts
Working with AI generated content is trickier than it looks. Safety settings and guardrails aren't optional, they're critical. The API call is the easy part. Everything around it, filtering, prompting and handling edge cases is where the real work happens. Socio is available on the Google Play Store in Early Access.
Try it here: https://play.google.com/store/apps/details?id=com.vinaybomma.socio



