跳到正文
原文
Google AI:DEV 作者专属(RSS)· chanveer singh·· 5 小时前AI 评分23

StudyMate:基于 Ollama Cloud 与 gpt-oss:120b 的 AI 学习伙伴

Studymat

AI 导读

StudyMate 是一款基于 FastAPI、React + Vite 与 Ollama Cloud 构建的 AI 学习伙伴,默认调用开源权重模型 gpt-oss:120b,在回答后根据问题类型(概念、计算、复习)自适应推荐下一步学习动作。

正文

This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend

StudyMate: An AI Study Partner That Tells You What to Do Next

What I Built

I built StudyMate, an AI study partner for a friend who is a real student. She has plenty of study material, but when she gets stuck on a topic she often doesn't know what to do next: re-read, watch a video, practice, or revise.

Most AI tools work like this: Ask → Get answer. Then the student is on their own again.

StudyMate works like this:

Ask → Understand → Practice → Revise → Improve

It looks at what the student asked and offers the right next actions.

  • Concept question ("Explain electromagnetic induction"): Explain simply, Use an analogy, Real-world example, Quiz me.
  • Numerical ("Calculate the induced emf…"): Give me a hint, Show formula, Solve step-by-step, Similar problem.
  • Revision: Quick revision, Flashcards, Common mistakes, Quiz, Exam practice.

The options are adaptive, not fixed. The same app gives different next steps depending on what the student is doing.


Demo

Video Demo

Screenshot

StudyMate's chat interface. After each answer, it offers adaptive next actions based on what the student asked.

Code

GitHub logo chanveersinghdev / Studymate

AI study assistant that explains topics, adapts to your goals and level (Beginner to Advanced), and remembers context so you don't repeat yourself. Built with FastAPI, Ollama Cloud, and GPT-OSS. Privacy-first: it only uses what you provide or allow it to remember. Get quizzes, follow-ups, and clear answers in your style.

StudyMate — Ollama Cloud Edition

Personalized AI study partner with contextual learning actions.

AI provider

This version uses Ollama Cloud by default. The default configurable model is gpt-oss:120b.

Setup

1. Backend

cd backend
python -m venv .venv
.venv\\Scripts\\activate
pip install -r requirements.txt
copy .env.example .env

Open backend/.env and add your Ollama Cloud API key:

AI_PROVIDER=ollama_cloud
OLLAMA_HOST=https://ollama.com
OLLAMA_API_KEY=YOUR_KEY_HERE
OLLAMA_MODEL=gpt-oss:120b

Then:

uvicorn app.main:app --reload --port 8000

Check:

http://127.0.0.1:8000/api/health

2. Frontend

In a second terminal:

cd frontend
npm install
npm run dev

Open the Vite URL shown in the terminal.

Included

  • Rounded Claude-inspired chat UI
  • Hover and message animations
  • Dark/light mode
  • Responsive layout
  • Context-aware study actions
  • Learning-phase detection
  • Ollama Cloud API integration
  • Configurable model
  • Server-side API key handling
  • Fallback UI when no key is configured

Security

Never commit backend/.env. It contains your private API key.

The React frontend does…

The repo has the React + Vite frontend, the FastAPI backend, and a .env.example with setup instructions.

📧 Contact: chanveersinghdev@gmail.com


How I Built It

        Student (question / doubt)
                  │
                  ▼
         React + Vite (UI)
                  │
                  ▼
           FastAPI backend
                  │
                  ▼
      Context / prompt engine
                  │
                  ▼
   Ollama Cloud ─► gpt-oss:120b
                  │
                  ▼
     Answer + adaptive actions

Tech stack

Part Tool
Frontend React + Vite
Backend FastAPI
AI gpt-oss:120b (open-weight) via Ollama Cloud
Storage SQL database for user data
Built with Claude Code

Learning phases

StudyMate is designed around how people actually learn:

Discover → Understand → Practice → Revise → Exam prep

The prompt engine detects the question type and phase, then chooses which actions to show.

Why open-weight AI is the core

The AI is an open-weight model (gpt-oss:120b) running through Ollama Cloud, not a closed proprietary API. The learning logic is separated from the provider and model:

StudyMate learning logic → AI provider → Model

The model is set in .env, so I can switch models or providers, or move to local inference later, without rewriting the product. That means less vendor lock-in and more control over the AI layer.

Security

The Ollama API key stays on the FastAPI backend (.env). The browser never sees it, and only .env.example is committed to GitHub.

Honest about PYQs

StudyMate never calls AI-generated questions "PYQs." They are labelled Practice question. Real previous-year questions will come from a verified database (year + exam + subject + chapter), so students can trust what they study.

UI

I designed the interface like a real product: dark theme, rounded chat and composer, contextual action buttons, hover animations, chat history, and a responsive layout.


Challenges

  • Adaptive actions: making the options change correctly by question type (concept vs numerical vs revision) instead of showing the same buttons every time.
  • Keeping the key safe: routing every AI call through the backend so the Ollama key never reaches the browser.
  • Academic trust: separating AI-generated practice questions from real PYQs so the app never misleads a student.
  • Model independence: keeping the learning logic separate from the model so changing models doesn't mean a rewrite.

What's Next

  • PDF and notes upload with RAG, so students can ask questions about their own material
  • Verified PYQ database and NCERT integration, with chapter-wise and exam filters
  • Quiz engine, flashcards, progress tracking, and weak-topic detection
  • Web sources and book/resource recommendations
  • Streaming responses, image-based question solving, and a personalized learning profile

Final Thoughts

The biggest lesson was that a good study tool shouldn't stop at the answer. Knowing what to do next is what turns an answer into learning. StudyMate is the foundation for that, and I want to keep building it with my friend's feedback.

来源:Google AI:DEV 作者专属(RSS) · dev.to