Skip to content

The home of nexus.ai. Hoping to help learners to more efficient, actual, learning leveraging AI (rather than helping AI learn for them)...

Notifications You must be signed in to change notification settings

ar7emiy/nexus-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

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.

Resource Breakdown:

Cloud function codefiles

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, calls process_snippets (explained below), loads processed data from GCS, generates a signed video URL, and returns the results. Other important functions include load_from_gcs, save_to_gcs, generate_signed_url, convert_to_seconds, and group_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 by process_snippets in main.py. Other functions include embed_text, load_data, and cosine_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, calls retrieve_pdf_snippets (explained below), generates a relationship summary using generate_relation_summary, and returns the results along with a signed PDF URL. It also includes embed_text, load_pdf_embeddings, cosine_similarity, preprocess_text, and generate_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, calls retrieve_pdf_snippets (explained below) to get relevant snippets, generates a signed URL for the PDF, and returns the results. It also includes cosine_similarity, load_pdf_embeddings, generate_summary, and retrieve_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.

About

The home of nexus.ai. Hoping to help learners to more efficient, actual, learning leveraging AI (rather than helping AI learn for them)...

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published