DEV Community

Cover image for I Built FriendMind: A Private AI Study Companion for a Friend
Sanchali Torpe
Sanchali Torpe

Posted on

I Built FriendMind: A Private AI Study Companion for a Friend

🧠 I Built FriendMind: A Private AI Study Companion for a Friend

A document-grounded AI study companion that helps students learn from their own notes, test their understanding, and discover what they need to revise.

Built for the Hacktoberfest 2026 DEV Weekend Challenge β€” β€œBuild for a Friend.”

🀝 The Problem

I started this project with a simple question:

What could I build that would actually make studying easier for someone I know?

One problem kept coming up: having notes isn't the same as knowing what you actually understand.

A student can read a PDF, revise a chapter, and still not know:

  • Which concepts they truly understand
  • Whether they can explain something without looking at their notes
  • Where they're making mistakes
  • What they should revise next

A generic chatbot could answer questions, but I wanted something more personal.

Something that could work with the student's own study material and then help them test themselves.

That's how FriendMind started.


🧠 What is FriendMind?

FriendMind is a local-first AI study companion that turns a student's PDFs into an interactive learning workflow.

Upload Notes
     ↓
Index & Embed
     ↓
Semantic Search
     ↓
Ask Questions
     ↓
Generate Quiz
     ↓
Evaluate Answers
     ↓
Find Weak Topics
Enter fullscreen mode Exit fullscreen mode

Instead of simply chatting with an AI, the student can study from their own material, test their understanding, and identify what needs more revision.

✨ Current Features

  • πŸ“„ PDF upload and processing
  • πŸ”Ž Semantic search over uploaded notes
  • 🧠 Retrieval-Augmented Generation (RAG)
  • πŸ€– Local AI with Gemma 3
  • πŸ›‘οΈ Protection against unsupported answers
  • πŸ“ AI-generated quizzes
  • 🎚️ Easy / Medium / Hard difficulty
  • πŸ”’ 5 or 10 question quizzes
  • βœ… Semantic answer verification
  • πŸ“Š Weak-topic detection
  • πŸ’Ύ Persistent document storage
  • ♻️ Duplicate upload protection
  • πŸŒ™ Responsive light/dark interface
  • πŸ”’ Local-first architecture

πŸ”Ž Asking Questions From My Own Notes

One of the main ideas behind FriendMind is document-grounded question answering.

When a student asks a question, FriendMind doesn't simply send that question to an LLM.

It first searches the student's uploaded material for relevant information.

The simplified flow is:

Student Question
       ↓
Semantic Search
       ↓
Relevant Note Chunks
       ↓
Retrieved Context
       ↓
Gemma 3
       ↓
Grounded Answer
Enter fullscreen mode Exit fullscreen mode

This allows the assistant to answer questions based on the material the student is actually studying.


πŸ“ Turning Notes Into a Quiz

After studying, the student can generate a quiz from their uploaded material.

They can choose:

  • 5 or 10 questions
  • Easy, Medium, or Hard

But generating questions was only half of the problem.

I also wanted FriendMind to evaluate answers in a way that reflects understanding, rather than simply matching exact words.

That led to one of the most important parts of the project.


🧩 Semantic Answer Verification

Consider these two answers:

Expected answer:

Binary search has logarithmic time complexity.

Student answer:

Binary search runs in O(log n).

The wording is different, but the concept is the same.

A strict text comparison could fail to recognize that.

FriendMind therefore uses semantic similarity to evaluate natural-language answers.

The goal is to ask:

β€œDoes the student's answer communicate the expected concept?”

rather than:

β€œDid the student use exactly the same words?”

This makes the quiz evaluation more flexible for natural student responses.


🎯 Finding Weak Topics

FriendMind doesn't stop at marking an answer right or wrong.

It can use incorrect answers to identify areas where the student may need more revision.

The learning loop becomes:

Study
  ↓
Ask Questions
  ↓
Take Quiz
  ↓
Evaluate Understanding
  ↓
Identify Weak Topics
  ↓
Revise
  ↓
Try Again
Enter fullscreen mode Exit fullscreen mode

The idea is simple:

Don't just tell the student what they got wrong. Help them understand what to work on next.


πŸ”“ Why Open-Source AI Matters

Open-source AI isn't just a technology choice in this project.

It directly affects privacy and control.

FriendMind uses Gemma 3, an open-weight model, through Ollama for local inference.

The core architecture is:

Student PDF
    ↓
Local Processing
    ↓
Local Embeddings
    ↓
ChromaDB
    ↓
Semantic Retrieval
    ↓
Ollama
    ↓
Gemma 3
    ↓
Answer / Quiz
Enter fullscreen mode Exit fullscreen mode

A student's study material can contain lecture notes, assignments, personal notes, and exam preparation material.

I didn't want the core workflow to require sending all of that material to a closed cloud AI service.

With the local-first approach, the core AI workflow can run on the student's own computer.

It also gives the project more control over the model layer: the application isn't permanently tied to a single hosted AI API.

For a tool designed around personal study material, privacy, ownership, and control matter.


πŸ—οΈ How I Built It

The architecture is intentionally straightforward:

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   FriendMind UI β”‚
                    β”‚  HTML/CSS/JS    β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
                             β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚     FastAPI     β”‚
                    β”‚     app.py      β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β–Ό               β–Ό               β–Ό
       PDF Processing    RAG Engine     Quiz Engine
                             β”‚               β”‚
                             β–Ό               β–Ό
                    Sentence Transformers
                             β”‚
                             β–Ό
                         ChromaDB
                             β”‚
                             β–Ό
                          Ollama
                             β”‚
                             β–Ό
                          Gemma 3
Enter fullscreen mode Exit fullscreen mode

πŸ› οΈ Tech Stack

Backend: Python, FastAPI, Uvicorn

AI/ML: Sentence Transformers, RAG, Semantic Similarity

LLM: Ollama, Gemma 3

Vector Database: ChromaDB

Document Processing: pypdf

Frontend: HTML, CSS, Vanilla JavaScript

Development: Git, GitHub, VS Code, PowerShell


πŸŽ₯ Demo

FriendMind currently runs locally using Ollama and Gemma 3.

The demo shows the complete workflow:

Upload PDF β†’ Ask a question β†’ Generate quiz β†’ Answer β†’ Semantic evaluation β†’ Weak-topic detection

▢️ FriendMind Demo

https://www.youtube.com/watch?v=pd66-1qTa40

The screen recording demonstrates the actual working application rather than a mockup.


πŸ“Έ Screenshots

The repository contains screenshots of the working application in docs/screenshots/.

Upload Study Material

Show the FriendMind PDF upload interface here.

Ask a Question

Show a grounded question and response here.

Take a Quiz

Show the generated quiz here.

Review Results

Show semantic evaluation and weak-topic results here.


πŸ” Privacy by Design

FriendMind follows a local-first approach:

PDF
 ↓
Your Computer
 ↓
ChromaDB
 ↓
Local Embeddings
 ↓
Ollama / Gemma 3
Enter fullscreen mode Exit fullscreen mode

The core AI workflow can run locally without requiring study material to be sent to a cloud LLM provider.


πŸ§ͺ What I Learned

Building FriendMind taught me that building an AI application isn't just about connecting an LLM to a frontend.

The interesting problems appeared around the model:

  • How do I keep answers grounded in the user's documents?
  • How do I avoid unsupported answers?
  • How do I generate useful questions from context?
  • How do I evaluate answers when wording differs?
  • How do I turn quiz mistakes into useful revision feedback?

The semantic verification layer was particularly interesting.

It changed the problem from:

β€œAre these two strings similar?”

to:

β€œDo these two answers express the same concept?”

That distinction becomes especially important when AI is being used for learning.


πŸš€ What's Next?

FriendMind is still a starting point.

Some improvements I'd like to explore are:

  • Topic-wise quizzes
  • More document formats
  • Improved citations
  • Learning analytics
  • Personalized revision plans
  • Conversation history
  • Hybrid retrieval
  • Streaming responses

For this challenge, however, I wanted to keep the scope focused on solving one real problem.


❀️ Why I Built It

I didn't start with:

β€œWhat AI application can I build?”

I started with:

β€œWhat could actually make studying easier for someone I know?”

That changed the direction of the project.

Instead of building another general-purpose chatbot, I built something around a student's actual workflow:

their notes β†’ their questions β†’ their quiz β†’ their mistakes β†’ their revision.

That's what Build for a Friend meant to me.


πŸ’» Source Code

The complete source code is available on GitHub:

sanchalitorpe13/FriendMind

The repository contains the application source code, setup instructions, architecture, and screenshots.


πŸ› οΈ Built for a Friend. Built for Learning. Built with AI.

FriendMind is my submission for the Hacktoberfest 2026 DEV Weekend Challenge β€” Build for a Friend.

Thanks for reading. πŸ’™

Challenge

Hacktoberfest 2026 DEV Weekend Challenge β€” Build for a Friend

Partner Category

Best Use of Gemma

FriendMind uses Gemma 3 as its local AI model through Ollama.

devchallenge #weekendchallenge #hf26challenge #gemma

Top comments (0)