Overview
SyllabAI is a starter project built with Next.js that helps students and instructors turn a course syllabus into an interactive study assistant. Upload a syllabus (PDF/DOCX/TXT), the platform extracts and indexes the content, and you can immediately ask questions or request summaries.Get Started
⚡ After setup, upload a small test syllabus at/uploadand visit/chatto interact.
How It Works ?
- Prepare your syllabus – Export or collect your syllabus in PDF, DOCX or TXT.
- Upload – Use the Upload page to send the file to the backend extraction endpoint.
- Extract & Index – Backend extracts text and adds it to a document store (or index) via
/context/add. - Ask – Use the Chat UI to ask questions; the backend generates responses grounded in the indexed syllabus.
Environment Variables
Copy.env.example → .env and set at minimum:
⚠️ Keep keys and secrets out of version control.
Code Structure
Architecture & Flow
SyllabAI is organized into four main modules: Frontend, Backend (integration), Storage / Indexing, and Configuration.1. Frontend
Handles uploads, interactions, and rendering. Key files:app/upload/page.tsx— file upload, validation, and/uploadcallapp/chat/page.tsx— chat UI, fetch document, sendchat_historycomponents/*— UI primitives (file upload, message, viewer)
2. Backend (integration)
The frontend relies on a backend to perform extract, index, and generate operations. The backend can be any service that implements the expected endpoints and authorization. Expected endpoints:POST /upload— Accepts multipart/form-data (file), returns{ text }.POST /context/add— Accepts documents payload to index/store content.POST /chat/generate— Accepts achat_historyand returns a generated response object.
3. Storage / Indexing
Indexing can be as simple as storing raw documents in a database or more advanced using vector embeddings and a vector store for retrieval-augmented generation.4. Configuration
Environment variables and API keys configure the backend endpoints, auth, and optional storage settings.Core Features
- Upload PDF / DOCX / TXT syllabus files
- Extract and index content for retrieval
- Chat UI that answers questions grounded in the syllabus
- Modular frontend that can work with different backends
API Endpoints
Documents
- POST
/upload— Upload a file (FormData) and receive extracted text{ "text": "..." }. - POST
/context/add— Add documents for indexing:{ documents: [{ content, fileName, fileType, fileSize, name }], source, context_type }.
Chat
- POST
/chat/generate— Generate an assistant response fromchat_historyand options. The UI expects response content atresult.response.kwargs.content.
Example HTTP requests
Here are concrete examples you can use when testing or building a compatible backend.- Upload (curl)
- Context add (curl)
- Chat generate (curl)
Troubleshooting
- 400/401 errors: verify
NEXT_PUBLIC_BACKEND_URLandNEXT_PUBLIC_API_KEY. - Empty chat responses: ensure the document was added via
/context/addand the backend returns embeddings or indexed content. - Upload parsing errors: check backend logs for file parser issues (unsupported PDF structure or encoding).
How to run & deploy
Run locally
Testing
- Upload a short syllabus (~1–3 pages) and ask a few questions in the chat UI.
- Optionally add unit/integration tests for upload and chat API integrations.
Security & Best Practices
- Keep API keys secret and use server-side auth where possible.
- Validate and sanitize uploads server-side to prevent malicious files.
- Rate-limit generation endpoints and monitor usage.
Benefits
- Fast to set up and test — a minimal frontend that integrates with any compatible backend.
- Focused UX for syllabus-driven learning.
- Easily extensible — swap or enhance the backend for improved retrieval and generation.
Github
Star and look at the code

