<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hassan Faryad</title>
    <description>The latest articles on DEV Community by Hassan Faryad (@has_san).</description>
    <link>https://dev.to/has_san</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4117329%2F747abe91-ac4f-4609-8bcb-727adc443e4b.png</url>
      <title>DEV Community: Hassan Faryad</title>
      <link>https://dev.to/has_san</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/has_san"/>
    <language>en</language>
    <item>
      <title>Building a Privacy-First AI Companion with Next.js, FastAPI and Ollama</title>
      <dc:creator>Hassan Faryad</dc:creator>
      <pubDate>Wed, 09 Sep 2026 10:28:59 +0000</pubDate>
      <link>https://dev.to/has_san/building-a-privacy-first-ai-companion-with-nextjs-fastapi-and-ollama-17hp</link>
      <guid>https://dev.to/has_san/building-a-privacy-first-ai-companion-with-nextjs-fastapi-and-ollama-17hp</guid>
      <description>&lt;p&gt;Most AI applications send your conversations to a cloud LLM.&lt;/p&gt;

&lt;p&gt;I wanted to experiment with a different approach:&lt;/p&gt;

&lt;p&gt;What if an AI companion could run entirely on your own machine?&lt;/p&gt;

&lt;p&gt;That idea led me to build MindMirror — an open-source AI companion for emotional reflection that supports local LLMs through Ollama, removing the requirement for paid AI APIs.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/HASSANFARYAD/MindMirror" rel="noopener noreferrer"&gt;https://github.com/HASSANFARYAD/MindMirror&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Live Demo: &lt;a href="https://mindmirror-neon-tau.vercel.app/" rel="noopener noreferrer"&gt;https://mindmirror-neon-tau.vercel.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What is MindMirror?&lt;/p&gt;

&lt;p&gt;MindMirror combines journaling with AI-powered reflection.&lt;/p&gt;

&lt;p&gt;Users can write about what is on their mind and explore:&lt;/p&gt;

&lt;p&gt;🧠 Emotional patterns&lt;br&gt;
🔍 Cognitive distortions&lt;br&gt;
💭 Guided reflections&lt;br&gt;
📊 Emotional trends over time&lt;br&gt;
📈 Growth insights&lt;br&gt;
🎙️ Voice journaling&lt;br&gt;
🔔 Check-in reminders&lt;/p&gt;

&lt;p&gt;The goal is not to replace therapy or pretend that AI can do that.&lt;/p&gt;

&lt;p&gt;The goal is to create a structured and private space for reflection.&lt;/p&gt;

&lt;p&gt;Why Local AI?&lt;/p&gt;

&lt;p&gt;Privacy was one of the main reasons behind this project.&lt;/p&gt;

&lt;p&gt;Many AI applications rely entirely on cloud APIs, which means user conversations are sent to third-party services.&lt;/p&gt;

&lt;p&gt;With Ollama, MindMirror can run models locally.&lt;/p&gt;

&lt;p&gt;This means users can experiment with AI while keeping their journal data on their own machine.&lt;/p&gt;

&lt;p&gt;This approach combines:&lt;/p&gt;

&lt;p&gt;Local LLMs&lt;br&gt;
Open source&lt;br&gt;
User privacy&lt;br&gt;
Full control over data&lt;br&gt;
Technology Stack&lt;/p&gt;

&lt;p&gt;MindMirror is built using:&lt;/p&gt;

&lt;p&gt;Frontend&lt;br&gt;
Next.js&lt;br&gt;
React&lt;br&gt;
TypeScript&lt;br&gt;
Backend&lt;br&gt;
FastAPI&lt;br&gt;
Python&lt;br&gt;
Database&lt;br&gt;
PostgreSQL&lt;br&gt;
AI Components&lt;br&gt;
Ollama&lt;br&gt;
Whisper&lt;br&gt;
Hugging Face models&lt;br&gt;
Deployment&lt;br&gt;
Docker&lt;br&gt;
PWA support&lt;br&gt;
System Architecture&lt;/p&gt;

&lt;p&gt;The application follows a simple architecture:&lt;/p&gt;

&lt;p&gt;User&lt;br&gt;
   ↓&lt;br&gt;
Next.js Frontend&lt;br&gt;
   ↓&lt;br&gt;
FastAPI Backend&lt;br&gt;
   ↓&lt;br&gt;
AI Service Layer&lt;br&gt;
   ↓&lt;br&gt;
Ollama&lt;br&gt;
   ↓&lt;br&gt;
Local LLM&lt;br&gt;
   ↓&lt;br&gt;
Reflection &amp;amp; Analysis&lt;/p&gt;

&lt;p&gt;For voice journaling:&lt;/p&gt;

&lt;p&gt;Voice Input&lt;br&gt;
    ↓&lt;br&gt;
Whisper&lt;br&gt;
    ↓&lt;br&gt;
Text&lt;br&gt;
    ↓&lt;br&gt;
AI Analysis&lt;br&gt;
    ↓&lt;br&gt;
Journal Entry&lt;br&gt;
The Reflection Pipeline&lt;/p&gt;

&lt;p&gt;The conversation flow is inspired by CBT-style reflection patterns.&lt;/p&gt;

&lt;p&gt;The process is roughly:&lt;/p&gt;

&lt;p&gt;Detect → Validate → Examine → Ground → Next Step&lt;/p&gt;

&lt;p&gt;Detect&lt;/p&gt;

&lt;p&gt;Identify emotions, themes, and thought patterns.&lt;/p&gt;

&lt;p&gt;Validate&lt;/p&gt;

&lt;p&gt;Acknowledge feelings without judgment.&lt;/p&gt;

&lt;p&gt;Examine&lt;/p&gt;

&lt;p&gt;Explore assumptions and possible cognitive distortions.&lt;/p&gt;

&lt;p&gt;Ground&lt;/p&gt;

&lt;p&gt;Focus on practical perspectives and context.&lt;/p&gt;

&lt;p&gt;Next Step&lt;/p&gt;

&lt;p&gt;Suggest small actions or reflections.&lt;/p&gt;

&lt;p&gt;This structure helps create more useful interactions than simple question-answer chat systems.&lt;/p&gt;

&lt;p&gt;Running MindMirror Locally&lt;/p&gt;

&lt;p&gt;Clone the repository:&lt;/p&gt;

&lt;p&gt;git clone &lt;a href="https://github.com/HASSANFARYAD/MindMirror.git" rel="noopener noreferrer"&gt;https://github.com/HASSANFARYAD/MindMirror.git&lt;/a&gt;&lt;br&gt;
cd MindMirror&lt;/p&gt;

&lt;p&gt;Start the application:&lt;/p&gt;

&lt;p&gt;docker compose up&lt;/p&gt;

&lt;p&gt;Install Ollama:&lt;/p&gt;

&lt;p&gt;ollama pull llama3&lt;/p&gt;

&lt;p&gt;After setup, the AI can run locally without requiring paid APIs.&lt;/p&gt;

&lt;p&gt;What I Learned&lt;/p&gt;

&lt;p&gt;Building MindMirror taught me several things:&lt;/p&gt;

&lt;p&gt;Local LLMs are becoming practical for real applications.&lt;br&gt;
Privacy can be a product feature, not just a technical detail.&lt;br&gt;
Prompt design matters more than expected.&lt;br&gt;
Voice input creates a more natural journaling experience.&lt;br&gt;
Full-stack AI applications require careful orchestration between frontend, backend, models, and storage.&lt;br&gt;
Future Improvements&lt;/p&gt;

&lt;p&gt;Some ideas I am exploring:&lt;/p&gt;

&lt;p&gt;Better emotional trend visualization&lt;br&gt;
Support for additional local models&lt;br&gt;
Memory systems&lt;br&gt;
More advanced voice interactions&lt;br&gt;
Plugin ecosystem&lt;br&gt;
Open Source&lt;/p&gt;

&lt;p&gt;MindMirror is fully open source.&lt;/p&gt;

&lt;p&gt;If you are interested in:&lt;/p&gt;

&lt;p&gt;Local AI&lt;br&gt;
Ollama&lt;br&gt;
Open source projects&lt;br&gt;
Privacy-first applications&lt;br&gt;
AI companions&lt;br&gt;
Full-stack AI systems&lt;/p&gt;

&lt;p&gt;Feel free to explore the code, fork the project, open issues, or contribute.&lt;/p&gt;

&lt;p&gt;GitHub:&lt;br&gt;
&lt;a href="https://github.com/HASSANFARYAD/MindMirror" rel="noopener noreferrer"&gt;https://github.com/HASSANFARYAD/MindMirror&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Live Demo:&lt;br&gt;
&lt;a href="https://mindmirror-neon-tau.vercel.app/" rel="noopener noreferrer"&gt;https://mindmirror-neon-tau.vercel.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I would appreciate feedback from developers building local AI and privacy-focused applications.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>webdev</category>
      <category>python</category>
    </item>
  </channel>
</rss>
