Engati - User Guide
...
Custom Script Training
MongoDB Search Custom Script
6 min
overview mongo custom script training allows the system to fetch external data and store it directly in a mongo database for structured retrieval instead of indexing text for semantic retrieval (rag), this method stores structured json objects that can later be accessed through internal apis this approach is useful when data needs exact retrieval instead of semantic search the application requires structured database storage information needs to be accessed through internal mongo apis instead of returning page content for indexing, the script returns structured json using the data to save field the system stores this data directly inside the platform's mongo database example structure the custom script must return json in the following format { "data to save" { "field 1" "value", "field 2" "value", "field 3" "value" } } supported sources custom scripts can retrieve data from various external systems and convert it into structured json that can be indexed or stored by the platform below are sample examples demonstrating how different data sources can be integrated using custom scripts each example includes script — the python code used to fetch and transform the data • response — the json output returned by the script after execution this json output is processed by the system and used for indexing or storing the data depending on the use case https //docs google com/document/d/12nss6u vbvy7lplne u2rg3vo8f5rzmdwvrolgrucnw/edit?usp=sharing fetch spreadsheet data from google sheets , convert each row into json, and store or index the records https //docs google com/document/d/12nss6u vbvy7lplne u2rg3vo8f5rzmdwvrolgrucnw/edit?usp=sharing retrieve structured data from backend services or external apis , transform the response, and return it in json format follow the steps below to complete the setup 👇 watch the configuration video 👉 docid\ hwlylqfslsua5rpvmkmqf 📚 next steps once the mongo db indexing status shows ready to search, configure the agent workflow so the ai can retrieve knowledge from the indexed website content ➡️ continue with docid\ mghub2ljg7trzpintcz2d
