AI Features Development
YeboLearn's AI features are our competitive differentiator - zero African education platforms have comparable AI capabilities. This document tracks active AI development, integration work, and optimization efforts.
Last Updated: November 22, 2025
AI Competitive Advantage
Market Position
YeboLearn AI Features: 15+ and growing African Competitors with AI: 0
Our AI Capabilities:
- ✅ AI Quiz Generation (Live)
- ✅ Personalized Learning Paths (Live)
- ✅ Smart Content Recommendations (Live)
- ✅ Automated Difficulty Adjustment (Live)
- 🚧 AI Essay Grading (Beta - Sprint 26)
- 🚧 Real-time Writing Feedback (Beta - Sprint 26)
- ⏳ AI Study Planner (Sprint 27)
- ⏳ Conversational Tutor (Sprint 28-29)
- ⏳ Audio Lecture Transcription (Sprint 30)
- ⏳ Visual Problem Solver (Q2 2026)
Why This Matters:
- First-mover advantage in African market
- Premium feature justifies pricing ($5/month)
- Drives student outcomes (measurable improvement)
- Teacher time savings (5+ hours/week per teacher)
- Hard to replicate (requires AI expertise + infrastructure)
Active AI Development
1. AI Essay Grading (Sprint 26 - In Progress)
Status: 65% Complete, On Track for Nov 29 Launch
Business Value:
- Save teachers 5+ hours/week on grading
- Provide instant feedback to students
- Enable more writing practice (no bottleneck)
- Differentiated feature (no competitor has this)
Technical Approach:
Components:
Student Submission Flow
├─ Essay text input (markdown supported)
├─ File upload (.docx, .pdf, .txt)
├─ Submit to AI grading queue
└─ Real-time progress indicator
AI Grading Engine
├─ Gemini 1.5 Pro model
├─ Structured prompt with rubric
├─ JSON response parsing
├─ Score calculation (0-100)
└─ Feedback generation
Teacher Review Dashboard
├─ View all submissions
├─ AI feedback preview
├─ Manual grade override
├─ Bulk approval/rejection
└─ Student feedback deliveryGemini Integration:
// AI Essay Grading Implementation
async function gradeEssay(essay: Essay): Promise<GradingResult> {
const prompt = buildGradingPrompt(essay);
const response = await geminiClient.generateContent({
model: 'gemini-1.5-pro',
contents: [{ role: 'user', parts: [{ text: prompt }] }],
generationConfig: {
temperature: 0.2, // Low temperature for consistency
topP: 0.8,
topK: 40,
maxOutputTokens: 2048,
responseMimeType: 'application/json',
},
});
return parseGradingResponse(response);
}
function buildGradingPrompt(essay: Essay): string {
return `
You are an expert educator grading a student essay. Analyze the essay and provide structured feedback.
Essay Topic: ${essay.topic}
Grade Level: ${essay.gradeLevel}
Word Count: ${essay.wordCount}
Grading Rubric:
- Thesis and Argument (30 points)
- Evidence and Support (25 points)
- Organization and Structure (20 points)
- Grammar and Mechanics (15 points)
- Creativity and Insight (10 points)
Essay Text:
${essay.content}
Provide your assessment in the following JSON format:
{
"overallScore": 0-100,
"rubricScores": {
"thesis": 0-30,
"evidence": 0-25,
"organization": 0-20,
"grammar": 0-15,
"creativity": 0-10
},
"strengths": ["strength 1", "strength 2", "strength 3"],
"improvements": ["area 1", "area 2", "area 3"],
"specificFeedback": "Detailed paragraph of feedback",
"suggestedRevisions": [
{
"section": "Introduction",
"issue": "Weak thesis statement",
"suggestion": "Consider making your argument more specific..."
}
]
}
`;
}Performance Characteristics:
Current Metrics (Nov 22):
- Average response time: 45 seconds
- p95 response time: 68 seconds
- Success rate: 98.5%
- Cost per grading: $0.12
Targets:
- Average response time: <30 seconds ⚠️
- p95 response time: <45 seconds ⚠️
- Success rate: >99%
- Cost per grading: <$0.10
Status: Performance optimization needed (Sprint 27)Optimization Strategies (Planned Sprint 27):
Prompt Optimization
- Reduce prompt length (currently 2000 tokens)
- More concise rubric definitions
- Remove redundant instructions
Caching Strategy
- Cache rubric definitions (reused across essays)
- Cache common feedback patterns
- Estimated 30% speed improvement
Parallel Processing
- Split long essays into sections
- Grade sections in parallel
- Combine results
- Estimated 40% speed improvement for >2000 word essays
Model Selection
- Test Gemini 1.5 Flash (faster, cheaper)
- Compare quality vs Gemini 1.5 Pro
- A/B test with teachers
Rate Limiting:
// Rate limiting configuration
const rateLimits = {
perStudent: {
submissions: 5,
window: '1 hour',
},
perTeacher: {
submissions: 50,
window: '1 hour',
},
global: {
concurrent: 10, // Max parallel Gemini API calls
requestsPerMinute: 60, // Gemini quota
},
};
// Queue management
const gradingQueue = new Queue('essay-grading', {
redis: redisClient,
limiter: {
max: 60, // 60 requests
duration: 60000, // per minute
},
});Beta Launch Plan (Nov 29):
Phase 1: Limited Beta (Week 1)
- 5 teachers, 100 students
- Collect feedback on accuracy
- Monitor performance and costs
- Iterate on prompts
Phase 2: Expanded Beta (Week 2-3)
- 20 teachers, 500 students
- A/B test optimizations
- Measure teacher time savings
- Refine UI based on feedback
Phase 3: General Release (Week 4+)
- All teachers and students
- Full monitoring in place
- Performance optimized
- Cost model validated2. AI Study Planner (Sprint 27 - Starting Dec 2)
Status: Design Complete, Ready for Development
Business Value:
- Personalized study schedules
- Adaptive to student progress
- Maximize learning efficiency
- Reduce student overwhelm
Technical Approach:
AI Model: Gemini 1.5 Pro Input Data:
- Student's course schedule
- Past quiz performance
- Learning pace (words/min, time per question)
- Upcoming exams and deadlines
- Self-reported study time availability
Output:
{
"weeklyPlan": [
{
"day": "Monday",
"sessions": [
{
"time": "6:00 PM - 7:00 PM",
"subject": "Mathematics",
"topic": "Quadratic Equations",
"activities": [
"Review lesson notes (15 min)",
"Practice problems 1-20 (30 min)",
"Quiz yourself (15 min)"
],
"rationale": "Focus on weak area identified in last quiz"
}
]
}
],
"priorityTopics": ["Quadratic Equations", "Cell Biology"],
"estimatedExamReadiness": 75,
"adjustments": "Consider adding 30 min on Wednesday for Math practice"
}Complexity: 8 story points Sprint: 27 (Dec 2-13) Owner: John (Backend), Sarah (UI)
3. Conversational AI Tutor (Sprint 28-29 - Q1 2026)
Status: Proof-of-Concept Complete, Productionizing in Q1
Business Value:
- 24/7 student support
- Instant answers to questions
- Socratic teaching method
- Reduces teacher support burden
Technical Approach:
Model: Gemini 1.5 Pro with function calling Features:
- Natural language question answering
- Step-by-step problem solving
- Concept explanations with examples
- Links to relevant course materials
- Multi-turn conversations with context
Sample Interaction:
Student: "I don't understand how photosynthesis works"
AI Tutor: "I'd be happy to help you understand photosynthesis!
Let me break it down step by step.
First, can you tell me what you already know about how plants
get energy? This will help me explain it at the right level."
Student: "I know plants need sunlight and water but not sure how
they turn that into energy"
AI Tutor: "Great starting point! You're right that plants need
sunlight and water. Here's the key process:
1. Light Absorption: Plants capture sunlight using chlorophyll
(the green pigment in leaves)
2. Water Splitting: The sunlight's energy splits water (H₂O)
into hydrogen and oxygen
3. Sugar Production: Plants combine the hydrogen with carbon
dioxide (CO₂) from air to make glucose (sugar) - their food!
4. Oxygen Release: The leftover oxygen is released into the air
(which we breathe!)
The equation: 6CO₂ + 6H₂O + Light → C₆H₁₂O₆ + 6O₂
Does this make sense so far? Would you like me to explain any
step in more detail?"
Student: "Why do plants need chlorophyll?"
AI Tutor: "Excellent question! Chlorophyll is like a solar panel
for plants. [continues explanation...]"Guardrails:
- Content filtering (no inappropriate responses)
- Domain limiting (education topics only)
- Citation of course materials
- Escalation to human teacher for complex issues
- Usage limits (prevent abuse)
Complexity: 21 story points (split into 2 sprints) Sprint: 28-29 (Q1 2026) Investment: High (flagship feature)
Google Gemini Integration
API Configuration
Model Selection:
const models = {
essayGrading: 'gemini-1.5-pro', // High quality needed
quizGeneration: 'gemini-1.5-flash', // Speed over quality
studyPlanner: 'gemini-1.5-pro', // Complex reasoning
tutor: 'gemini-1.5-pro', // Conversational quality
contentSummary: 'gemini-1.5-flash', // Simple task
};API Quotas:
Current Quotas:
- Requests per minute: 60
- Tokens per minute: 1,000,000
- Requests per day: 50,000
Current Usage (Nov 22):
- Requests per minute: ~25 (peak)
- Tokens per minute: ~450,000 (peak)
- Requests per day: ~12,000
Headroom: 50% capacity remainingCost Tracking:
November 2025 Costs (MTD):
- Input tokens: 125M tokens × $0.00035 = $43.75
- Output tokens: 48M tokens × $0.00105 = $50.40
- Total: $94.15
Projected Monthly: ~$200
Cost per student: ~$0.085/month
Revenue per student: $5/month
Margin: 98.3% 💰Integration Architecture
YeboLearn Platform
├─ API Gateway
│ └─ Rate limiting & authentication
├─ AI Service Layer
│ ├─ Request queue (Redis)
│ ├─ Gemini API client
│ ├─ Response caching
│ └─ Error handling & retry
├─ Feature Services
│ ├─ Essay grading service
│ ├─ Quiz generation service
│ ├─ Study planner service
│ └─ Tutor service
└─ Database
├─ AI requests log
├─ Cached responses
└─ User interactionsError Handling:
async function callGeminiWithRetry<T>(
request: GeminiRequest
): Promise<T> {
const maxRetries = 3;
const backoff = [1000, 3000, 10000]; // Exponential backoff
for (let i = 0; i < maxRetries; i++) {
try {
return await geminiClient.generateContent(request);
} catch (error) {
if (error.status === 429) {
// Rate limit - wait and retry
await sleep(backoff[i]);
continue;
}
if (error.status >= 500) {
// Server error - retry
await sleep(backoff[i]);
continue;
}
// Client error - don't retry
throw error;
}
}
throw new Error('Max retries exceeded');
}Safety and Moderation
Content Filtering:
const safetySettings = {
harmCategory: 'HARM_CATEGORY_HARASSMENT',
threshold: 'BLOCK_MEDIUM_AND_ABOVE',
};
// Apply to all Gemini requests
const config = {
safetySettings: [
{ ...safetySettings, harmCategory: 'HARM_CATEGORY_HARASSMENT' },
{ ...safetySettings, harmCategory: 'HARM_CATEGORY_HATE_SPEECH' },
{ ...safetySettings, harmCategory: 'HARM_CATEGORY_SEXUALLY_EXPLICIT' },
{ ...safetySettings, harmCategory: 'HARM_CATEGORY_DANGEROUS_CONTENT' },
],
};Response Validation:
function validateAIResponse(response: any): boolean {
// Check for harmful content
if (containsInappropriateContent(response)) {
logSecurityIncident('inappropriate_ai_response', response);
return false;
}
// Verify educational relevance
if (!isEducationalContent(response)) {
logQualityIssue('off_topic_response', response);
return false;
}
return true;
}AI Roadmap (Next 3 Months)
December 2025
Sprint 27 (Dec 2-13):
- ✓ AI Study Planner (8 pts)
- ✓ Essay Grading Performance Optimization (5 pts)
- ✓ AI Response Caching (3 pts)
Sprint 28 (Dec 16-27):
- ✓ Conversational Tutor (Part 1) (13 pts)
- ✓ Audio Transcription Spike (2 pts)
January 2026
Sprint 29 (Dec 30 - Jan 10):
- ✓ Conversational Tutor (Part 2) (8 pts)
- ✓ Multi-language AI Support (Sesotho) (5 pts)
Sprint 30 (Jan 13-24):
- ✓ Audio Lecture Transcription (8 pts)
- ✓ AI-Generated Practice Exams (5 pts)
February 2026
Sprint 31 (Jan 27 - Feb 7):
- ✓ Visual Problem Solver (Math) (13 pts)
- ✓ AI Content Recommendations v2 (5 pts)
Sprint 32 (Feb 10-21):
- ✓ Adaptive Learning Paths (8 pts)
- ✓ AI Progress Insights (5 pts)
Performance Optimization
Current Challenges
1. Response Time
Problem: AI features average 30-45s response time
Impact: User frustration, perceived slowness
Target: <10s for all features
Solutions:
- Caching frequent requests
- Optimizing prompts (fewer tokens)
- Parallel processing
- Model selection (Flash vs Pro)2. Cost Management
Current: $200/month
Projected (1000 users): $850/month
Projected (10,000 users): $8,500/month
Optimization Strategies:
- Aggressive caching (80% cache hit rate target)
- Prompt compression
- Use Flash model where quality allows
- Batch processing for non-real-time features
Target: <$0.10 per user per month3. Quota Management
Current: 60 requests/minute limit
Peak usage: 25 requests/minute
Headroom: Good
But at 10× users (future):
Peak: 250 requests/minute
Quota: Need increase to 300/minute
Action: Request quota increase proactivelyOptimization Initiatives (Sprint 27)
1. Response Caching (3 points)
// Cache common AI responses
const cacheKey = `ai:${featureType}:${hash(prompt)}`;
const cached = await redis.get(cacheKey);
if (cached) {
return JSON.parse(cached);
}
const response = await callGemini(prompt);
await redis.set(cacheKey, JSON.stringify(response), 'EX', 86400); // 24 hours
return response;Expected Impact:
- 60-80% cache hit rate
- 70% cost reduction
- <1s response time for cached requests
2. Prompt Optimization (2 points)
Before:
- Essay grading prompt: 2000 tokens
- Response: 45s average
After:
- Optimized prompt: 800 tokens
- Expected response: ~28s average
Savings: 60% fewer input tokens, ~$80/month3. Parallel Processing (3 points)
// Process long essays in sections
async function gradeLongEssay(essay: Essay) {
const sections = splitIntoSections(essay, 1000); // 1000 words each
const results = await Promise.all(
sections.map(section => gradeSection(section))
);
return combineResults(results);
}
// Expected: 40% faster for essays >2000 wordsAI Quality Metrics
Current Quality (November 2025)
Essay Grading Accuracy:
Measured against teacher grades:
- Exact match (±2 points): 65%
- Close match (±5 points): 87%
- Outliers (>10 points diff): 4%
Teacher Satisfaction: 8.2/10
Student Satisfaction: 8.7/10
Target: 90% close match, <2% outliersQuiz Generation Quality:
Teacher-rated quality:
- Relevant to topic: 94%
- Appropriate difficulty: 89%
- Clear questions: 92%
- Correct answers: 98%
Overall Quality Score: 9.1/10
Target: Maintain >9.0Content Recommendations:
Click-through rate: 34%
Completion rate: 67%
Student rating: 8.5/10
Target: 40% CTR, 70% completionQuality Monitoring
// Track AI quality metrics
async function logAIResponse(
feature: string,
input: any,
output: any,
metadata: any
) {
await db.aiLogs.create({
feature,
input: sanitize(input),
output: sanitize(output),
responseTime: metadata.duration,
tokensUsed: metadata.tokens,
cost: calculateCost(metadata),
timestamp: new Date(),
});
// Flag low-quality responses for review
if (metadata.teacherOverride || metadata.userReported) {
await flagForReview(feature, input, output);
}
}Related Documentation
- Current Work Overview - Sprint status
- Platform Improvements - Infrastructure work
- Integration Work - Third-party integrations
- Technical Architecture - System design