LifeOS is a comprehensive learning platform, powered by AI, designed to make the learning process interactive, personalized, and efficient. Whether you're preparing for an exam, building new skills, or simply exploring new knowledge, LifeOS empowers you with advanced tools to generate quizzes, organize resources, and map out your learning journey.
-
Generate Quizzes from Various Sources:
- With LifeOS, you can create personalized quizzes in seconds from various sources like a prompt, YouTube videos, articles, or documents. Simply input the content, and LifeOS will automatically generate quiz questions tailored to your needs.
-
Take Interactive Tests:
- After generating quizzes, you can take them right within the platform. LifeOS scores your performance and helps you track your progress over time, allowing you to improve and retain knowledge more effectively.
-
Build Personalized Learning Roadmaps:
- LifeOS helps you design custom learning roadmaps based on your specific goals, topics of interest, or skills you want to develop. Whether you're a student or a lifelong learner, these roadmaps provide structured guidance to navigate complex topics.
-
Save Articles and Videos for Later:
- Easily save articles or videos to revisit later. LifeOS organizes your resources and provides readable formats for articles so that you can focus on learning, without distractions.
-
Summaries and Key Insights:
- Save time by getting concise summaries and key insights from long articles. LifeOS distills important information, helping you grasp the essential concepts quickly.
LifeOS is designed with learners in mind. Whether you're a student preparing for an exam, a professional upskilling, or someone curious to explore new topics, LifeOS provides the tools to turn content into interactive learning experiences. By merging quiz generation, resource management, and personalized learning paths, LifeOS makes it easier for you to stay organized and achieve your educational goals.
The backend of LifeOS is built using a microservice-based architecture in Spring Boot, ensuring modularity and scalability. Here’s a brief overview of each service:
- API Gateway: Handles incoming client requests, routing, and security, acting as the entry point to all services.
- Service Registry: Manages service discovery, enabling dynamic communication between microservices.
- Load Balancer: Distributes traffic across multiple service instances to ensure availability and optimal performance.
- AI Service: Generates quizzes, insights, and summaries from prompts, YouTube videos, and articles.
- User Service: Manages user data, authentication, and profile preferences.
- Quiz Service: Handles quiz generation, storage, and scoring.
- Pathways Service: Builds personalized learning roadmaps based on user goals.
- Resource-Loader Service: Processes external resources like articles and videos and stores them in the Chroma Vector Database.
- Feed Service: Provides users with a dynamic feed of articles, videos, and learning materials.
- Database Layer: All microservices share the same database instance, This approach simplifies database configuration and centralizes data, but it also introduces tighter coupling between services and can limit individual database scaling or isolation. the Chroma Vector Database handles vectorized data for advanced search.
- Scalability: Each service can scale independently based on its own demand.
- Resilience: Service failures are isolated, preventing system-wide crashes.
- Flexibility: Faster deployment and technology variation per service are possible with Spring Boot's lightweight and modular framework.
LifeOS uses JWT-based authentication to manage user sessions securely. The process includes issuing short-lived JWT tokens and longer-lived refresh tokens for seamless user experience.
-
Login Request:
- The client sends a login request to the API Gateway with credentials.
- The API Gateway forwards it to the User Service, which verifies the credentials with the Database.
- If valid, a JWT token and a refresh token are issued.
-
Token Storage:
- Both tokens are stored in HTTP-only cookies to enhance security.
- The user is redirected to the app after login, with tokens in the cookies.
-
< 8000 strong>Accessing Protected Routes:
- The API Gateway validates the JWT token from the cookie when accessing protected routes.
- If valid, the user proceeds to the requested service.
-
Token Expiration and Refresh:
- If the JWT token expires, the client automatically requests a new one using the refresh token.
- The User Service validates the refresh token and issues a new JWT token, which is set in the cookie.
-
Token Revocation:
- On logout, the refresh token is invalidated, preventing further token generation until the user logs in again.
- Stateless: No need for session data on the server, as all info is in the token.
- Secure: Tokens stored in HTTP-only cookies prevent client-side tampering.
- Seamless User Experience: Automatic token refresh without re-authentication.
LifeOS leverages RAG-based (Retrieval-Augmented Generation) methods combined with Google Cloud's Vertex AI and Spring AI to generate quizzes, summaries, and key insights from user-provided content, such as YouTube videos, articles, and documents.
-
Quiz Service: Receives user prompts, URLs (YouTube, Articles), and other resources through the quiz creation form and forwards them to the AI Service.
-
AI Service: Handles content generation by orchestrating the interaction between the quiz service, vector similarity search, and Google Cloud’s Vertex AI. It retrieves relevant chunks from the vector store to generate meaningful responses based on the user's input.
-
Resource Loader Service:
- Parses various resources (YouTube transcripts, articles, documents).
- Runs an ETL Pipeline to load, split, and embed content into a Chroma vector store for efficient retrieval during content generation.
-
Vector Similarity Search: Retrieves the most relevant chunks based on user prompts, ensuring high-quality quiz questions or summaries are created.
- Content Processing: User-provided content is parsed and split into manageable chunks via the ETL pipeline.
- Embedding and Storing: The chunks, along with metadata, are embedded and stored in the Chroma vector store for future retrieval.
- Content Generation: When generating quizzes or summaries, the AI service retrieves the most relevant chunks from the vector store and feeds them to the chat model in Vertex AI, allowing it to augment the generation process with real data.
- Google Cloud's Vertex AI (Gemini Model): Handles the actual generation of quizzes, summaries, and insights. The system uses the gemini-pro-1.5 model to process user prompts and produce highly contextual content.
- Spring AI: Facilitates the connection between microservices and the AI models, ensuring smooth communication and result handling.
- RAG-Based Generation: Improves the accuracy and relevance of generated content by grounding it in the user's actual data.
- Scalable Microservices: Each service in the architecture is independently scalable, allowing better performance and resource management.
- Efficient Search and Retrieval: Using a vector store ensures quick retrieval of the most relevant content chunks, optimizing the generation process.
| Component | Technology/Dependency | Description |
|---|---|---|
| Frontend | Next.js | React framework for building server-rendered or statically generated web applications. |
| Backend | Spring Boot | Framework for building stand-alone, production-grade Spring applications. |
| Spring Cloud Eureka | Service discovery tool using Netflix Eureka. | |
| Spring Cloud Gateway | API Gateway for routing and load balancing requests in a microservices architecture. | |
| Spring Security | Security framework providing authentication, authorization, and other security features. | |
| Spring Data JPA | Simplifies data access using JPA (Java Persistence API). | |
| Spring AI | Spring framework for integrating AI services. | |
| Spring Cloud OpenFeign | Declarative REST client for simplifying microservice communication. | |
| ModelMapper | Object mapping framework to automatically map DTOs to entities and vice versa. | |
| Security | jjwt-api | Java JWT (JSON Web Token) library for creating and validating JWT tokens. |
| Database | PostgreSQL | Open-source relational database management system. |
| Chroma Vector Store | Vector database for storing embeddings and performing similarity searches. | |
| AI Model | Google Vertex AI Gemini-1.5 Pro | AI model used for text embedding and content generation. |
| Web Content Parsing | Readability4j | Java library for extracting readable content from web pages. |
| YouTube Transcript API | API to extract transcripts from YouTube videos. | |
| jsoup | Java library for working with real-world HTML and web scraping. | |
| Markdown | Flexmark-all | Java library for rendering and parsing Markdown to HTML and other formats. |
| CSS Framework | Tailwind CSS | Utility-first CSS framework for rapid UI development. |
| Design Tool | Figma | Collaborative design tool for interface design and prototyping. |
- Clone the project from the GitHub Repository:
git clone <repository-url>
-
Navigate to the project's root directory:
cd <project-root-directory>
-
In the client folder, update the
.envvariables with your API keys and required variables:cd client nvim .env # or use your preferred text editor
-
Go to the microservice folder:
cd ../{microservice} -
Update the secrets in the
secrets.yamlfile located in{ServiceModule}/src/main/resourceswith your own set values:secrets: datasource: url: {database url} username: {database username} password: {database password}
Note: Replace the values for
url,username, andpasswordwith your actual database credentials.
-
To use the Vertex AI API, ensure you have a Google Cloud project set up with the Vertex AI API enabled. Follow these steps:
- Go to the Google Cloud Console.
- Create a new project or select an existing project.
- Navigate to APIs & Services > Library.
- Search for Vertex AI API and click on it.
- Click Enable to activate the API for your project.
-
Set up authentication:
- Go to APIs & Services > Credentials.
- Click on Create Credentials and choose Service Account.
- Fill in the required details and click Create.
- After the service account is created, grant it the necessary roles, such as Vertex AI User.
- Click Done, then click on your service account to manage keys.
- Under the Keys tab, click Add Key > Create New Key and choose JSON. Download the key file.
-
Set the
GOOGLE_APPLICATION_CREDENTIALSenvironment variable to point to your JSON key file:export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/service-account-file.json"
After setting up vertex AI, change the secrets.yaml file of lifeos-ai-microservice, lifeos-resource-loader with respective values:
secrets:
vertex-ai-project-id: lifeos-4911
vertex-ai-location: us-central1- Ensure you have Docker installed on your machine. You need to turn on the Docker engine before running the resource-loader.
- If you haven't installed Docker yet, download and install it from Docker's official website.
- Once installed, start the Docker engine by running Docker Desktop or using the terminal command:
open /Applications/Docker.app # For macOS # or sudo systemctl start docker # For Linux
-
Open a terminal in the client folder:
cd client -
Install project dependencies with:
npm install
-
Start the frontend development server with:
npm run dev
-
Install dependencies for the backend from the
pom.xmlfile. You can use Maven:cd ./microservice mvn install -
Run the main files of all modules. Consider using tools like IntelliJ for building and running the system.


