Don't ask AI what to do. Let AI find what you're about to miss.
LifeOS-AI is a privacy-first personal context intelligence system designed to help users understand their personal context and make better use of information across their daily lives.
The project consists of a Next.js frontend and a FastAPI backend, with PostgreSQL used for persistent data storage and Google Gemini used as the AI provider.
- π€ AI-powered personal context intelligence
- π§ Privacy-first approach to personal information
- β‘ Next.js-based frontend
- π FastAPI backend
- ποΈ PostgreSQL database
- π JWT-based authentication infrastructure
- π Configurable CORS support
- π Gemini API integration
- π³ Docker Compose support for PostgreSQL
- β€οΈ Backend health-check endpoint
- π§ Environment-based configuration
Note: LifeOS-AI is currently under active development. Some integrations and features may still be incomplete or experimental.
LifeOS-AI follows a frontend/backend architecture:
ββββββββββββββββββββββββ
β User / Browser β
ββββββββββββ¬ββββββββββββ
β
βΌ
ββββββββββββββββββββββββ
β Next.js β
β Frontend β
β Port: 3000 β
ββββββββββββ¬ββββββββββββ
β
HTTP / API
β
βΌ
ββββββββββββββββββββββββ
β FastAPI β
β Backend β
β Port: 8000 β
βββββββββ¬ββββββββ¬βββββββ
β β
ββββββββββ ββββββββββ
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β PostgreSQL β β Google Gemini β
β Database β β AI Provider β
βββββββββββββββββββ βββββββββββββββββββ
LifeOS-AI/
β
βββ backend/
β βββ app/
β β βββ api/
β β βββ core/
β β βββ ...
β βββ requirements.txt
β βββ ...
β
βββ frontend/
β βββ app/
β βββ public/
β βββ package.json
β βββ ...
β
βββ .env.example
βββ docker-compose.yml
βββ vercel.json
βββ .gitignore
βββ README.md
The frontend is built using:
- Next.js
- React
- TypeScript
- Tailwind CSS
The frontend development server runs on port 3000 by default.
The backend is built using:
- Python
- FastAPI
- Uvicorn
- SQLAlchemy
- Alembic
- PostgreSQL
- Pydantic Settings
- Google Gemini
The backend API runs on port 8000 by default.
Before running the project locally, install:
- Git
- Node.js and npm
- Python 3
- PostgreSQL or Docker
- A Google Gemini API key
The frontend currently uses Next.js 16.3.3, React 19.2.8, and TypeScript ^5.
The backend dependencies include FastAPI, Uvicorn, SQLAlchemy, asyncpg, Alembic, Pydantic Settings, JWT authentication support, and the Google GenAI SDK.
git clone https://github.com/ANU5565/LifeOS-AI.git
cd LifeOS-AICreate a .env file from the provided example:
cp .env.example .envOn Windows PowerShell:
Copy-Item .env.example .envThe repository provides configuration for:
DATABASE_URL=postgresql+asyncpg://lifeos:lifeos_dev@localhost:5432/lifeos_db
SECRET_KEY=your-secret-key-change-this-in-production
ACCESS_TOKEN_EXPIRE_MINUTES=30
GEMINI_API_KEY=your-gemini-api-key
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
NEXT_PUBLIC_API_URL=http://localhost:8000
CORS_ORIGINS=http://localhost:3000The .env.example file contains the project's current database, security, AI provider, Google OAuth, frontend API, and CORS configuration.
Never commit your real .env file or API credentials to GitHub.
Generate a strong SECRET_KEY for non-development environments and provide your own Gemini API key.
From the repository root:
cd backendCreate a virtual environment:
python -m venv venv
.\venv\Scripts\Activate.ps1python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtRun:
uvicorn app.main:app --reload --port 8000The API should now be available at:
http://localhost:8000
FastAPI automatically provides interactive API documentation at:
http://localhost:8000/docs
LifeOS-AI provides a health endpoint:
GET /health
Open:
http://localhost:8000/health
Expected response:
{
"status": "healthy",
"service": "lifeos-ai",
"version": "0.1.0"
}The current backend implementation exposes this endpoint for connectivity and monitoring checks.
Open another terminal and return to the repository root:
cd frontendInstall dependencies:
npm installStart the development server:
npm run devThe frontend will be available at:
http://localhost:3000
The frontend currently defines the following npm scripts:
npm run dev
npm run build
npm run start
npm run lintLifeOS-AI uses PostgreSQL.
The default development configuration is:
Host: localhost
Port: 5432
Database: lifeos_db
Username: lifeos
Password: lifeos_dev
For local development, PostgreSQL can be started using the included Docker Compose configuration.
The repository includes a docker-compose.yml configuration for PostgreSQL using the postgres:16-alpine image.
From the project root, run:
docker compose up -dCheck running containers:
docker compose psThe PostgreSQL service exposes:
localhost:5432
To stop the services:
docker compose downTo stop the services and remove the database volume:
docker compose down -vWarning: Removing the volume deletes the PostgreSQL data stored in that Docker volume.
For local development, you can run the database, backend, and frontend separately.
From the project root:
docker compose up -dcd backend
# Activate your virtual environment first
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000cd frontend
npm install
npm run devThen open:
http://localhost:3000
| Variable | Purpose |
|---|---|
DATABASE_URL |
PostgreSQL connection string |
SECRET_KEY |
Application security/signing key |
ACCESS_TOKEN_EXPIRE_MINUTES |
JWT access-token lifetime |
GEMINI_API_KEY |
Google Gemini API authentication |
GOOGLE_CLIENT_ID |
Google OAuth client ID |
GOOGLE_CLIENT_SECRET |
Google OAuth client secret |
NEXT_PUBLIC_API_URL |
Backend API URL used by the frontend |
CORS_ORIGINS |
Allowed frontend origins |
Google OAuth variables are currently reserved for the Calendar integration work identified in the project configuration.
This repository includes vercel.json for deploying the Next.js frontend and Python backend together.
Set these environment variables in Vercel Project Settings:
DATABASE_URLSECRET_KEYGEMINI_API_KEYCORS_ORIGINSNEXT_PUBLIC_API_URL=/api/backend
NEXT_PUBLIC_API_URL=/api/backend routes frontend API requests through the Vercel backend rewrite instead of localhost.
Before submitting changes, run the available checks.
cd frontend
npm run lintnpm run buildMake sure the backend starts successfully:
uvicorn app.main:app --reload --port 8000Then verify:
http://localhost:8000/health
Contributions are welcome!
To contribute:
- Fork the repository.
- Clone your fork.
- Create a new branch.
git checkout -b feature/your-feature-name- Make your changes.
- Test the changes locally.
- Commit your changes.
git add .
git commit -m "feat: describe your change"- Push your branch.
git push origin feature/your-feature-name- Open a Pull Request against the
mainbranch.
- Keep changes focused on the relevant issue.
- Avoid changing existing functionality unnecessarily.
- Follow the existing project structure and coding style.
- Do not commit secrets or
.envfiles. - Test your changes before opening a Pull Request.
- Clearly describe what was changed in the Pull Request.
If you find a bug or have a feature request, please open an issue with:
- A clear title
- Description of the problem or proposed feature
- Steps to reproduce, if applicable
- Expected behaviour
- Actual behaviour
- Relevant logs or screenshots
- π About
- β¨ Features
- ποΈ Architecture
- π οΈ Tech Stack
- π Project Structure
- βοΈ Installation
- π Environment Variables
βΆοΈ Running Locally- π§ͺ Testing
- π€ Contributing
- π Issues
- π Pull Requests
- π License
- π‘οΈ Code of Conduct
- π Security
- π¬ Support
- π Contributors
LifeOS-AI is an actively developing project.
The current repository establishes the frontend, backend, database configuration, environment configuration, and foundational API structure. Additional personal-context intelligence and integrations can be developed as the project evolves.
If a license is added to the repository, this section should be updated with the corresponding license information.
Built and maintained by the LifeOS-AI contributors.
If you find the project useful, consider giving the repository a β on GitHub.