Engati - User Guide
...
2. Data Training Setup
Custom Script Training
3 min
overview overview custom script training allows the ai agent to fetch and process data dynamically using custom scripts instead of uploading static documents or urls this method is useful when knowledge needs to be retrieved from external apis, databases, or dynamic data sources the script processes the data and returns it in json format , which is then indexed by the ai system for retrieval custom script data sources inside custom script training, you can configure different data sources custom scripts can be used for two main purposes docid\ vzcukq1t4yezekcppo6xx – retrieve responses using trained documents docid\ zbko9ka1xqs29p x1rt5w – fetch data dynamically from mongodb when to use rag vs mongodb when to use rag vs mongodb custom scripts can be used for two different purposes depending on how the data needs to be used by the ai system rag indexing is used when the ai needs to perform semantic search and retrieve contextual answers from large text data mongodb storage is used when the system needs to store structured data and retrieve it using apis or exact field queries the table below explains the key differences rag indexing rag indexing mongodb storage mongodb storage uses page content uses data to save used for semantic ai search used for structured database retrieval data is converted into embeddings data is stored as json documents best for faqs, documents, websites, knowledge bases best for product data, tours, doctors, catalog data ai retrieves answers based on context similarity data retrieved using api queries or filters optimized for natural language queries optimized for exact field lookup supports vector search supports database queries and integrations quick guideline quick guideline use rag indexing when the ai must answer questions from documents, websites, faqs, or large text content the user asks questions in natural language context based retrieval is required use mongodb storage when the data is structured records (tours, doctors, products, bookings) the system needs to retrieve specific fields or filtered data the data will be accessed through backend apis or system queries
