All projects

112025AI / Backend

Micro Coach

A decision-support chatbot that turns an everyday dilemma into short, practical guidance through a React chat interface.

Period
Sep 2025
Context
Buildables

The problem

Left alone, a chat model answers a small question at length. The constraint work is in the system prompt: a role definition, explicit greeting and closing rules, silent step-by-step reasoning and few-shot examples, together holding the model to brief, actionable replies.

What I built

  1. Developed a Flask backend exposing a POST /chat endpoint accepting a message plus prior history, returning the reply alongside the raw provider response.
  2. Engineered a structured system prompt combining role definition, greeting and closing rules, silent step-by-step reasoning and few-shot examples.
  3. Integrated the Groq API using Llama 3.1 8B Instant with tuned temperature and token limits, plus a mock-response fallback so the frontend stays functional without an API key.
  4. Implemented multi-turn context by replaying client-held history into each request, with defensive response parsing, structured logging, CORS configuration and error propagation to the UI.
  5. Built the React chat UI with loading and error states, auto-scroll to the latest message and keyboard send handling.

Stack

PythonFlaskFlask-CORSpython-dotenvRequestsGroq API (Llama 3.1 8B Instant)React 19Node.js

Skills applied

  • LLM integration
  • Prompt engineering (few-shot and role prompting)
  • REST API design
  • Conversational state handling
  • Error handling and logging
  • Environment-based configuration