Antigravity Desktop Companion โ AI-powered transparent desktop overlay with a 3D mascot
Project description
๐ Antigravity Desktop Companion
An ephemeral, real-time visual AI assistant that lives on your Windows desktop as a transparent, click-through overlay. It combines high-performance native screen capture, a 3D animated character with chat UI, and a vision-capable multi-provider AI backend.
โจ Features
- Desktop Overlay โ Transparent, always-on-top window with DWM Glass & click-through support
- 3D Animated Mascot โ Soldier character rendered via Three.js / React Three Fiber
- Real-Time Vision AI โ Captures your screen, sends it to a vision LLM, and streams responses back
- Multi-Provider Fallback โ Mistral Pixtral โ OpenRouter โ OpenAI (with optional local LLM support via LM Studio / Ollama)
- ROI Diffing โ Skips redundant inference when the screen hasn't changed
- WebSocket Streaming โ Binary protocol for low-latency image + token streaming
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ WINDOWS DESKTOP SHELL โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ C# Native Host (.NET 9 / WPF) โ
โ โโโ DWM Sheet Glass + Win32 TOPMOST / ToolWindow styles โ
โ โโโ Dynamic hit-testing (WM_NCHITTEST) โ
โ โโโ Microsoft.Web.WebView2 (IPC Bridge) โ
โ โ โ
โ โโโโบ React + Three.js UI (Vite SPA) โ
โ โ โโโ 3D Character (Soldier.glb via R3F) โ
โ โ โโโ Chat Bubble, Input Bar & Status Pill โ
โ โ โโโ useNativeBridge / useAIStream hooks โ
โ โ โ
โ โโโโบ Screen Capture Pipeline โ
โ โโโ GPU-accelerated capture (ScreenCapture.cs) โ
โ โโโ ActiveWindowTracker (ROI utility) โ
โ โ
โ โผ WebSocket (ws://localhost:8000/ws) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Python AI Orchestrator (FastAPI + uvicorn) โ
โ โโโ WebSocket Router (/ws) โ
โ โโโ Vision Preprocessor (ROI crop, Lanczos, diff threshold) โ
โ โโโ Multi-Provider LLM Engine (Mistral โ OpenRouter โ OpenAI) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Prerequisites
| Tool | Version | Purpose | Install |
|---|---|---|---|
| .NET SDK | 9.0+ | Native Host (WPF) | dotnet.microsoft.com |
| Python | 3.12+ | AI Orchestrator | python.org |
| uv | Latest | Python env & package manager | pip install uv or docs.astral.sh |
| Node.js | 20+ | UI Frontend (React/Vite) | nodejs.org |
| npm | 10+ | Package manager for Node | Bundled with Node.js |
Windows only: The native host tier uses WPF and Win32 APIs, so it requires Windows 10 (build 19041+) or later.
๐ Quick Start
1. Clone the Repository
git clone https://github.com/mohitantil3399/Mascot_ai.git
cd Mascot_ai
2. Configure Environment
# Copy the example environment file and add your API key
cp apps/ai-orchestrator/.env.example apps/ai-orchestrator/.env
# Edit .env and set your MISTRAL_API_KEY (free at https://console.mistral.ai)
3. Start the AI Orchestrator (Tier 1)
cd apps/ai-orchestrator
uv venv .venv --python 3.12
uv pip install -e .
.venv\Scripts\python.exe main.py
# Server starts at http://localhost:8000
4. Start the UI Frontend (Tier 2)
cd apps/ui-frontend
npm install
npm run dev
# Dev server starts at http://localhost:3000
5. Start the Native Host (Tier 3)
# Copy and customize the example scripts first:
cp apps/native-host/run_host.ps1.example apps/native-host/run_host.ps1
cd apps/native-host
dotnet build
.\run_host.ps1
One-Click Launch (Optional)
# Copy and customize the example launch script:
cp launch_all.bat.example launch_all.bat
# Edit launch_all.bat if needed, then double-click it to start all three tiers.
๐ฅ๏ธ Developer CLI โ mascot command
Install the mascot CLI once from the repo root and manage the entire project from a single command:
# From repo root โ one-time install into the orchestrator's venv
cd apps/ai-orchestrator
uv pip install -e ../../ # installs mascot-cli into this venv
# Activate the venv
.venv\Scripts\Activate.ps1
# Now use the mascot command:
mascot --help
Available commands:
| Command | Description |
|---|---|
mascot env |
Interactive first-time setup โ copies .env.example and prompts for API keys |
mascot env --force |
Re-run key setup even if .env already exists |
mascot install |
Install all dependencies (Python + Node + .NET) |
mascot install ui |
Install only Node.js frontend deps |
mascot install orchestrator |
Install only Python backend deps |
mascot install host |
Restore only .NET native host deps |
mascot start |
Start all 3 tiers in one terminal (Ctrl+C to stop all) |
mascot start orchestrator |
Start only the Python FastAPI server (port 8000) |
mascot start ui |
Start only the Vite dev server (port 3000) |
mascot start host |
Build and start only the .NET WPF host |
mascot build |
Build production artifacts (UI + dotnet publish) |
mascot status |
Probe ports 8000 & 3000 and show a health table |
Recommended first-run workflow:
mascot env # set up .env and API keys
mascot install # install all dependencies
mascot start # launch everything
๐ Project Structure
Mascot_ai/
โโโ apps/
โ โโโ ai-orchestrator/ # Python FastAPI backend (vision LLM engine)
โ โ โโโ api/ # WebSocket endpoint
โ โ โโโ inference/ # LLM engine, prompts, vision preprocessing
โ โ โโโ main.py # FastAPI entry point
โ โ โโโ .env.example # Environment template (copy to .env)
โ โ โโโ pyproject.toml # Python dependencies
โ โ
โ โโโ native-host/ # C# WPF desktop overlay (.NET 9)
โ โ โโโ NativeInterop/ # Win32 APIs, screen capture, window tracking
โ โ โโโ Services/ # WebSocket client, WebView2 bridge
โ โ โโโ DesktopCompanion.csproj
โ โ โโโ run_host.ps1.example # Build & run template
โ โ โโโ sign_build.ps1.example # Code-signing template
โ โ
โ โโโ ui-frontend/ # React 19 + Three.js UI (Vite)
โ โโโ src/
โ โ โโโ components/ # Chat bubbles, input bar, 3D pet canvas
โ โ โโโ hooks/ # useAIStream, useNativeBridge
โ โ โโโ main.tsx # App entry point
โ โโโ package.json
โ โโโ vite.config.ts
โ
โโโ libs/
โ โโโ shared-types/ # TypeScript protocol definitions
โ โโโ protocol.ts # WebSocket & IPC message schemas
โ
โโโ launch_all.bat.example # One-click launcher template
โโโ PROJECT_MAP.md # Detailed architecture documentation
โโโ CONTRIBUTING.md # Contributor guidelines
โโโ LICENSE # GPL-3.0
๐ง Configuration
LLM Provider Fallback Chain
The AI orchestrator tries providers in order until one succeeds:
- Mistral Pixtral Vision (Cloud) โ Primary, requires
MISTRAL_API_KEY - OpenRouter (Cloud) โ Fallback, requires
OPENROUTER_API_KEY - OpenAI GPT-4o (Cloud) โ Fallback, requires
OPENAI_API_KEY
For fully offline inference, you can enable local providers (LM Studio or Ollama) by uncommenting the relevant sections in apps/ai-orchestrator/inference/engine.py and setting the environment variables in your .env file.
See .env.example for all available configuration options.
๐ค Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines on:
- Setting up your development environment
- Code style and commit conventions
- Submitting pull requests
๐ License
This project is licensed under the GNU General Public License v3.0 โ see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mascot_ai-1.0.0.tar.gz.
File metadata
- Download URL: mascot_ai-1.0.0.tar.gz
- Upload date:
- Size: 537.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
914d4ae6a9949577133fcb5158028a70ac6ba1a3ffbc76440da9c9e4194e9077
|
|
| MD5 |
a8e08205566750256ce8862bc849b040
|
|
| BLAKE2b-256 |
af1c7e227dce8e035ab521a47025be83596e1b06eb0768e877a036adfecb6439
|
File details
Details for the file mascot_ai-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mascot_ai-1.0.0-py3-none-any.whl
- Upload date:
- Size: 552.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
699f40fad7c606585a4e6a6634dd36f0983e8e04d9f113267f00943ca66b228f
|
|
| MD5 |
1a3c2a704868b805dcd3009512293869
|
|
| BLAKE2b-256 |
e3c6ad7461c37151929f4edd8cef98493bc3a09ea59a3f64d871aa65e8e45c00
|