Project Overview
This application centralizes library operations for schools and learning centers. Librarians get a live view of what students are reading, completion status, and reviews. An agentic AI backend (built with LangGraph + LangChain) analyzes reading history to generate book recommendations and surface insights like trending genres or stalled readers. Students have their own portal to see personalized picks and manage their checked-out books.
Technology Stack
Key Features
Librarian Dashboard
Track reading progress, completions, and reviews across classes; filter by grade, subject, or time window.
Student Portal
Students log in to view AI recommendations, manage checked-out items, and leave quick reviews.
Agentic Recommendations
LangGraph-powered agents analyze reading history and review sentiment to propose next-best books.
RAG with Pinecone
Book summaries and metadata are embedded for fast semantic retrieval that informs the recommender.
Multi‑Tenant
School, librarian, and student roles with isolated data boundaries; safe tenancy patterns with Prisma + Neon.
Role‑Based Access
Granular permissions for librarians vs. students; audit-friendly activity logs.


System Architecture
Recommendation & RAG Workflow
Ingestion
Book catalogs, summaries, and student activity are persisted in Neon via Prisma.
Vectorization
Book metadata/summaries embedded and stored in Pinecone for semantic search.
Agent Orchestration
LangGraph coordinates retrieval, policy checks, and ranking using LangChain tools.
Next.js API
API routes expose recommendations and dashboards to the React frontend.
Feedback Loop
Student reviews and outcomes feed back to improve future recommendations.
Technical Challenges & Solutions
Challenge: Multi‑Tenant Isolation
Keep school data fully separated while sharing infrastructure.
Solution: Scoped Schemas
Tenant-aware Prisma models and row‑level scoping patterns ensure clean isolation.
Challenge: Cold‑Start Latency
Slow first queries when hitting vector search for large catalogs.
Solution: Warm Caches
Preload popular vectors and memoize retrieval chains for common queries.
Challenge: Recommendation Quality
Balancing popularity with personalization for diverse reading levels.
Solution: Hybrid Ranking
Blend vector similarity with rules (reading level, recency, teacher lists) inside the agent graph.
Performance & Ops
- Connection pooling: Neon serverless with Prisma Accelerate for stable performance.
- Cached retrieval: Popular queries cached; vector lookups batched to reduce round‑trips.
- Minimal payloads: Compact recommendation responses for fast UI rendering.
- API hardening: Rate‑limits and input validation on Next.js routes.
User Experience
- Clear roles: Librarian analytics vs. student bookshelf views.
- Inline actions: One‑click checkout/return and quick‑review chips.
- Progress cues: Reading streaks, badges, and due‑date reminders.
- Responsive UI: React components tuned for desktop and tablets; accessible forms.
Future Enhancements
- Teacher dashboards with assignment‑aligned reading lists.
- Deeper review sentiment and trend analysis per cohort.
- Offline‑first student app for low‑connectivity schools.
- Fine‑tuned recommendation agents for age groups.