LLM Expert for Educational Module Business Logic

Job ID: 39693635

Budget: £250 – £750 GBP

AI-Based MCQ Generator & Performance Review Module – Detailed Requirements
Overview:
The system will utilize LLM-based agentic AI built using frameworks like LangChain, LangGraph, OpenAI APIs, or other supported libraries to perform the following functions:

Generate subject-specific (Math, English, Science, Verbal, Non-Verbal) MCQ questions with optional diagrams (e.g., pie charts, graphs).

Support SVG-based question images for enhanced clarity (Or similar).

Provide AI-powered exam performance reviews and recommendations.

Work in a microservices-based architecture with modular APIs.

Track and enforce usage limits on messages and token consumption based on subscription tier.

Language: Python with FaceAPI

Database : mysql or Postgres

Prompt Example :

Prompts
word_generation_prompt = ChatPromptTemplate.from_messages([
("system", """
You are an expert UK 11 Plus English teacher specializing in cloze questions for 10-11-year-olds.
Generate a single target word to be used as the correct answer in a cloze question. The word must be new, not in question history or failed words, and suitable for a cloze sentence.

Criteria:

Age-appropriate for medium difficulty (e.g., 'clever', 'swift', 'vivid', not 'inventive' or 'astonishing').

Single word (adjective, noun, or verb) that fits naturally in a sentence.

Avoid failed words: failed_words_str.

Adhere to refinement feedback: refinement_feedback_section.

Return a JSON object with the key "word" and the generated word as the value.
"""),
("human", """
Generate one target word.
Question History: question_history_str
Difficulty Level: difficulty_level
Failed Words: failed_words_str
Refinement Feedback: refinement_feedback_section
""")
])

LangGraph example :

graph.set_entry_point("generate_word")
graph.add_edge("generate_word", "validate_word")
graph.add_conditional_edges("validate_word", should_refine_word, "generate_word": "generate_word", "generate_sentence": "generate_sentence", "finalize": "finalize")
graph.add_edge("generate_sentence", "validate_sentence")
graph.add_conditional_edges("validate_sentence", should_refine_sentence, "generate_sentence": "generate_sentence", "generate_options": "generate_options", "finalize": "finalize")
graph.add_edge("generate_options", "validate_options")
graph.add_conditional_edges("validate_options", should_refine_options, "generate_options": "generate_options", "finalize": "finalize")
graph.add_conditional_edges("finalize", lambda state: state.get("next", END), "generate_word": "generate_word", END: END)

Module 1: AI-Based MCQ Generator
Functionality:

Accepts input via API:

Course Name (e.g., Math, Science)

Topic Name (e.g., Pie Charts, Fractions)

Number of Questions

Difficulty Level (Easy, Medium, Hard)

Stream: 6+, 7+, A Level etc to know the age and preference of the questions set

Returns:

Validated MCQ questions in JSON format

JSON includes:

Question Text

Options (A/B/C/D)

Correct Answer

Explanation

Diagram Reference (if required), preferably as SVG

Generated data will be used to populate a relational database.

Reuse existing LangGraph pipelines (provided) where applicable.
Diagram Support:

Generate visual components (like pie charts, bar graphs) using:

SVG format (Or similar)

Integration with dynamic graph/image generation libraries if needed

Module 2: Performance Review Chat with LLM
Functionality:

User initiates a chat after taking an exam.

The LLM accesses the exam report from the database (marks, incorrect answers, patterns).

AI analyzes:

Accuracy trends

Time efficiency (if data available)

Topic weaknesses

The model returns:

Natural language insights

Study suggestions

Encouragement and alerts

Module 3: Answer Sheet Analysis + AI Review
Functionality:

User uploads a written/digital answer sheet.

Existing module scores and stores the report.

LLM simultaneously:

Reviews the report

Generates a natural language performance review

Stores review in the database and sends summary to user

Module 4: Quota Enforcement (Token/Message Limits)
Purpose: Prevent overuse of AI features for users on limited plans.
Behavior:

Each API call checks the user's remaining quota:

Token Limit: Total number of LLM tokens used this month

Message Limit: Total number of AI queries/messages sent

Quota logic:

Free Trial (Normal Users):

Max 50 questions generated per month

Max 10 messages to AI per day

Free Trial (Teachers):

Same as above (plus other teacher-specific limits)

If quota is exceeded:

LLM API will not process the request

Return structured JSON error:
"error": "Quota exceeded",
"remainingTokens": 0,
"remainingMessages": 0,
"suggestion": "Upgrade plan to continue using AI features."

Daily quota counters reset at midnight (configurable)

Admin can override/adjust quotas via admin panel

Module 5: Pull question from existing exam paper
Module 6: Generate question from defined content/website link

System Design Notes:

Each module should be:

Dockerized microservice

Accessible via secure REST API

Scalable for concurrency

API Gateway or Auth Middleware must:

Check quotas

Validate API keys/session tokens

Logging for:

Token usage per user

Errors

Generated question quality (validation scores)

Out of scope : UI Design
Scope : Backend / Business Logic and Integration with the existing system
Note: we have designed some of Langraph to generate questions and you can refer those for guidance if required