Multimodal tutoring with voice, retrieval‑augmented reasoning, and a collaborative whiteboard.
Live stack: FastAPI + LangGraph + Gemini + Qdrant + Next.js + Socket.IO + Deepgram + ElevenLabs
- Voice push‑to‑talk with real‑time STT and TTS
- Socratic prompting with frustration monitoring and quiz mode
- Materials ingest (PDF/images/text) into Qdrant RAG store
- Shared JSON schemas for tight frontend/backend contracts
- Interactive whiteboard actions (create notes, highlight, load images)
- Structured JSON logging and sane defaults for local/dev/prod
- Backend: FastAPI, LangGraph, Google Gemini, Qdrant, httpx, websockets
- Speech: Deepgram (STT), ElevenLabs (TTS), Piper/pyttsx3 (local fallback)
- Frontend: Next.js 16 (React 19), Tailwind, Zustand, socket.io‑client, Tldraw
- Data: Qdrant (vector DB), Docling (document parsing)
- Tooling: Pydantic v2, Ruff, MyPy, Vitest/Playwright (planned), Docker Compose
backend/ # FastAPI app, services, LangGraph
app/
api/ # HTTP + Socket.IO routes
services/ # gemini, qdrant, stt, tts
graph/ # state + nodes + builder
workers/ # chunking + ingest
requirements.txt # Python deps (pip)
frontendOther/ # Next.js app (App Router)
app/, components/, lib/ # UI, hooks, stores, ws client
shared/schema/ # Pydantic + Zod message contracts
docker-compose.yml # Qdrant + (backend + frontend) services
.env.example # Backend + Compose example env
API keys are required. Copy examples and fill in values.
cp .env.example .env # Backend + compose
cp frontendOther/.env.local.example frontendOther/.env.local # FrontendRequired keys and sensible defaults are documented in the example files.
- Python 3.11+
- Node.js 20+
- pnpm 9+ (Corepack auto‑installs) or npm
- Docker (for Qdrant/dev compose)
docker compose up -d qdrantOption A — venv (recommended)
cd backend
python -m venv .venv && source .venv/bin/activate
python -m pip install -r requirements.txt
python -m app.mainOption B — Conda
cd backend
conda env create -f environment.yml
conda activate agora
python -m app.mainBackend serves at http://localhost:8000 and mounts Socket.IO at /socket.io.
cd frontendOther
pnpm install
pnpm devFrontend runs at http://localhost:3000.
We provide Dockerfiles for backend and frontend and extend docker-compose.yml to run the full stack.
Build and start everything:
docker compose up -d --buildServices:
- Backend: http://localhost:8000
- Frontend: http://localhost:3000
- Qdrant: http://localhost:6333
To follow logs:
docker compose logs -f backend frontend qdrantTo stop:
docker compose downNotes:
- ElevenLabs is the default TTS in containers. Local Piper/pyttsx3 is supported but requires espeak-ng and lacks direct audio playback; we write to file and convert to MP3.
- Frontend
NEXT_PUBLIC_*values are inlined at build time. Set them in.env(compose) orfrontendOther/.env.localbefore building.
Backend:
cd backend
pytest
ruff check .
mypy .Frontend:
cd frontendOther
pnpm lint
pnpm build- Voice Loop: press‑to‑talk → STT → LangGraph route → RAG → Socratic response → TTS stream
- Materials Ingest:
/api/materials/uploadprocesses PDFs/images/text via Docling, embeds with Gemini, upserts to Qdrant peruser_id/course_id - Shared Contracts: JSON message types validated on both sides under
shared/schema - Whiteboard Actions: backend emits
visualmessages (create/hightlight/load) → Tldraw updates - Session Tracking: uuidv4
user_id(localStorage) +session_idper run
- Qdrant:
curl http://localhost:6333/health - WebSocket: ensure
NEXT_PUBLIC_WS_URLpoints tohttp://localhost:8000 - STT/TTS: verify keys in
.env; switch providers withSTT_PROVIDER/TTS_PROVIDER - Logs: set
LOG_LEVEL=INFOto reduce noise; optionalLOG_FILE=/tmp/agora_backend.log
MIT — Built for NYU Hackathon 2025