Skip to content

About

๐Ÿ‘๏ธ Ambient AI agent that watches your screen silently and responds before you finish explaining. Gemini 2.0 Flash + FastAPI + Cloud Run.

Resources

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ‘๏ธ ARGUS โ€” Ambient AI Screen Intelligence Agent

"Every other AI waits to be asked. ARGUS has already been watching."

Cloud Run Gemini FastAPI Tests Coverage Type Checked Security License


๐ŸŒ Live Deployment

Resource Link
Dashboard argus-309958828415.asia-south1.run.app
Health API /health
Stats API /stats
Observations API /api/observations
Actions API /api/actions
OpenAPI Docs /docs

๐Ÿ’ก The Problem

Every AI coding assistant today starts from zero context.

You open ChatGPT, Claude, or Copilot. You paste your error. You explain which file you're in, what you were trying to do, what you already tried. Every. Single. Time.

This is a product-level failure. Humans don't work in isolation โ€” they work in continuous workflows, switching between apps, debugging across tabs, referencing docs while editing code. The context is already there, on-screen for dozens of seconds. But current AI can't see it.

๐Ÿ”‘ The Insight

Your screen already contains the context that every AI assistant asks you to type.

If a system could silently observe what you're doing โ€” the errors, the apps, the URLs, the files โ€” and maintain a rolling memory of your workflow, then when you finally say "help", it would already know more about your problem than you could explain in a paragraph.

โœจ The Solution โ€” ARGUS

ARGUS is the first ambient AI agent that builds context by watching, not asking.

  1. Capture โ€” Every 10 seconds, the client captures your screen
  2. Filter โ€” NumPy pixel-diff drops unchanged frames (~80% API savings)
  3. Analyze โ€” Gemini 2.0 Flash Vision extracts structured context
  4. Store โ€” Observations persist to Cloud Firestore + GCS with secrets from Secret Manager
  5. Command โ€” Say "ARGUS" โ†’ it already knows your problem before you finish explaining
  6. Act โ€” Click, type, open URLs โ€” with confidence thresholding for safety

ARGUS doesn't ask questions. It was already watching.


๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     YOUR MACHINE                            โ”‚
โ”‚                                                             โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    Screenshot     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚  mss         โ”‚ โ”€โ”€every 10 secโ”€โ”€โ–ถ โ”‚  screen_capture  โ”‚    โ”‚
โ”‚  โ”‚  (capture)   โ”‚                   โ”‚  + pixel diff    โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                   โ”‚  filter          โ”‚    โ”‚
โ”‚                                     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                            โ”‚              โ”‚
โ”‚  โ”‚  SpeechRec   โ”‚ โ”€โ”€"ARGUS" wake wordโ”€โ”€โ–ถ     โ”‚              โ”‚
โ”‚  โ”‚  (mic/kbd)   โ”‚                            โ”‚              โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                            โ”‚              โ”‚
โ”‚                                              โ”‚ WebSocket    โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                            โ”‚              โ”‚
โ”‚  โ”‚  PyAutoGUI   โ”‚ โ—€โ”€โ”€ coordinates โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜              โ”‚
โ”‚  โ”‚  (executor)  โ”‚                                           โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ”‚ WebSocket (persistent)
                           โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              GOOGLE CLOUD RUN (Backend)                     โ”‚
โ”‚                                                             โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚              FastAPI + WebSocket Server               โ”‚  โ”‚
โ”‚  โ”‚  Security: CORS ยท CSP strict-dynamic ยท Rate Limit    โ”‚  โ”‚
โ”‚  โ”‚  Auth: API Key via Secret Manager ยท Pydantic V2      โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚             โ”‚                                              โ”‚
โ”‚    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚    โ”‚  Gemini 2.0     โ”‚      โ”‚  Context Manager        โ”‚   โ”‚
โ”‚    โ”‚  Flash Vision   โ”‚      โ”‚  Rolling 1-min window   โ”‚   โ”‚
โ”‚    โ”‚  + retry/backoffโ”‚      โ”‚  deque O(1) ops         โ”‚   โ”‚
โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚                                      โ”‚                     โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚ Secret Mgr  โ”‚  โ”‚Cloud Loggingโ”‚ โ”‚ Cloud Firestore  โ”‚    โ”‚
โ”‚  โ”‚ credentials โ”‚  โ”‚ observabilityโ”‚ โ”‚ observations,    โ”‚    โ”‚
โ”‚  โ”‚ at runtime  โ”‚  โ”‚ + alerting  โ”‚ โ”‚ actions,sessions โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                                                            โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚            Google Cloud Storage                     โ”‚    โ”‚
โ”‚  โ”‚  screenshots + JSONL action logs (dual-write)      โ”‚    โ”‚
โ”‚  โ”‚  tenacity exponential backoff on uploads            โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿš€ Google Cloud Services (7 services integrated)

Service Purpose Implementation
Cloud Run Serverless container deployment Auto-scaling, PORT env, healthcheck
Cloud Build CI/CD pipeline cloudbuild.yaml โ€” build + push + deploy
Cloud Storage Screenshot + log persistence Dual-write with tenacity exponential backoff
Cloud Firestore Structured data persistence CRUD for observations, actions, sessions
Secret Manager Runtime credential loading No .env in production, env var fallback
Cloud Logging Production observability Python logging โ†’ Cloud Logging integration
Gemini 2.0 Flash Multimodal screen analysis Vision + coordinate detection + retry

๐Ÿ”’ Security โ€” Zero-Trust Architecture

Full security policy: SECURITY.md

OWASP Risk Mitigation
A03:2021 Injection Pydantic V2 strict validation, sanitize_command(), no shell=True, URL scheme restriction
A04:2021 Insecure Design Per-IP rate limiting (token bucket), confidence thresholding on actions
A05:2021 Misconfiguration CSP strict-dynamic, X-Frame-Options DENY, HSTS, security headers middleware
A07:2021 Auth Failures HMAC constant-time key comparison, Secret Manager for production creds
A10:2021 SSRF URL validation restricting to http:// and https:// only

Security test coverage:

  • tests/test_security.py โ€” Rate limiting, auth, sanitization
  • tests/test_vulnerabilities.py โ€” ReDoS, command injection, path traversal, XSS
  • tests/test_property.py โ€” Hypothesis property-based fuzzing (500+ generated inputs)

๐Ÿงช Testing โ€” 130+ Assertions, 80%+ Coverage

pytest tests/ -v --cov=backend --cov=client --cov-report=term-missing
Test File Tests Coverage Area
test_argus.py 49 Core: GeminiAgent, ContextManager, Storage, API, WebSocket
test_security.py 18 Rate limiting, auth, sanitization, URL validation
test_vulnerabilities.py 20+ ReDoS, injection, path traversal, XSS, timing attacks
test_property.py 10+ Hypothesis fuzzing: 500+ generated edge-case inputs
test_executor.py 10 Click, type, open_url, confidence thresholding
test_firestore.py 11 Firestore CRUD, graceful degradation
test_integration.py 5 End-to-end WebSocket flows
test_screenshot.py 6 Pixel diff detection, resolution changes
test_voice_listener.py 6 Mic detection, keyboard fallback, wake word
test_gemini.py 2 Agent initialization

Quality tools:

  • mypy --strict โ€” Full type checking
  • ruff โ€” Linting with flake8-bandit security rules
  • hypothesis โ€” Property-based testing
  • pytest-cov โ€” Coverage enforcement (75% minimum)

โ™ฟ Accessibility โ€” WCAG AA+

Feature Implementation
Skip-to-content link First focusable element in DOM
ARIA live regions aria-live="polite" on stats, agent status, health check, action log
Focus management New actions append without stealing focus (WCAG 3.2.1)
Keyboard navigation All cards, logs, and interactive elements are tabbable
Focus-visible styles Custom 3px focus ring on all interactive elements
Reduced motion prefers-reduced-motion media query disables animations
High contrast prefers-contrast: high adjusts colors for readability
Semantic HTML5 header, main, footer, section, nav, article landmarks
Heading hierarchy Single <h1>, proper <h2>/<h3> nesting

๐Ÿ“ Project Structure

argus-agent/
โ”œโ”€โ”€ pyproject.toml               # Project config: pytest, coverage, mypy, ruff
โ”œโ”€โ”€ Dockerfile                   # Cloud Run (non-root user, healthcheck)
โ”œโ”€โ”€ cloudbuild.yaml              # Google Cloud Build CI/CD
โ”œโ”€โ”€ requirements.txt             # All dependencies
โ”œโ”€โ”€ SECURITY.md                  # OWASP-aligned security policy
โ”œโ”€โ”€ CONTRIBUTING.md              # Code standards and process
โ”œโ”€โ”€ .env.example                 # Documented environment variables
โ”œโ”€โ”€ conftest.py                  # Root pytest configuration
โ”‚
โ”œโ”€โ”€ backend/                     # Cloud Brain (FastAPI)
โ”‚   โ”œโ”€โ”€ py.typed                 # PEP 561 typed package marker
โ”‚   โ”œโ”€โ”€ main.py                  # Server: REST + WebSocket + middleware
โ”‚   โ”œโ”€โ”€ models.py                # Pydantic V2 strict validation models
โ”‚   โ”œโ”€โ”€ gemini_agent.py          # Vision analysis with retry logic
โ”‚   โ”œโ”€โ”€ context_manager.py       # Rolling deque-based observation window
โ”‚   โ”œโ”€โ”€ storage.py               # GCS + local dual-write (tenacity retry)
โ”‚   โ”œโ”€โ”€ firestore_client.py      # Cloud Firestore CRUD
โ”‚   โ”œโ”€โ”€ secret_manager.py        # Google Secret Manager integration
โ”‚   โ”œโ”€โ”€ security.py              # Rate limiter, auth, sanitization (OWASP)
โ”‚   โ””โ”€โ”€ dashboard.html           # WCAG AA dashboard with ARIA live regions
โ”‚
โ”œโ”€โ”€ client/                      # Local Machine Agent
โ”‚   โ”œโ”€โ”€ py.typed                 # PEP 561 typed package marker
โ”‚   โ”œโ”€โ”€ argus_client.py          # Main orchestrator
โ”‚   โ”œโ”€โ”€ screen_capture.py        # MSS + NumPy pixel-diff
โ”‚   โ”œโ”€โ”€ voice_listener.py        # Wake word (SpeechRecognition)
โ”‚   โ””โ”€โ”€ executor.py              # Safe action execution (no shell=True)
โ”‚
โ”œโ”€โ”€ tests/                       # 130+ assertions
โ”‚   โ”œโ”€โ”€ conftest.py              # Shared fixtures
โ”‚   โ”œโ”€โ”€ test_argus.py            # Core suite (49 assertions)
โ”‚   โ”œโ”€โ”€ test_security.py         # Security tests
โ”‚   โ”œโ”€โ”€ test_vulnerabilities.py  # ReDoS, injection, XSS, timing
โ”‚   โ”œโ”€โ”€ test_property.py         # Hypothesis property-based fuzzing
โ”‚   โ”œโ”€โ”€ test_executor.py         # Action executor tests
โ”‚   โ”œโ”€โ”€ test_firestore.py        # Firestore tests
โ”‚   โ”œโ”€โ”€ test_integration.py      # E2E WebSocket tests
โ”‚   โ”œโ”€โ”€ test_screenshot.py       # Screen capture tests
โ”‚   โ”œโ”€โ”€ test_voice_listener.py   # Voice listener tests
โ”‚   โ””โ”€โ”€ test_gemini.py           # Agent tests
โ”‚
โ””โ”€โ”€ docs/                        # Documentation
    โ”œโ”€โ”€ API.md                   # Full API reference
    โ””โ”€โ”€ architecture.svg         # System diagram

๐Ÿ› ๏ธ Local Setup

git clone https://github.com/vivekyarra/argus-agent.git
cd argus-agent
pip install -r requirements.txt

cp .env.example .env
# Edit .env with your GEMINI_API_KEY

# Start backend
uvicorn backend.main:app --port 8000

# Start client (separate terminal)
python -m client.argus_client

๐Ÿ”Œ API Reference

Method Endpoint Description
GET / Interactive WCAG-compliant dashboard
GET /health Health: version, storage, Firestore, Secret Manager, Cloud Logging
GET /stats Live stats: apps, errors, context window
GET /api/observations Recent observations (Firestore)
GET /api/actions Recent action logs (Firestore)
GET /api/storage Storage backend health
WS /ws Real-time observation + command (Pydantic validated)

Full reference: docs/API.md


๐Ÿ“Š Key Engineering Decisions

Decision Rationale
Pixel diff filter NumPy comparison reduces Gemini calls by ~80%, making free tier viable
Confidence thresholding Actions below 0.6 are narrated but not executed โ€” safety first
Pydantic V2 strict Every WebSocket payload validated before touching business logic
Secret Manager > .env Zero secrets on disk in production; env var fallback for dev
Cloud Logging Structured logs enable production debugging and alerting
Tenacity retry GCS uploads retry 3x with exponential backoff (1s โ†’ 4s)
Deque(maxlen=500) O(1) append/evict with bounded memory
JSONL append No read-modify-write โ€” eliminates I/O bottleneck
Non-root Docker Container runs as unprivileged appuser

๐Ÿ’ก Why ARGUS Is Different

Traditional AI ARGUS
Activation You explain everything Say "ARGUS" โ€” it already knows
Context You provide manually Built automatically over time
Screen DOM/API only Pure pixel vision โ€” works on ANY app
Execution Simulated Real mouse, real clicks
Memory None Rolling context window
API Cost Every frame Pixel diff reduces calls 80%
Secrets In .env files Google Secret Manager at runtime
Observability print() statements Google Cloud Logging
Validation Manual string checks Pydantic V2 strict models

๐Ÿ”ฎ Roadmap

  • Multi-monitor support
  • Vertex AI embeddings for long-term memory
  • Gemini Live API streaming for real-time interruptions
  • Mobile screen support via ADB bridge

In Greek mythology, Argus Panoptes had 100 eyes and never slept. Neither does this.

MIT License ยท Vivek Yarra

About

๐Ÿ‘๏ธ Ambient AI agent that watches your screen silently and responds before you finish explaining. Gemini 2.0 Flash + FastAPI + Cloud Run.

Resources

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages