import os os.environ.setdefault("ASTRANEXUS_FINETUNED", "1") # run the SP3 fine-tuned encoder import astranexus.config # noqa: F401 — loads any HF Space secrets from env import os.path import gradio as gr from fastapi import FastAPI from fastapi.responses import HTMLResponse, FileResponse, JSONResponse from astranexus.ui.app import build_app, DARK app = FastAPI(title="AstraNexus") # 'Sign in with Google' web flow (live mode uses the Gmail REST API over 443, # because the Space firewalls outbound IMAP). No-op if the OAuth client secrets # aren't set, so the fixture demo still runs. from astranexus.web import google_oauth google_oauth.attach(app) LANDING = """
Unsupervised email organizer. A fine-tuned multimodal encoder (MiniLM text + SigLIP vision, LoRA) embeds every email; HDBSCAN groups them into constellations that NVIDIA Nemotron-3-Nano-4B names and reasons over; threads spanning accounts surface as wormholes. No rules, no folders — the structure is discovered.
Launch the demo →Under the hood: the whole AI pipeline runs on a Modal GPU as a LangGraph agentic graph — fetch→embed→cluster→label→judge→serialize. An LLM-as-judge (Nemotron) scores the labels and loops back to relabel until they pass, then it writes an open agent trace — view the latest trace.json →. An in-app A/B toggle pits the fine-tuned encoder against off-the-shelf SigLIP; layered fallbacks (Modal → NIM-hosted Nemotron → keyword heuristic) keep it alive.
About the data: the default fixture is a synthetic dataset built only for demo/testing — no real email. Google restricts reading people's mail, so live Gmail is invite-only (approved test accounts / my own mailboxes); session-only, never stored.
Fine-tuned encoder: DriptoBhattacharyya/astranexus-mm-encoder · built for the Build Small hackathon.