LumenAI is a powerful, AI-driven study companion and note-taking application designed to revolutionize how students and professionals learn. By leveraging advanced artificial intelligence, LumenAI automatically transforms lectures, audio recordings, and documents into comprehensive study materials, including summaries, flashcards, and interactive quizzes.
- 📄 Smart Document Processing: Upload PDF documents, syllabi, or lecture notes, and let the AI extract and structure the key information.
- 🎙️ Audio Transcription: Record live lectures or upload audio files. LumenAI uses OpenAI's Whisper model to transcribe audio with high accuracy.
- 🧠 Automated Study Materials: Automatically generate detailed summaries, interactive flashcards, and quizzes from your notes.
- 🚀 Seamless AI Fallback Architecture: Primarily powered by Google's Gemini AI for lightning-fast processing, with an automatic failover to local, privacy-first LLMs (via Ollama) when cloud rate limits are reached.
- 🔒 Secure & Sync: Powered by Supabase for robust authentication and real-time database syncing across devices.
Frontend (Mobile & Web)
- Flutter (Dart)
- Provider (State Management)
- Supabase Flutter SDK
Backend (API & AI Processing)
- Python 3.10+
- FastAPI (Web Framework)
- Google Gemini API (Primary LLM)
- Ollama & LLaMA 3.2 (Local Fallback LLM)
- OpenAI Whisper (Audio Transcription)
- Supabase (PostgreSQL Database & Auth)
Follow these instructions to set up the LumenAI project locally for development and testing.
Ensure you have the following installed on your local machine:
- Python 3.10+
- Flutter SDK (v3.10.4 or higher)
- Ollama (Optional, but highly recommended for local AI fallback)
- FFmpeg (Required for audio processing via Whisper)
The backend handles AI processing, database connections, document parsing, and transcription.
-
Navigate to the server directory:
cd server -
Set up a Python Virtual Environment:
python -m venv venv # Windows: venv\Scripts\activate # Mac/Linux: source venv/bin/activate
-
Install Dependencies:
pip install -r requirements.txt
-
Configure Environment Variables: Create a
.envfile in theserver/directory and add your keys:Gemini_API_key=YOUR_GEMINI_KEY SUPABASE_URL=YOUR_SUPABASE_URL SUPABASE_SERVICE_ROLE_KEY=YOUR_SUPABASE_SERVICE_KEY SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY USE_LOCAL_LLM=true OLLAMA_MODEL=llama3.2 WHISPER_MODEL=base
-
Start the Server:
python main.py
The server will run on
http://0.0.0.0:8001.
To ensure uninterrupted service when Gemini rate limits are reached, set up Ollama.
-
Download the model:
ollama run llama3.2
(Type
/byeto exit once downloaded). -
Run Ollama in the background:
ollama serve
The Flutter app connects to the local backend and Supabase.
-
Navigate to the app directory:
cd app -
Install Flutter Dependencies:
flutter pub get
-
Run the Application: Connect a device, start an emulator, or run on web/desktop.
flutter run
LumenAI is built with resilience in mind. You can test the automatic failover mechanism from Cloud (Gemini) to Local (Ollama):
- Happy Path (Gemini): Upload a document in the app. Check the backend terminal for
🚀 Processing Lecture: ...to ensure Gemini is handling the request. - Fallback Path (Ollama): Temporarily invalidate your
Gemini_API_keyin the.envfile and restart the server. Upload a document. The backend terminal will show⚠️ Gemini quota limit hitand🔄 Falling back to Local LLM (Ollama)..., successfully generating your study materials using your local machine.
We welcome contributions! Please follow these steps:
- Fork the repository.
- Create your feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Please refer to the TEAM_SETUP_AND_TESTING.md for more detailed testing protocols.
This project is licensed under the MIT License - see the LICENSE file for details.