Lumina AI’s knowledge is defined entirely by the intents inDocumentation 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.
respuestas.json. Each intent describes a topic the chatbot recognizes — the example phrases students might use to raise that topic, and the replies Lumina AI can give. Editing this file is the primary way to expand, restrict, or refine what the chatbot understands and how it communicates.
File format
respuestas.json contains a single top-level key, "intents", whose value is an array of intent objects. Every object in the array follows the same three-field structure:
Example intent
The following is thealgebra_ecuaciones intent taken directly from respuestas.json:
Field descriptions
A unique string identifier for this intent. Must not duplicate any other tag in the array. The tag is used internally to match a prediction to the correct set of responses and to power the keyword fallback map in
chatbot.py.An array of example phrases that a student might type to trigger this intent. These are tokenized and lemmatized during training to build the bag-of-words vocabulary. More varied patterns — different sentence lengths, synonyms, and phrasings — lead to better recognition accuracy.
An array of possible replies. When the intent is matched, Lumina AI selects one response at random using
random.choice(). Providing multiple responses gives the chatbot variety so it does not feel repetitive across a conversation.How intent matching works
When a student sends a message, Lumina AI processes it through a three-stage cascade defined inchatbot.py:
-
Neural network prediction — the message is tokenized and lemmatized, then converted to a binary bag-of-words vector over the full training vocabulary. The Keras model (
chatbot_model.h5) outputs a confidence score for every intent class. If any class exceeds_THRESHOLD_HIGH = 0.60, that intent is used directly. -
Keyword fallback — if no class clears the high threshold,
chatbot.pychecks_KEYWORD_MAP, a hardcoded dictionary of keywords per tag. If one or more keywords are found in the normalized message, the highest-scoring tag is returned with a synthetic confidence of0.50. -
Low-confidence fallback — if neither stage produces a result, intents that exceed
_THRESHOLD_LOW = 0.35are considered. If still nothing matches, a contextual fallback message is returned.
patterns arrays, the more varied and representative your patterns are, the better the model’s accuracy. Aim for at least five to eight distinct phrasings per intent, covering different vocabulary and sentence structures a real student might use.
Adding a new intent
Open respuestas.json
Open
respuestas.json in any text editor. Locate the closing ] of the "intents" array (the last intent ends with } before it).Add a new intent object
Insert a comma after the last intent’s closing
}, then add your new object. Choose a unique tag, write at least five to eight varied patterns, and provide two or more responses so the bot has variety:Save the file
Save
respuestas.json. Make sure the JSON is valid — each intent object is separated by a comma, and the overall structure is { "intents": [ ... ] }.Retrain the model
Run the training script from the project root. This re-reads all patterns, rebuilds the vocabulary, and overwrites
chatbot_model.h5, words.pkl, and classes.pkl:Existing intent tags
The following tags are defined inchatbot.py’s _KEYWORD_MAP and are used as the keyword-fallback targets. Each corresponds to one or more intents in respuestas.json:
| Tag | Topic |
|---|---|
saludo | Greetings |
despedida | Farewells |
matematicas_general | General mathematics |
algebra | Algebra (equations, polynomials, factoring) |
fracciones | Fractions |
geometria | Geometry (shapes, area, volume) |
trigonometria | Trigonometry |
probabilidad | Probability and statistics |
biologia | Biology |
quimica | Chemistry |
fisica | Physics |
historia | History |
literatura | Literature |
programacion | Programming |
geografia | Geography |
tecnicas_estudio | Study techniques |
motivacion | Motivation |
habitos | Study habits |
examen | Exams and tests |
concentracion | Focus and concentration |
curiosidades | Fun facts and curiosities |
agradecimiento | Gratitude and thanks |
chiste | Jokes and humor |
ansiedad_academica | Academic anxiety |
salud_mental_estudio | Mental health while studying |
no_entendido | Clarification requests |