ISTE+ASCD’s existing solution includes a private knowledge base of research papers in PDF format and a curated list of webpages, with a pre-processing pipeline to clean up these data sources and apply metadata tags. The PDFs require minimal pre-processing. The webpages require more pre-processing and custom code to capture only the content of the pages. The amount of code for this function is minimized by using webpages from a handful of sites, keeping the amount of custom code manageable. The processed data sources are then chunked to prepare them for embedding. The existing solution uses OpenAI’s embedding service to vectorize the data, after which it is stored in a Supabase vector database.
This private knowledge base, embedded as vectors, provides the retrieved articles that serve as the basis of the LLM response. When StretchAI is queried, the query is preprocessed and cleaned using ISTE+ASCD’s already established functions and then converted into an embedding vector. The vector is compared against the knowledge base using a vector similarity search to determine the most relevant documents to be retrieved. Reformatting and summarizing of the articles to answer the user’s question is handled by ISTE+ASCD’s prompt templates. The retrieved documents are parsed and extracted to create additional contextual data. Subsequently, the original query, the retrieved context, and ISTE+ASCD carefully constructed prompts—designed to align with ISTE+ASCD’s specific educational context—are combined and sent to the LLM through OpenAI’s API calls.