Database Schema & Models
Overviewβ
EduVision ITS uses PostgreSQL as its primary relational database. The schema is designed to support high-throughput interactions while maintaining relational integrity for complex educational data.
Key extensions used:
pgvector: For storing and querying high-dimensional vector embeddings (768 dimensions forall-MiniLM-L6-v2).
ποΈ Core Tables (models_prod.py)β
These tables handle the administrative and structural aspects of the LMS.
Userβ
id(UUID, PK)tenant_id(FK -> Tenant)email(Unique)hashed_passwordrole(Enum:admin,teacher,student)
Courseβ
id(UUID, PK)teacher_id(FK -> User)titledescriptionis_published(Boolean)
Sessionβ
id(UUID, PK)student_id(FK -> User)course_id(FK -> Course)started_at(DateTime)ended_at(DateTime, Nullable)
π§ Knowledge Graph (models_knowledge.py)β
These tables persist the semantic structure of the course material and enable RAG.
KnowledgeSourceβ
id(UUID, PK)course_id(FK -> Course)filename(String)created_at(Float)
KnowledgeChunkβ
id(UUID, PK)source_id(FK -> KnowledgeSource)text(Text) - The actual educational content.position(Integer) - Order in original document.
KnowledgeEmbeddingβ
chunk_id(FK -> KnowledgeChunk)vector(Vector[384]) - PGVector column storing semantic embeddings fromsentence-transformers/all-MiniLM-L6-v2.
KnowledgeEdgeβ
source_chunk_id(FK)target_chunk_id(FK)relation_type(Enum:requires,part_of,similar_to)
π Adaptive Learning (models_adaptive.py)β
These tables store the probabilistic state of each learner.
LearnerSkill (BKT State)β
Tracks mastery for a specific skill.
student_id(FK)skill_id(String)mastery_probability(Float: 0.0 - 1.0)slip_probability(Float)guess_probability(Float)last_updated(DateTime)
LearnerSchedule (SRS State)β
Tracks review timing for spaced repetition.
student_id(FK)item_id(String)next_review(DateTime)interval_days(Integer)ease_factor(Float)
π Diagnostics (models_diagnostics.py)β
Used for psychometric analysis (IRT - Item Response Theory).
LearnerThetaβ
student_id(FK)theta(Float) - Latent ability estimate.standard_error(Float)
SkillDifficultyβ
skill_id(String)difficulty(Float) - Calibrated difficulty parameter.discrimination(Float) - How well the item differentiates ability levels.