Skip to content

Feat/part2 LMS Integration and Nudge Engine#10

Open
SuryaPratapIIIT wants to merge 3 commits into
theapprenticeproject:mainfrom
SuryaPratapIIIT:feat/part2-lms-nudge
Open

Feat/part2 LMS Integration and Nudge Engine#10
SuryaPratapIIIT wants to merge 3 commits into
theapprenticeproject:mainfrom
SuryaPratapIIIT:feat/part2-lms-nudge

Conversation

@SuryaPratapIIIT
Copy link
Copy Markdown

@SuryaPratapIIIT SuryaPratapIIIT commented May 6, 2026

LMS Integration & Nudging Engine for TAP Multilingual Voice Agent
Summary

This PR introduces LMS integration and a rule-based nudging engine to enhance learner engagement. The system now fetches learner context from TAP LMS and generates personalized nudge plans to determine when and how to engage students effectively.

✨ Key Changes

  1. LMS Adapter (Frappe / TAP LMS)
    Added FrappeLMSAdapter using httpx
    Integrated TAP LMS REST APIs:
    get_learner_profile
    get_learner_activity
    log_engagement
  2. Nudging Engine Enhancements
    Implemented rule-based decision logic for:
    Call Reason & Nudge Type (Inactivity, Pending Assignments, Milestones)
    Next Task Recommendation
    Urgency Levels (Low / Medium / High)
    Personalized Messaging (Student + Parent)
  3. New API Endpoints
    GET /api/v1/nudge/{learner_id}/context
    → Fetch raw learner activity from LMS
    GET /api/v1/nudge/{learner_id}/plan
    → Generate structured nudge plan for orchestration
    🧪 Testing & Quality
    Added/updated tests in tests/test_nudge_engine.py
    ✅ 45 tests passing
    📊 Test coverage: 82.28%
    🧹 Linting & formatting via Ruff
    ⚙️ How to Test

Run server

uvicorn app.main:app --reload

Open API docs

http://localhost:8000/docs

Run tests

pytest tests/ -v

Use sample learner IDs:

learner_001
learner_002
learner_003
✅ Checklist
Modular architecture followed
No hardcoded secrets
Unit tests added
Linting & formatting applied
💡 Notes for Reviewers
Focus areas:
FrappeLMSAdapter API interactions
Rule evaluation logic in NudgeEngine
API response structure for /plan endpoint

- Setup FastAPI app, routers, and health checks
- Add Pydantic domain schemas and env configuration
- Build LMS mock adapter and nudge engine skeleton
- Add Pytest suite with 86% coverage and CI workflow
- Add Dockerfile and docker-compose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant