AI powered academic intelligence system that detects plagiarism, generates structured insights, and automates assignment submissions with verified academic integrity β built with FastAPI, pgVector, and n8n.
π₯ Watch the walkthrough: π Academic Assignment Helper Overview (YouTube)
- Overview
- System Architecture
- Core Features
- Tech Stack
- Installation Guide
- Docker Setup
- Database Initialization
- API Usage (Swagger)
- Automation Workflows (n8n)
- Automated Assignment Submission
- Security
- Project Phases Summary
- Future Roadmap
- Credits
The Academic Assignment Helper is a full-stack AI platform designed to empower students, educators, and researchers with intelligent academic evaluation tools.
It automates:
- Plagiarism detection with semantic vector comparison
- Context-aware analysis using RAG (Retrieval-Augmented Generation)
- Report generation and email notifications via n8n
- Automated instructor submission with a Plagiarism-Free Testimonial
β This project demonstrates production level workflow orchestration, AI integration, and academic automation β all within a Dockerized microservice ecosystem.
π¦ academic-assignment-helper
βββ backend/
β βββ main.py # FastAPI app entrypoint
β βββ routes_upload.py # Upload & n8n trigger
β βββ routes_analysis.py # AI + RAG pipeline
β βββ plagiarism_utils.py # Chunking, embedding, scoring
β βββ ai_utils.py # LLM (Friendli/HuggingFace)
β βββ vector_utils.py # Embedding, similarity, pgVector
β βββ database.py / models.py # SQLAlchemy ORM
β βββ data/
β β βββ sample_academic_sources.json
β β βββ uploads/
β β βββ ...
βββ n8n_workflows/
β βββ academic-assignment-helper (flow1).json # Upload β Text Extraction
β βββ academic-assignment-helper (flow2).json # AI Result β Email Workflow
β βββ n8n_workflows_readme.md
βββ docker-compose.yml
βββ .env.example
βββ requirements.txt
βββ README.md| Feature | Description |
|---|---|
| AI Plagiarism Detection | Compares chunked assignment text against vectorized academic source embeddings using cosine similarity |
| RAG Analysis | Retrieves top-K similar sources and uses LLMs to generate structured insights |
| Automated n8n Workflows | Handles text extraction, notifications, and follow-up logic asynchronously |
| Rich HTML Email Reports | Sends formatted analysis reports with plagiarism scores and citation suggestions |
| Automated Assignment Submission | Students can approve sending their analyzed assignment directly to the instructor with academic integrity verification |
| End-to-End Docker Setup | FastAPI, PostgreSQL (pgVector), and n8n run in orchestrated containers |
- Language: Python 3.10 +
- Backend: FastAPI + SQLAlchemy
- Database: PostgreSQL + pgVector
- LLM Integration: Friendli.ai or HuggingFace
- Automation Engine: n8n
- Embeddings Model:
sentence-transformers/all-MiniLM-L6-v2 - Containerization: Docker + Docker Compose
git clone https://github.com/NatiSami21/Dedication.git
cd academic-assignment-helpercp .env.example .envEdit .env:
DATABASE_URL=postgresql+psycopg2://postgres:postgres@db:5432/academic_db
N8N_WEBHOOK_URL=http://n8n:5678/webhook/assignment
N8N_NOTIFY_URL=http://n8n:5678/webhook/notify-analysis-done
FRIENDLI_API_KEY=your_friendli_key
FRIENDLI_ENDPOINT_ID=your_model_idpip install -r requirements.txtdocker-compose build
docker-compose upThis starts:
- FastAPI Backend β
http://localhost:8000 - Swagger UI β
http://localhost:8000/docs - n8n Automation Engine β
http://localhost:5678 - PostgreSQL (pgVector)
-
Load Sample Academic Sources
docker exec -it academic_fastapi bash python -m backend.init_sources -
Generate Source Embeddings
curl -X POST http://localhost:8000/analysis/embed-sources
-
Create Vector Index
curl -X POST http://localhost:8000/analysis/index-sources
Visit β http://localhost:8000/docs
- Register (
/auth/register) - Login (
/auth/login) and copy JWT token - Upload (
/upload/) assignment file (.pdfor.docx) - n8n automatically extracts text β triggers
/analysis/ack - AI Analysis runs in background
- Retrieve results:
/analysis/{assignment_id}
Example response:
{
"status": "done",
"plagiarism_score": 12.5,
"flagged_sections": [...],
"suggested_sources": [...],
"research_suggestions": [...],
"citation_recommendations": [...]
}Trigger: POST /webhook/assignment
Pipeline:
- Receive upload event from FastAPI
- Read file from
/app/data/uploads - Extract text from
.pdfor.docx - Forward structured payload to
/analysis/ack
β Implements the AI processing trigger.
Trigger: POST /webhook/notify-analysis-done
Pipeline:
-
Receives AI + plagiarism results
-
Generates formatted HTML report
-
Sends email to the student using SMTP
-
Presents Send to Instructor form (Send & Wait node)
-
On approval:
- Sends email to instructor
- Attaches assignment file
- Includes βPlagiarism-Freeβ testimonial summary
β Supports full automated academic submission loop.
This is the extended feature you added in Phase 3.4.4.
Flow Logic:
-
Student receives analysis email β βSend to Instructor?β prompt
-
If approved and email field provided β n8n triggers a second email
-
Instructor receives:
- The analyzed assignment file
- Student details (name, ID, email)
- Verified plagiarism-free testimonial
- Summary metrics & citation recommendations
This process allows confidential self checking before instructor submission, preserving privacy yet supporting official submission automation.
- JWT-based student authentication
- SQLAlchemy ORM (no raw SQL injection risk)
- Input sanitization before vector embedding
- n8n communication restricted to internal Docker network
| Phase | Description | Status |
|---|---|---|
| 0 | Docker & FastAPI Setup | β |
| 1 | File Upload & Metadata | β |
| 2 | AI Plagiarism & Similarity Engine | β |
| 3.1β3.3 | Vector Embeddings + RAG Integration | β |
| 3.4.1β3.4.4 | n8n Automation & Submission Flow | β |
| 4 | Evaluation & Documentation | π |
Natinael Samuel
Software Engineer | Dedicated fullstack developer
afritioalberts1216@gmail.com
Addis Ababa, Ethiopia
+251904161978