Skip to main content

Antigravity Desktop Companion โ€” AI-powered transparent desktop overlay with a 3D mascot

Project description

๐Ÿš€ Antigravity Desktop Companion

License: GPL v3 .NET 9 Python 3.12 React 19

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:

  1. Mistral Pixtral Vision (Cloud) โ€” Primary, requires MISTRAL_API_KEY
  2. OpenRouter (Cloud) โ€” Fallback, requires OPENROUTER_API_KEY
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mascot_ai-1.0.0.tar.gz (537.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mascot_ai-1.0.0-py3-none-any.whl (552.2 kB view details)

Uploaded Python 3

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

Hashes for mascot_ai-1.0.0.tar.gz
Algorithm Hash digest
SHA256 914d4ae6a9949577133fcb5158028a70ac6ba1a3ffbc76440da9c9e4194e9077
MD5 a8e08205566750256ce8862bc849b040
BLAKE2b-256 af1c7e227dce8e035ab521a47025be83596e1b06eb0768e877a036adfecb6439

See more details on using hashes here.

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

Hashes for mascot_ai-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 699f40fad7c606585a4e6a6634dd36f0983e8e04d9f113267f00943ca66b228f
MD5 1a3c2a704868b805dcd3009512293869
BLAKE2b-256 e3c6ad7461c37151929f4edd8cef98493bc3a09ea59a3f64d871aa65e8e45c00

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page