Welcome to the ScholarMind Administration Portal, a multi-tenant, SaaS-based School Information System (SIS) infused with a deeply integrated 26-agent cognitive AI fleet.
This repository enforces the V6 PRD Enterprise Standard, which radically restructures the platform into a centralized cloud deployment utilizing Drizzle ORM, Next.js Server Components, PostgreSQL Vector searching, and a dedicated AI swarm operated via Cerebras (llama3.1-70b).
The ScholarMind framework operates on a hybrid monolith/microservice architecture split distinctly between the Presentation/Core API Layer (Next.js) and the Cognitive Execution Layer (Python FastAPI).
- Framework: Next.js 15 (App Router)
- Database: Supabase PostgreSQL (via Pooler)
- ORM: Drizzle ORM — Fully typed, zero-abstraction relational querying.
- Styling: Tailwind CSS & Tremor React components for rich dashboards.
- Identity: NextAuth/IronSession tracking multi-tenant boundaries (
tenantId) explicitly for every query.
- Framework: Python FastAPI
- LLM Engine: Cerebras Inference (
llama3.1-70b) - Memory: Redis (Arq) for background queue management and cost-tracking.
- Embeddings:
pgvectorstored back in the Supabase instance for instant RAG retreival. - Agent Framework: Custom lightweight framework derived from LangChain principles, built for extreme latency optimization and strict tool execution oversight.
The V6 release implements strict structural domain boundaries based on the institutionType flag inherent to each Tenant.
- K-12 Foundation: Timetables, Homework, Digital Diaries, Guardian Portal, Transport.
- Higher Education Ecosystem: Course registration, Academic Advising, Research Grants, Placements.
- Group HQ / Core Operations: Global Fee orchestration, Staff HR, Analytics, Enterprise Evidence Trusts.
At the heart of the V6 transition is the Autonomous Agent Swarm. Instead of a single chatbot, ScholarMind delegates logic to 26 highly specialized, domain-isolated Python agents.
| Agent | Domain | Role Description |
|---|---|---|
| Synthesis Agent | Cross-Module | Acts as the "Headmaster", distributing queries to child agents and synthesizing results. |
| Fee Agent | Treasury | Pre-computes default risks, analyzes grade-wise payment trends. |
| Risk Agent | Core Ops | A hybrid correlation agent detecting overlapping signs of student decline (e.g., fee defaults + attendance drops). |
| Crisis Agent | Executive | Manages high-priority physical or institutional workflow emergencies. |
| Neuro Agent | Wellness | Assesses welfare indicators securely using anonymized sentiment processing. |
Agents possess a specialized requires_human_approval Tool flag. If the Swarm attempts to execute a high-risk system mutation (like modifying a Grade or Revoking a Certificate), it is physically blocked. Instead, it places the payload in the agent_approvals PostgreSQL queue and requests human signoff via the UI.
ScholarMind V6 aggressively enforces the Section 8.2 Persona Matrix:
GROUP_EXECUTIVE: Has overarching command-center access but limited edit capability across subsidiary campuses.SUPER_ADMIN: Tenant-level absolute authority.FINANCE_LEAD: Treasury, Overdue Invoices, Multi-currency splits.REGISTRAR: The only role permitted to perform Verifiable Credential issuance.TRUST_OFFICER: Dedicated access to the Procurement & Platform Audit Trail dashboards for SOC2 compliance logging.STUDENT_SUCCESS_COUNSELOR: Isolated access for sensitive interventions blocking general teacher prying.
(Review /apps/web/src/lib/rbac/permissions.ts for the direct authorization schemas).
- Setup Guide — For developer onboarding and environment mapping.
- Database Security Checks — RLS policies and SQL injection testing details.
- Historical PRDs — Review the evolution from V3 to V6.
- Audit Artifacts — The latest TRIVY, Npm, and SemGrep sweeps for SOC2 artifacts.
Generated mathematically aligned to the PRD V6 Standard implementation.