Skip to content
All projects

Project

AI Coach System

Django-based AI study coach using Google Gemini API (gemini-2.0-flash) via google-genai SDK. Generates personalized, dynamic study plans with modular AI service architecture, prompt engineering, and user profile management.

  • Django
  • Google Gemini API
  • gemini-2.0-flash
  • google-genai SDK
  • Python
  • PostgreSQL
  • HTML/CSS
AI Coach System cover image

AI Coach System is a fully functional, AI-powered study coaching web application built on Django — designed to help students plan, structure, and optimize their study sessions through dynamic, personalized guidance generated by a real AI model. The project goes beyond a simple chatbot wrapper: it is a complete, production-minded web application with authentication, user profiling, a dedicated AI service layer, and a prompt engineering pipeline tuned for educational coaching quality.

Core Technology Stack

The application is built on Django (Python's most mature and production-battle-tested web framework), chosen for its built-in authentication system, ORM, and admin interface — all of which dramatically reduce time-to-feature for a user-facing web product. The database is PostgreSQL, storing user profiles, session data, and coaching history in a relational schema designed to support personalization at scale.

AI Integration — Google Gemini API with gemini-2.0-flash

The AI core of the system integrates Google's Gemini API via the official google-genai SDK — specifically using the gemini-2.0-flash model. The choice of gemini-2.0-flash was deliberate: it provides a balance of response speed, context window size, and reasoning quality that makes it ideal for real-time educational coaching interactions. Unlike heavier models that introduce latency incompatible with conversational UX, gemini-2.0-flash delivers coherent, contextually rich coaching responses within an acceptable response window for a web UI.

The integration is not a simple prompt-to-response chain. User inputs — study goals, available daily hours, subjects, difficulty preferences, deadlines — are preprocessed and structured into carefully engineered prompts before being sent to the Gemini API. The prompt engineering layer encodes coaching context, output format requirements, and personalization signals to consistently push the model toward actionable, structured study plans rather than generic advice.

Modular AI Service Architecture

One of the key engineering decisions in this project was isolating all AI logic into a dedicated service layer rather than embedding model calls directly in views or controllers. The AICoachService module encapsulates:

  • Prompt construction and engineering
  • Gemini API client management and request handling
  • Response parsing and post-processing
  • Error handling and fallback behavior

This separation means the underlying AI model can be swapped (Gemini → GPT → Claude) without touching a single line of application or view logic — a critical requirement for a system expected to evolve alongside the rapidly changing AI landscape.

Authentication & User Profile Management

The system includes full user authentication (registration, login, logout, session management) built on Django's native auth framework. Each user has a profile that stores personal data relevant to AI coaching: declared study goals, daily available time, subject preferences, and historical coaching interactions. This data is used to make AI recommendations increasingly personalized over time — the longer a user engages with the system, the more contextually accurate the coaching becomes.

Prompt Engineering & Error Handling

Significant development effort went into prompt engineering refinement: structuring the system prompt, user context injection, output format specification, and negative constraints to consistently improve the quality and consistency of the AI's coaching recommendations. Alongside this, comprehensive error handling was implemented at both the Django view layer and the AI service layer to ensure that API failures, malformed responses, or edge-case inputs never result in unhandled exceptions — the system degrades gracefully and always returns a useful response to the user.

Goals & Purpose

The goal of this project is to build a genuinely intelligent, scalable, and real-world-ready AI study assistant — not a demo, but a product that a student could use daily and see measurable value from. The system should function as a knowledgeable study partner: understanding what the student wants to achieve, how much time they have, and generating structured, realistic plans that adapt to their needs.

Results & Outcomes

The system successfully generates dynamic, personalized study plans via gemini-2.0-flash, with the modular service architecture allowing rapid iteration on prompt quality and coaching logic. User authentication and profile management are fully functional, providing the data foundation for personalization.

Roadmap

Future development focuses on deeper personalization through session history analysis and adaptive plan generation — the AI should not just respond to the current session but evolve its recommendations based on a student's tracked progress over time. Additional planned features include integration of multiple AI model options (allowing users to select their preferred model), data visualization dashboards for study progress tracking, and mobile-responsive UI enhancements to support on-the-go use. The long-term vision is a fully autonomous, continuously adapting AI study companion that operates at the level of a professional academic coach.