Lumina AI’s knowledge is defined 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, which the neural network learns during training. You can expand what the chatbot understands by adding new intent objects to that file. For topics where the model may be uncertain, you can also add keyword entries to the _KEYWORD_MAP in chatbot.py to provide a rule-based fallback that works without retraining.
Two-part approach
There are two complementary mechanisms for teaching Lumina AI a new topic:- Add to
respuestas.json— trains the neural network to recognize patterns semantically - Add to
_KEYWORD_MAPinchatbot.py— provides keyword-based fallback coverage without retraining
Part 1: Adding to respuestas.json
Each intent is a JSON object with three fields:tag (a unique identifier), patterns (example user inputs), and responses (the chatbot’s reply options).
Here is a complete example intent for Python programming:
"intents" array in respuestas.json, then retrain the model.
Tips for writing effective intents:
- Use at least 6–8 varied patterns per intent. The more diverse the phrasing, the better the model generalizes.
- Write responses in Spanish to match the rest of the chatbot’s language.
- Keep the
tagvalue short, lowercase, and descriptive — you will reuse it in_KEYWORD_MAP. - Vary pattern length and structure: include short questions (“Qué es Python”), longer questions (“Cómo usar funciones en Python”), and fragment-style inputs (“Bucles en Python”).
Part 2: Updating _KEYWORD_MAP in chatbot.py
_KEYWORD_MAP in chatbot.py is a dictionary that maps intent tags to lists of keyword strings. When the neural network’s confidence falls below the acceptance threshold, the chatbot scans the normalized user input for these keywords as a fallback.
To add a keyword entry for the new programacion_python intent, open chatbot.py and add a line to the _KEYWORD_MAP dictionary:
_KEYWORD_MAP take effect the next time the application starts.
The tag name in
respuestas.json must exactly match the key you use in _KEYWORD_MAP. A mismatch means the keyword fallback will fire but get_response will not find a matching intent, causing a generic fallback response instead.Retrain after changes
After editingrespuestas.json, you must retrain the model for the neural network to recognize the new intent. See the retraining guide for the full procedure.
Changes to _KEYWORD_MAP alone do not require retraining — restart the Streamlit app and they take effect immediately.
Testing your new intent
Once you have retrained and restarted the app, verify the new intent works by typing one of your new patterns directly into the chat. For example:responses. If it returns a generic fallback instead, check that:
- The intent was saved correctly in
respuestas.jsonwith valid JSON syntax - You reran
training_chatbot.pyafter saving - The
taginrespuestas.jsonmatches the key in_KEYWORD_MAP(if you added one) - The app was restarted after retraining