Tired of Manual Feedback?
Here’s How I Built an AI Agent that writes It for You
(Without Breaking the Bank!)
This article outlines how I leveraged a lightweight, open-source AI model to transform a manual process of reviewing student feedback into an efficient automated system.
I will walk through identifying the problem, designing an AI workflow, crafting effective prompts, implementing the solution in Python, and generating professional reports, all while avoiding expensive cloud-based services.
This article focuses on practical implementation rather than theoretical model development.
The Problem: A Time-consuming weekly ritual
Every week, teachers spent hours manually reviewing student feedback and crafting personalised action plans.
The process is:
Time-Consuming
Hours spent copying and pasting responses, then writing custom recommendations for each student.
Repetitive
Most responses followed predictable patterns, making the process monotonous yet necessary.
Cost Concerns
Cloud-based AI solutions would solve the problem but introduce ongoing expenses and potential privacy issues.
I will present a solution that is Fast, Efficient, and Affordable, without requiring expensive subscriptions or sending student data to third-party servers.
The AI Solution: Small but Mighty Model
Instead of using a massive AI model such as GPT-4, I turned to a lightweight AI model with around 7 billion parameters, optimised for efficient local inference, and optimised for instruction-following.

This model is:
· Compact yet powerful. It runs efficiently on local hardware.
· Fine-tuned for structured text. It can follow clear prompts and generate useful responses.
· Open-source and cost-effective. No API fees or cloud dependency are needed.
It is important to note that:
-Small, open-source models running locally keep sensitive information on my own hardware, eliminating data transfer risks.
-Using student personal data with cloud-based AI services as OpenAI can violate privacy regulations (GDPR, FERPA) unless explicit consent is obtained and proper safeguards are in place. It also raises serious ethical concerns around data ownership, informed consent, and the risk of data exposure.
-One-time download of a smaller model eliminates ongoing subscription costs while still providing sufficient capabilities for structured tasks.
The key was to design a workflow that played to the strengths of this smaller model while working around its limitations.
Running the Model efficiently with low VRAM
To make this project accessible on machines with limited GPU memory, I optimized the way the AI model is loaded. Instead of using the full 16-bit or 32-bit model, I leveraged 4-bit quantization (QLoRA), which significantly reduces memory usage with minimal impact on output quality.
Additionally, I enabled Flash Attention 2, a state-of-the-art attention mechanism that speeds up inference and further reduces memory overhead. This allows the LLM AI model to run smoothly even on mid-range consumer GPUs.
I accessed the model directly from Hugging Face using the transformers library and integrate into my Python environment.
Step 1: Designing the AI Workflow
Before implementing any code, I needed to clearly define what I wanted the AI to accomplish. The workflow had to be systematic and produce consistent results.
Analyse student responses
Process self-assessment answers from structured questions
Generate tailored action plans
Create personalised recommendations based on response patterns
Format structured output
Ensure concise, numbered recommendations with controlled length
Below is an example of the raw student input the system would process:
The Figure below shows an Automated feedback workflow. Student responses are analyzed to generate personalized prompts, which are processed by a local AI model to produce structured action steps, formatted into professional reports.
Example input dataset from Microsoft Forms
To automate feedback effectively, I exported student self-assessment responses from Microsoft Forms as a structured CSV file. This dataset formed the foundation of my AI-powered feedback system. Below is a representative sample of the exported data after cleaning and transformation:
Each row represents an individual student response to a specific self-assessment statement. The Response column captures their level of agreement with each statement, providing valuable insight into their perceived strengths and areas for growth. My AI system processes this structured data to generate personalized recommendations in the Action column, which was initially empty (marked as "N/A"). This automated approach scales efficiently across hundreds of statements and students, eliminating the need for manual feedback creation.
Step 2: Crafting the Perfect AI Prompt
The secret to getting precise, structured responses from even a small AI model lies in Prompt Engineering. Rather than using vague instructions, I created a detailed template that guided the model to produce exactly the format I needed. Initially, some prompts produced verbose or inconsistent results. It took several iterations of adjusting the prompt structure.
Structured Prompt:
prompt = ( f"Dear student, based on your response, here is a guidance for you:\n\n" f"Statement: {statement}\n" f"Your Response: {response.capitalize()}\n" f"Provide exactly {max_actions} action(s),clearly numbered (1., 2., 3.)." f" Do NOT provide more than {max_actions} actions." )
This structured approach ensured concise, actionable, and consistently formatted recommendations every time.
Step 3: Implementing the AI Model in Python
With my prompt strategy in place, I connected it to the AI model using Python. The implementation allowed for dynamic adjustment of action items based on the severity of student needs. I used Regex patterns to consistently extract clean, actionable advice.
# Define action limits based on student responses action_limits = {"agree": 1, "disagree": 2, "completely disagree": 3} # Process each student's response for idx, row in student_data.iterrows(): statement = row["Statement"] response = row["Response"].strip().lower() # Define max actions based on response type max_actions = action_limits.get(response, 2) # Default to 2 if unknown full_response = generate_text(prompt) # Extract only the required number of actions using regex actions = re.findall(r"\d+.\s(.*?)(?=\d+.|$)", full_response, re.DOTALL) ai_action = "\n".join(actions[:max_actions]) # Keep only the required actions # Store the AI-generated action in the dataset student_data.at[idx, "Action"] = ai_action
The code intelligently scales guidance based on need. Students who "completely disagree" with positive statements receive more detailed action plans than those who "agree," creating an appropriate level of support.
Step 4: Generating Professional PDF Reports
After automating the feedback generation, I wanted to create professional-looking reports that would be valuable to students. I implemented a PDF generation system using the ReportLab library to create well-formatted documents with:
  • Clean, structured tables displaying student responses
  • Numbered action items with consistent formatting
  • Color-coding to highlight different response categories
  • School branding and professional layout
This final step transformed raw AI outputs into polished, student-ready documents that maintained a consistent professional appearance while delivering personalised guidance. The automated system now handled everything from processing responses to producing the final deliverable.
Model Comparison for Student Feedback Automation
After testing multiple 7B parameter models, I selected Mistral-7B-Instruct-v0.3 for its balance of performance, response quality, and suitability for educational feedback.
All models performed well when quantized to 4-bit precision, making them suitable for deployment on consumer-grade hardware with limited VRAM. The Mistral base provided an excellent foundation across all variants.
Results and Lessons Learned
Time Savings
What previously took hours each week now completes in minutes, freeing up valuable time for more meaningful educational activities and one-on-one student interactions.
Consistent Quality
The AI-generated feedback maintains a high standard of quality and personalisation that students find valuable, without the inconsistencies that can occur with manual work.
Cost Effectiveness
By using a small, local model instead of cloud-based services, I have eliminated ongoing costs while maintaining data privacy and avoiding dependency on external providers.
Key Takeaways
  • Prompt engineering is crucial. The way you instruct AI dramatically affects results.
  • Small models can be powerful enough. Not every task requires the latest, largest AI models.
  • Fine-tuning output requires iteration. Regex and formatting adjustments were essential for polishing the final product.
  • Local AI processing offers privacy advantages. Student data never leaves your system.
This approach demonstrates that AI can enhance educational practices without requiring significant technical expertise or financial investment.
Why to use this approach?
My method:
  • Automatically reads student responses from a dataset
  • Generates custom action plans dynamically based on severity
  • Uses code logic to tailor response length
  • Outputs structured, professional PDF reports
Result: Once set up, it runs end-to-end with zero manual work, even for dozens or hundreds of students.
Consistency & Scalability
  • Enforces exact formatting and number of actions via Python and regex.
  • Scales to handle many students without losing structure or accuracy.
  • Produces predictable, repeatable results, something manual prompting (in LM Studio) can’t guarantee.
Curious about the exact model setup or looking to implement a similar AI solution?
If you are interested in learning more about the model setup or implementing a similar system, I'm happy to share insights. Feel free to get in touch!
Disclaimer:
The effectiveness of this approach may vary depending on task complexity, model configuration, and available hardware resources. This case study reflects one practical implementation optimized for a specific educational workflow. This approach is ideal for small to medium-scale tasks where privacy and flexibility matter more.