Inspiration

The inspiration came from the need for a truly offline AI-powered study tool that respects user privacy while providing advanced learning capabilities. With students often lacking reliable internet access and growing privacy concerns, we wanted to create a personal AI tutor that runs entirely on local hardware without compromising functionality.

What it does

AI FlashCards transforms any PDF into an interactive learning experience using local AI models. It combines advanced PDF annotation (7 types including highlights, notes, shapes) with dual AI models - gpt-oss:20b for text understanding and llava:13b for visual content analysis. The AI can see your annotations and prioritizes content you've highlighted, generating smart flashcards that test understanding rather than memorization. Everything runs 100% offline after initial setup.

How we built it

We built it using Spring Boot (backend) with Spring AI for Ollama integration, JavaFX for the desktop UI, and Apache PDFBox for PDF processing. The architecture uses optimized prompt engineering (2000-4000 char windows) to ensure fast local inference. We implemented continuous PDF scrolling with real-time annotation layers and integrated two AI models through Ollama's REST API for comprehensive text and visual analysis.

Challenges we ran into

  • JavaFX Threading: Crashes due to improper thread management between Spring Boot and JavaFX
  • Memory Management: Handling large AI models (40GB + 8GB) efficiently on consumer hardware
  • FXML Injection: Field naming mismatches causing null pointer exceptions in flashcard generation
  • Zoom Calculations: Incorrect math causing Fit Width/Page buttons to compound zoom levels
  • Native Access Warnings: JVM restrictions requiring specific flags for JavaFX on newer Java versions

Accomplishments that we're proud of

  • Created a fully functional offline AI study assistant combining two large language models
  • Implemented 7 different PDF annotation types with real-time AI awareness
  • Achieved 2-5 second AI response times with intelligent prompt optimization
  • Built continuous PDF scrolling with smooth performance
  • Made AI-powered education accessible without internet connectivity

What we learned

  • Local AI models can provide powerful functionality without cloud dependencies
  • Prompt engineering is crucial for performance - reducing context from 10K to 2-4K chars dramatically improves speed
  • JavaFX and Spring Boot require careful thread management to work together
  • Multi-modal AI (text + vision) significantly enhances educational applications
  • User annotations provide valuable context that AI can leverage for personalization

What's next for VisionAI

  • Support for more document formats (EPUB, DOCX, Markdown)
  • Collaborative study features over local networks
  • Integration with popular flashcard platforms (Anki, Quizlet export)
  • Custom model fine-tuning interface for specialized subjects
  • Voice-based interaction for accessibility
  • Analytics dashboard to track learning progress

Built With

  • gpt-oss
  • java
  • java21
  • llava
  • ollama
  • springai
  • springboot
Share this project:

Updates