Skip to content

Repository files navigation

image

StudentSync

The AI-powered study agent that actually gets the work done.

npm version License CI Node.js TypeScript LLM Support

Quick Start β€’ Features β€’ Architecture β€’ Configuration β€’ Commands β€’ Contributing


🎯 What is StudentSync?

StudentSync is a messaging-first AI agent platform built for college students. Send a natural-language prompt, a PDF, a voice note, or a screenshot to your Telegram or WhatsApp chat β€” and StudentSync handles the rest: parsing, solving, code execution, LaTeX compilation, PDF generation, and even auto-submission to Google Classroom.

Under the hood, it's a modular TypeScript agent runtime with a plugin-based tool system. The LLM is the router β€” no keyword matching, no handler switches. Adding a new capability is literally a single file.

  You: "Solve Q3 from this PDF and submit it to OS class"
  
  StudentSync:
    β”œβ”€ πŸ“„ Parsed PDF β†’ extracted Q3
    β”œβ”€ 🧠 Classified as "Coding + Theory" β†’ built execution plan
    β”œβ”€ πŸ’» Executed Python solution in sandbox
    β”œβ”€ πŸ“ Formatted answer with LaTeX
    β”œβ”€ πŸ“‹ Rendered as professional PDF
    └─ πŸŽ“ Uploaded to Google Classroom β†’ turned in βœ…

⚑ Quick Start

One-Line Install (Global + Daemon)

curl -fsSL https://raw.githubusercontent.com/Ayush-Vish/studentsync/main/install.sh | bash

This installs studentsync globally via npm, sets up PM2, and starts the daemon. Then run the setup wizard:

studentsync onboard

Manual Setup

# 1. Clone
git clone https://github.com/Ayush-Vish/studentsync.git
cd studentsync

# 2. Install dependencies
npm install

# 3. Provision runtime toolchains (Python venv, Chrome, Tectonic)
npm run setup

# 4. Build
npm run build

# 5. Run interactive onboarding
npm start onboard

# 6. Launch
npm start

Prerequisites: Node.js 20+, npm 9+. Optional: ffmpeg (voice notes), Python 3.10+ (code sandbox).


✨ Features

πŸ“± Multi-Platform Messaging

Platform Integration Auth
Telegram Full-featured via Telegraf Bot token from @BotFather
WhatsApp Multi-device via Baileys QR scan in terminal
Slack Placeholder for future expansion β€”

Session persistence ensures automatic reconnection across restarts.

πŸŽ“ Academic Intelligence

  • Voice Notes β€” Send a voice message on Telegram/WhatsApp; transcribed locally with whisper.cpp (free, on-device, no API keys)
  • PDF & Image Parsing β€” Extract assignment context from PDFs (pdf-parse) and images (tesseract.js OCR)
  • Adaptive Task Classification β€” Classifies tasks as Theory, MCQ, Coding, Research, or Mixed, then builds custom execution plans
  • Agentic Problem Solving β€” Iterative agent loop with tool calls for complex multi-step assignments
  • Follow-up Support β€” Full conversation history for revisions and clarifications

πŸ› οΈ Tool Plugin System

The core of StudentSync. Every capability is a self-describing ToolPlugin that the LLM can invoke dynamically:

Category Tools
Code Execution Python, Node.js, Bash, C, C++, Java sandboxes
Document Rendering PDF generation, LaTeX compilation (Tectonic), code screenshots
Web Research Real-time web search via DuckDuckGo
File Operations Full CRUD on the agent workspace
Shell Integration Controlled shell command execution
Text Processing Grep and sed for advanced search/replace
Resume Builder LaTeX resume generation from Overleaf templates

πŸŽ“ Google Classroom Automation

  • Search courses and coursework directly from chat
  • Upload generated artifacts to Google Drive
  • Attach files and turn in assignments β€” all hands-free

πŸ“… Smart Scheduling & Reminders

  • Natural language β€” "Remind me every day at 9am to study OS"
  • Cron-backed β€” Persistent schedules via node-cron
  • Messaging delivery β€” Reminders sent to your active chat channel

🧘 Student Life & Productivity

Domain Capabilities
Finance Log expenses, set monthly budgets, spending summaries, bill splitting
Personal Todo lists, habit tracking with streaks
Emotional Mood logging, journaling, guided breathing & grounding exercises
Career Job application tracking and status management

πŸ›‘οΈ Safety: The emotional toolset includes crisis detection β€” if the user expresses distress, the agent immediately surfaces helpline numbers and crisis resources. Breathing/grounding exercises are deterministic (no LLM improvisation).

πŸ”Œ MCP (Model Context Protocol) Support

Extend StudentSync with external tools via MCP servers:

  • Google MCP β€” Gmail, Calendar, Google Chat integration
  • GitHub MCP β€” Issues, PRs, repository management
  • Add custom MCP servers through the onboarding wizard

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     MESSAGING LAYER                       β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”                β”‚
β”‚  β”‚Telegram β”‚   β”‚ WhatsApp  β”‚   β”‚ Slack β”‚                 β”‚
β”‚  β”‚(Telegraf)β”‚   β”‚ (Baileys) β”‚   β”‚ (WIP) β”‚                β”‚
β”‚  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”¬β”€β”€β”€β”˜                β”‚
β”‚       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                    β”‚
β”‚                       β–Ό                                   β”‚
β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                           β”‚
β”‚              β”‚   Bot Router   β”‚  ← unified message handlerβ”‚
β”‚              β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                      β–Ό           AGENT CORE               β”‚
β”‚         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                           β”‚
β”‚         β”‚   Orchestrator      β”‚                           β”‚
β”‚         β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚                           β”‚
β”‚         β”‚  β”‚  Classifier  β”‚   β”‚  Task type detection      β”‚
β”‚         β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚                           β”‚
β”‚         β”‚  β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”   β”‚                           β”‚
β”‚         β”‚  β”‚   Planner    β”‚   β”‚  Dynamic execution plan   β”‚
β”‚         β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚                           β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                           β”‚
β”‚                   β–Ό                                       β”‚
β”‚         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                           β”‚
β”‚         β”‚    Agent Loop       β”‚  ← LLM + tool dispatch    β”‚
β”‚         β”‚    (llm.ts)         β”‚                           β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                           β”‚
β”‚                   β–Ό                                       β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”‚
β”‚  β”‚          Tool Plugin Registry          β”‚               β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚               β”‚
β”‚  β”‚  β”‚ Builtin  β”‚  β”‚  Domain Plugins   β”‚   β”‚               β”‚
β”‚  β”‚  β”‚ β”Œβ”€β”€β”€β”€β”€β”€β” β”‚  β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚   β”‚               β”‚
β”‚  β”‚  β”‚ β”‚ Code β”‚ β”‚  β”‚ β”‚   Finance     β”‚ β”‚   β”‚               β”‚
β”‚  β”‚  β”‚ β”‚ PDF  β”‚ β”‚  β”‚ β”‚   Personal    β”‚ β”‚   β”‚               β”‚
β”‚  β”‚  β”‚ β”‚ LaTeXβ”‚ β”‚  β”‚ β”‚   Emotional   β”‚ β”‚   β”‚               β”‚
β”‚  β”‚  β”‚ β”‚ Shellβ”‚ β”‚  β”‚ β”‚   Career      β”‚ β”‚   β”‚               β”‚
β”‚  β”‚  β”‚ β”‚ Web  β”‚ β”‚  β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚   β”‚               β”‚
β”‚  β”‚  β”‚ β”‚ File β”‚ β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚               β”‚
β”‚  β”‚  β”‚ β””β”€β”€β”€β”€β”€β”€β”˜ β”‚                          β”‚               β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                          β”‚               β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                    INTEGRATIONS                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”              β”‚
β”‚  β”‚ Google   β”‚  β”‚   MCP    β”‚  β”‚  Whisper   β”‚              β”‚
β”‚  β”‚Classroom β”‚  β”‚ Servers  β”‚  β”‚   (STT)    β”‚              β”‚
β”‚  β”‚ + Drive  β”‚  β”‚          β”‚  β”‚            β”‚              β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Source Layout

src/
β”œβ”€β”€ bot/                              # Messaging adapters
β”‚   β”œβ”€β”€ TelegramBot.ts                #   Telegraf wrapper
β”‚   β”œβ”€β”€ WhatsAppBot.ts                #   Baileys multi-device
β”‚   β”œβ”€β”€ WhatsAppConnectionController  #   QR auth + reconnection
β”‚   └── index.ts                      #   Unified bot router
β”œβ”€β”€ cli/                              # Setup wizard + CLI commands
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ llm.ts                        # Agent loop (Gemini / OpenAI)
β”‚   β”œβ”€β”€ plugins/                      # Tool plugin system
β”‚   β”‚   β”œβ”€β”€ ToolRegistry.ts           #   Registry + dispatch
β”‚   β”‚   β”œβ”€β”€ builtin/                  #   Academic + workspace tools
β”‚   β”‚   └── domains/                  #   Finance, personal, emotional, career
β”‚   β”œβ”€β”€ orchestrator/                 # Task classifier + planner
β”‚   β”œβ”€β”€ mcp/                          # MCP client manager + tool bridge
β”‚   β”œβ”€β”€ scheduler/                    # Cron-backed reminders
β”‚   β”œβ”€β”€ classroom.ts                  # Google Classroom + Drive
β”‚   β”œβ”€β”€ formatter.ts                  # Output formatting engine
β”‚   β”œβ”€β”€ parser.ts                     # PDF parsing
β”‚   β”œβ”€β”€ store.ts                      # Local user/session persistence
β”‚   β”œβ”€β”€ schema.ts                     # Config schema + defaults
β”‚   β”œβ”€β”€ session-manager.ts            # Multi-user session management
β”‚   β”œβ”€β”€ tools.ts                      # Artifact workspace + tool executor
β”‚   └── transcriber.ts                # whisper.cpp voice transcription
β”œβ”€β”€ api/                              # (Future) REST API surface
β”œβ”€β”€ types/                            # TypeScript type definitions
β”œβ”€β”€ templates/                        # LaTeX templates
β”œβ”€β”€ resume-templates/                 # Bundled resume templates
β”œβ”€β”€ skills/                           # Document/artifact generation skills
└── scripts/                          # Runtime provisioning

πŸ”§ Configuration

Environment Variables

StudentSync uses a JSON config at ~/.studentsync/config.json (created by the onboarding wizard). Environment variables always take priority over the config file.

Core

Variable Required Description
LLM_PROVIDER βœ… gemini, openai, openrouter, or ollama
LLM_API_KEY βœ…* API key for your chosen provider (*not needed for Ollama)
LLM_MODEL β€” Model override (default: gpt-4o for OpenAI, gemini-2.0-flash for Gemini)
TELEGRAM_BOT_TOKEN β€” Token from @BotFather
WHATSAPP_ENABLED β€” Set to true to enable WhatsApp
WHATSAPP_AUTH_DIR β€” Path to store WhatsApp auth session

Google Classroom

Variable Required Description
GOOGLE_CLIENT_ID β€” OAuth 2.0 client ID
GOOGLE_CLIENT_SECRET β€” OAuth 2.0 client secret
GOOGLE_REFRESH_TOKEN β€” OAuth refresh token

Voice Transcription (whisper.cpp)

Variable Default Description
WHISPER_CPP_MODEL (required) Path to ggml model, e.g. …/models/ggml-base.en.bin
WHISPER_CPP_BIN whisper-cli Path to the whisper.cpp CLI binary
FFMPEG_BIN ffmpeg Override if ffmpeg isn't on PATH
WHISPER_CPP_LANG (auto) Language hint (e.g. en). Omit to auto-detect
WHISPER_CPP_THREADS (default) Thread count for transcription

Runtime

Variable Default Description
STUDENTSYNC_HOME ~/.studentsync Base directory for all runtime data
STUDENTSYNC_PYTHON Auto-provisioned Path to Python binary
PUPPETEER_EXECUTABLE_PATH Auto-provisioned Path to Chrome/Chromium
TECTONIC_BIN Auto-provisioned Path to Tectonic LaTeX engine

If voice-note env vars aren't set, StudentSync simply replies with a friendly "voice notes aren't set up" message and continues working for text/PDF/image input.

Runtime Provisioning

The npm run setup command (also runs on postinstall) provisions into ~/.studentsync:

Component What it does Override
Python venv Creates venv/ with reportlab, fpdf2, matplotlib, numpy, pandas, sympy, etc. STUDENTSYNC_PYTHON
Chrome puppeteer browsers install chrome for HTML→PDF and screenshots PUPPETEER_EXECUTABLE_PATH
Tectonic Downloads the Tectonic LaTeX engine into bin/ TECTONIC_BIN

Every step is best-effort β€” if one toolchain can't be installed, the rest still proceed and the agent degrades gracefully.


πŸ“– Commands Reference

NPM Scripts

Command Description
npm run build Compile TypeScript β†’ dist/
npm start Build + start messaging runtime
npm start onboard Re-run the interactive setup wizard, then launch
npm run setup Provision runtime toolchains (Python, Chrome, Tectonic)
npm run start:daemon Start as a background service with PM2
npm run stop:daemon Stop and remove the PM2 daemon

Chat Commands

Command Description
/start Initialize the bot conversation
/new Start a fresh session
/context Show current session info, workspace, and turn count
/help List available commands
/expense Log a new expense
/todo Manage your todo list
/mood Log how you're feeling
/budget View budget summary
/habits Track daily/weekly habits
/apps View job application tracker

Pro tip: You don't need slash commands. Just type naturally β€” "add milk to my todo", "I spent β‚Ή200 on lunch", "I'm feeling stressed". The agent understands.


πŸŽ™οΈ Voice Notes Setup

Voice transcription runs fully local β€” no API keys, no cloud dependency.

# 1. Install ffmpeg
sudo apt install ffmpeg            # Debian/Ubuntu
brew install ffmpeg                # macOS

# 2. Build whisper.cpp
git clone https://github.com/ggerganov/whisper.cpp && cd whisper.cpp
cmake -B build && cmake --build build --config Release
sh ./models/download-ggml-model.sh base.en

Then set the environment variables:

export WHISPER_CPP_MODEL="/path/to/whisper.cpp/models/ggml-base.en.bin"
export WHISPER_CPP_BIN="/path/to/whisper.cpp/build/bin/whisper-cli"

🧩 Extending StudentSync

Adding a New Tool Plugin

Creating a new capability is a one-file change:

// src/core/plugins/builtin/myTool.ts
import type { ToolPlugin } from '../ToolRegistry.js';

export const myToolPlugin: ToolPlugin = {
  name: 'my_tool',
  description: 'Does something awesome',
  parameters: {
    input: { type: 'string', description: 'The input to process' }
  },
  required: ['input'],
  async execute(args, context) {
    // Your logic here
    return { result: `Processed: ${args.input}` };
  }
};

Then export it from builtin/index.ts β€” done. The LLM can now call it. No prompt engineering, no router changes, no bot code modifications.

Adding a Life Domain

For persistent user data, extend StoredUserProfile in store.ts with a typed sub-store, initialize it in normalizeUserProfile(), and create domain plugins in src/core/plugins/domains/.

Adding an MCP Server

Add a preset to MCP_PRESETS in schema.ts, or configure custom servers through the onboarding wizard. The MCPClientManager handles lifecycle and the MCPToolBridge exposes external tools to the agent loop.


πŸ› οΈ Tech Stack

Layer Technology
Runtime Node.js 20+ Β· TypeScript
AI/LLM Google GenAI SDK Β· OpenAI-compatible APIs Β· Ollama
Messaging Telegraf (Telegram) Β· Baileys (WhatsApp)
Automation Puppeteer Β· Google APIs (Classroom + Drive)
Documents pdf-parse Β· Tesseract.js Β· md2latex Β· Tectonic
Scheduling node-cron
CLI Commander Β· @clack/prompts Β· picocolors
Frontend Next.js 16 Β· Tailwind CSS Β· Radix UI Β· Framer Motion
Voice whisper.cpp Β· ffmpeg
Process Mgmt PM2

🀝 Contributing

Contributions are welcome! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feat/my-feature
  3. Make your changes and ensure the build passes: npm run build
  4. Commit with a descriptive message: git commit -m "feat: add X capability"
  5. Push to your fork: git push origin feat/my-feature
  6. Open a Pull Request

Development Setup

git clone https://github.com/Ayush-Vish/studentsync.git
cd studentsync
npm install
npm run setup    # provision runtime toolchains
npm run build    # compile TypeScript
npm start onboard  # configure LLM + bot tokens

Project Structure

Directory What lives there
studentsync/ Core agent runtime (TypeScript)
frontend/ Next.js marketing/docs site

πŸ“ Design Philosophy

  • LLM-as-Router β€” No hardcoded workflows. The LLM decides which tools to call based on the user's intent.
  • Plugin-First β€” Every capability is a self-describing ToolPlugin. Adding features = adding files.
  • Graceful Degradation β€” Missing toolchains? The agent adapts. No Chrome? Skip screenshots. No Tectonic? Fall back to HTML PDFs.
  • Privacy-First Voice β€” Voice transcription runs entirely on-device with whisper.cpp. Zero cloud dependency.
  • Safety by Design β€” Crisis detection in emotional tools, no medical/diagnostic language, deterministic grounding exercises.

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


Built with β˜• and 🧠 by Ayush Vishwakarma

Releases

Packages

Contributors

Languages