Lumina AI uses a lightweight gamification layer to encourage consistent study habits. Every message a student sends earns experience points, consecutive daily activity builds a streak counter, and accumulated XP unlocks progressively named levels. All of these stats are visible at a glance in the sidebar, giving students an ongoing sense of progress during each session.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/diazdavilajesus16-stack/IA-LUMINA/llms.txt
Use this file to discover all available pages before exploring further.
XP system
Every time a student sends a message—whether a question, a quick-action prompt, or a voice input—Lumina awards +10 XP. This is handled by theupdate_streak_and_xp() function in Main.py, which is called at the end of every send_message() execution:
Level progression
XP thresholds map to five named levels, checked in ascending order:| Level | XP range |
|---|---|
| Bronce | 0 – 999 XP |
| Plata | 1,000 – 1,999 XP |
| Oro | 2,000 – 3,499 XP |
| Platino | 3,500 – 5,499 XP |
| Diamante | 5,500+ XP |
st.session_state.xp:
Daily streak
The streak counter tracks how many consecutive days a student has been active. The logic compares today’s date againstlast_activity_date stored in session state:
Same day
If the student sends a message on the same calendar day as their last activity, the streak counter does not change. XP is still awarded.
Next consecutive day
If exactly one day has passed since the last activity date, the streak increments by 1 and
last_activity_date updates to today.XP progress bar
The sidebar displays a progress bar showing how far through the current level tier a student has advanced. The percentage is calculated as the XP within the current 1,000-point window, capped at 100:(2340 % 1000) / 10 = 34% progress toward the next level boundary.
The progress bar is rendered as a styled HTML gradient bar alongside the level name and percentage label:
Sidebar stats display
The stats section of the sidebar shows three values simultaneously:Días racha
The current streak count in days. Displayed in a purple-tinted tile.
XP ganados
Total accumulated XP across the session. Displayed in a violet-tinted tile.
Nivel {nivel} on the left and {xp_pct}% on the right, with the gradient fill updating dynamically as XP increases.
Default starting values
When a new session is initialized,init_session() sets the following default values:
The default values of
racha=12 and xp=680 are hardcoded in the current implementation and reset whenever the Streamlit session ends (for example, on page refresh). In a production deployment, these values would be persisted to a database or user profile so progress is preserved across sessions.