AI-Powered Voice Learning Assistant for Legal Education
A modern, browser-based voice assistant that enables Socratic dialogue between law students and AI tutors based on weekly course readings. Built for the University of Oklahoma College of Law to enhance student engagement through intelligent conversation about course materials.
StudyAI transforms traditional legal education by providing students with an interactive, voice-based learning experience. Students can engage in 5-minute Socratic dialogues with an AI tutor that has deep knowledge of their weekly readings, helping them develop critical thinking skills and better understand complex legal concepts.
- π€ Voice-First Interaction: Real-time WebRTC voice sessions with ElevenLabs AI voices
- π Intelligent Document Processing: LangChain-powered PDF ingestion, chunking, and vector indexing
- π§ Claude-Powered Reasoning: Anthropic Claude handles tutoring prompts and Socratic dialogue
- π¨ Modern Web Interface: Next.js frontend with responsive design and OU Law branding
- π Secure & Private: Local SQLite storage, JWT authentication, and FERPA-compliant design
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Browser (Next.js) β
β β’ Student/Professor Dashboards β
β β’ Voice Session Interface β
β β’ Real-time WebRTC Audio β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β HTTP/WebSocket
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ
β FastAPI Backend β
β β’ Authentication & Authorization β
β β’ LangChain Document Pipeline β
β β’ Vector Storage (FAISS/Chroma) β
β β’ Claude API Integration β
β β’ ElevenLabs Voice Management β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ
β SQLite Database β
β β’ Users, Courses, Weeks β
β β’ Document Metadata & Chunks β
β β’ Vector Embeddings β
β β’ Session History β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Python 3.9+
- Node.js 18+
- Anthropic API key
- ElevenLabs API key
git clone https://github.com/Digital-Initiative-OU-Law/studyai.git
cd studyai
# Copy environment template
cp .env.example .env
# Edit .env with your API keyscd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
python -m uvicorn app.main:app --reloadcd frontend
npm install
npm run devVisit http://localhost:3001 to access the application.
- Login with your email and password
- Select Role β Student
- Choose Course (Professor Harrington or Professor Brice)
- Pick Week (1-16)
- Select Voice from 5 AI voice options
- Start Session for a 5-minute Socratic dialogue
- Login with professor credentials
- Select Role β Professor
- Choose Week for content upload
- Drag & Drop weekly PDF readings
- Monitor Processing status (extract β chunk β embed β index)
- View Analytics on student engagement
- FastAPI: High-performance async web framework
- SQLite: Zero-configuration local database
- LangChain: Document processing and AI orchestration
- FAISS/Chroma: Local vector storage for embeddings
- SentenceTransformers: Local embedding generation
- Next.js 15: React framework with App Router
- TypeScript: Type-safe development
- Tailwind CSS: Utility-first styling
- shadcn/ui: Accessible component library
- WebRTC: Real-time voice communication
- Anthropic Claude: LLM for reasoning and tutoring
- ElevenLabs: AI voice synthesis and WebRTC
- Local Embeddings: Privacy-focused vector generation
# Required
ANTHROPIC_API_KEY=your_claude_api_key
ELEVEN_API_KEY=your_elevenlabs_api_key
JWT_SECRET=your_jwt_secret
# Optional
SESSION_MAX_SECONDS=300
NEXT_PUBLIC_API_BASE=http://localhost:8000
NEXT_PUBLIC_VOICE_IDS=voice1,voice2,voice3,voice4,voice5The system uses SQLite with the following core tables:
users: Authentication and role managementcourses: Course structure and professor assignmentsweeks: Weekly content organizationreadings: PDF metadata and file pathschunks: Text chunks for vector searchsummaries: AI-generated weekly summariesconversations: Session transcripts and metadataaudio_blobs: Voice session recordings
studyai/
βββ backend/ # FastAPI application
β βββ app/ # Core application code
β βββ data/ # Local storage
β βββ requirements.txt # Python dependencies
βββ frontend/ # Next.js application
β βββ app/ # App Router pages
β βββ components/ # React components
β βββ package.json # Node dependencies
βββ docs/ # Project documentation
β βββ Plan.md # Architecture overview
β βββ Backend.md # Backend implementation
β βββ Frontend.md # Frontend implementation
β βββ Progress.md # Development progress
βββ .env # Environment configuration
- FERPA Compliance: Student data protection and privacy
- Local Storage: All data stored locally, no cloud dependencies
- JWT Authentication: Secure, short-lived tokens
- Role-Based Access: Student/Professor/Admin permissions
- Content Moderation: AI-powered conversation filtering
- Session Limits: 5-minute maximum voice sessions
# Backend (Port 8000)
cd backend
python -m uvicorn app.main:app --reload
# Frontend (Port 3001)
cd frontend
npm run dev# Backend tests
cd backend
pytest
# Frontend tests
cd frontend
npm test# Reset database
cd backend
rm data/databases/*.db
python -m alembic upgrade head
# View data
sqlite3 data/databases/main.db- Voice Latency: < 500ms round-trip
- Document Processing: < 30s for 50-page PDF
- Search Response: < 200ms for vector similarity
- Session Start: < 3s to first audio
- UI Response: < 100ms for all interactions
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow PEP 8 for Python code
- Use TypeScript strict mode for frontend
- Maintain comprehensive documentation
- Write clear commit messages
- Test thoroughly before submitting
This project is licensed under the MIT License - see the LICENSE file for details.
Principal Investigators: Sean A. Harrington & Kenton Brice
Institution: University of Oklahoma College of Law
Project: Digital Initiative for Legal Education
- Anthropic: Claude AI models for intelligent tutoring
- ElevenLabs: High-quality voice synthesis
- LangChain: Document processing and AI orchestration
- OU Law Faculty: Domain expertise and guidance
For technical support or questions about the project:
- Issues: GitHub Issues
- Documentation: See the
/docsfolder for detailed guides - Contact: Reach out to the OU Law Digital Initiative team
StudyAI - Transforming legal education through intelligent voice interaction.