Skip to main content

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.

Lumina AI is composed of three Python files and a set of data files that work together to deliver an AI-powered study assistant. Understanding how these pieces connect helps you customize, extend, or retrain the chatbot.

Project structure

FileRole
Main.pyStreamlit UI, session state, page routing, audio/PDF helpers
chatbot.pyNeural network inference engine — predict_class, get_response, bag_of_words
training_chatbot.pyOne-time training script that produces the model and vocabulary files
respuestas.jsonIntent knowledge base — tag, patterns, responses arrays
chatbot_model.h5Trained Keras model weights (HDF5 format)
words.pklSerialized vocabulary list
classes.pklSerialized list of intent tag names

Data flow

When a student sends a message, the following sequence runs:
  1. Main.py:send_message() receives the raw text
  2. If a PDF is loaded, query_pdf() checks for a relevant paragraph first
  3. Otherwise, Main.py:get_response() calls match_intent() — a simple word-overlap scorer used directly in the UI layer
  4. match_intent() returns the best-matching intent from respuestas.json
  5. A random response from that intent’s responses array is returned
  6. XP and streak are updated via update_streak_and_xp()
The full ML inference pipeline in chatbot.py (neural network + keyword fallback) is the more powerful engine designed for production use. Main.py includes its own lightweight match_intent() for simplicity.

Page routing

The sidebar navigation sets st.session_state.current_page to one of these values:
Page keyDescription
ChatMain AI chat interface
ResumenTopic summary generator
MateriasSubject browser (redirects to chat panel)
QuizMultiple-choice quiz
MemorizarMemory technique tips
MotivaciónRotating motivational phrases
AjustesSettings (theme, notifications)

Neural network model

Architecture, training config, and inference pipeline details.

Intent matching

The three-stage cascade: neural net, keyword fallback, and context fallback.

Training the model

How to retrain the Keras model after updating respuestas.json.

Extending intents

Add new topics and responses to the intent knowledge base.

Build docs developers (and LLMs) love