visit nxs-ai.com to try demo yourself ![Watch the video]
NexusAI
NexusAI is a platform designed to help students learn more efficiently with the aid of AI. Rather than providing direct answers, NexusAI focuses on helping students locate and understand the information they need from their own course materials.
Key Features
• AI-Enhanced Search: Utilizes Google Gemini to process and search through course content.
• Chatbot Interface: Students can ask questions and receive contextual snippets from their materials, which are highlighted and explained by the chatbot.
• Efficient Answer Location: Provides a way to pinpoint relevant information without giving direct answers, avoiding plagiarism issues.
• Custom Course Uploads: Students can upload and customize their own courses with materials like PDFs and video lectures. (In development)
How it works
Students or teachers upload materials to the platform, which are then stored in the cloud. When a student asks a question, the AI searches through the uploaded content and provides snippets that best match the query.
gcp_nxs-function
This GCP function processes user queries related to a lecture video, retrieving relevant snippets, generating summaries, and providing a signed URL for the video. It consists of two interacting files:
-
main.py: This file contains the core logic for handling user requests and orchestrating the processing pipeline. The key function is
process_input
, which handles HTTP requests, extracts the user's query, callsprocess_snippets
(explained below), loads processed data from GCS, generates a signed video URL, and returns the results. Other important functions includeload_from_gcs
,save_to_gcs
,generate_signed_url
,convert_to_seconds
, andgroup_intervals
. -
retrieval_key.py: This supporting file focuses on retrieving relevant video segments based on the user's query. The crucial function here is
retrieve
, which loads video transcript data and pre-computed embeddings, embeds the user's query, calculates cosine similarity scores between the query embedding and the video segment embeddings, and returns the top 14 most similar segments. This function is called byprocess_snippets
inmain.py
. Other functions includeembed_text
,load_data
, andcosine_similarity
.
The interaction is as follows: main.py
receives the user's query, and then uses retrieval_key.py
's retrieve
function to get the most relevant snippets. main.py
then processes these snippets and generates summaries.
gcp_pdf-retrieval-function
This GCP function processes user queries related to a PDF document, retrieving relevant snippets, generating a relationship summary, and providing a signed URL for the PDF. It also comprises two files:
-
main.py: This file handles incoming HTTP requests, extracts the query, and orchestrates the PDF processing. The core function is
process_pdf_query
. It loads PDF embeddings, callsretrieve_pdf_snippets
(explained below), generates a relationship summary usinggenerate_relation_summary
, and returns the results along with a signed PDF URL. It also includesembed_text
,load_pdf_embeddings
,cosine_similarity
,preprocess_text
, andgenerate_signed_url
. -
pdf_retrieval.py: This file provides the functions for retrieving and summarizing relevant PDF content. The main function is
pdf_retrieval
, which takes a query, callsretrieve_pdf_snippets
(explained below) to get relevant snippets, generates a signed URL for the PDF, and returns the results. It also includescosine_similarity
,load_pdf_embeddings
,generate_summary
, andretrieve_pdf_snippets
.
The interaction between the files is as follows: main.py
's process_pdf_query
calls pdf_retrieval.py
's pdf_retrieval
method. pdf_retrieval
then uses retrieve_pdf_snippets
to identify the most relevant snippets, which are then used by main.py to generate a response. This response includes the snippets, a relationship summary (generated by main.py
), and a link to the PDF.