Live Hosted Application: https://synapse-pbp47.web.app
Cortexa is an intelligent, context-grounded study planning agent designed for the Google Cloud Rapid Agent Hackathon. Built to operate entirely as a serverless web application, Cortexa empowers students to organize scattered study materials (PDFs, DOCX, TXT) into custom daily target lists, interactive spaced-recall quizzes, and personalized weekly schedules—all strictly grounded in their uploaded documents.
Cortexa runs on a fully serverless, hosted infrastructure leveraging Firebase Hosting, Firebase Cloud Functions, Cloud Firestore, and Elasticsearch (via REST client integration).
graph TD
Client([Hosted Frontend / PWA])
Hosting[Firebase Hosting]
Functions[Firebase Cloud Functions - api]
ElasticSearch[(Elasticsearch Cloud / Cluster)]
Firestore[(Firestore DB)]
Client -->|GET/POST /api/...| Hosting
Hosting -->|Hosting Rewrite Rules| Functions
Functions -->|Direct REST / Native Fetch| ElasticSearch
Functions -->|x-user-uid Scoped| Firestore
- Hosted Web Client: A responsive, Google-inspired frontend hosted on Firebase Hosting. It communicates with the backend cloud functions using relative path routing.
- Cloud Functions Backend (
/api): A serverless Node.js Express backend deployed as a Cloud Function. It handles file parsing, text extraction, quiz generation, and planner scheduling. - Elasticsearch Integration (Elastic MCP Fallback): The Cloud Functions backend communicates directly with the Elasticsearch cluster via native REST API calls. This enables high-performance semantic search, document chunk indexing, and quiz grounding in serverless runtimes where subprocess spawning is restricted.
- Data Isolation & Security Scopes: Private student data is completely isolated. Uploaded notes, calendar configurations, and search indices are strictly scoped per user (
user-{uid}-notesanduser-{uid}-memory) using security headers (x-user-uid). - Firestore Databases: Scoped user configurations (calendar schedules, planner metrics, and note lists) are synchronized in Cloud Firestore.
- Grounded Research Q&A: Answers questions by retrieving relevant semantic document chunks from Elasticsearch, providing inline citations and LaTeX equation rendering. Powered by the Gemini API for synthesis.
- Spaced-Recall Quiz Lab: Generates targeted checkpoints and step-by-step math explanations directly from the student's learning materials using Gemini.
- Deadline-Aware Study Planner: Analyzes schedule data and notes to generate personalized study blocks inside comfortable free hours, avoiding schedule overlaps.
- Offline Fallback Parser: Incorporates browser-based PDF and document parsing engines to extract text client-side if network resources are limited.
- LLM Engine: Google Gemini API (
GEMINI_API_KEYmapped in backend configurations).
The serverless backend connects to the Elasticsearch cluster using the following environmental variables:
ES_URL/ELASTICSEARCH_URL: Target Elasticsearch cluster endpoint.ES_API_KEY/ELASTICSEARCH_API_KEY: Authentication key for cluster queries.
Copyright © 2026 NUKADASARI PUNITH VENKAT SAI Copyright © 2026 YELLANKI SAI SURYA PRANAY Copyright © 2026 TANUBUDDHI BHARGAV
Licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See LICENSE for full details.