Stashov — Personal AI Memory & Impulse Gate
Inspiration
I've spent years accumulating digital artifacts: 1,346 browser bookmarks across Chrome, Brave, and Edge; camera-roll screenshots of products, recipes, and code snippets; saved links from TikTok, YouTube, Reddit, and X. The problem wasn't saving — it was retrieval and context.
Standard bookmark folders and wishlist apps fail in two ways:
- Retrieval & Link Rot: Saved content drowns in unorganized folders. Links rot. Screenshots sit in camera rolls with no semantic connection to what they represent.
- Zero Personal Context: A wishlist doesn't know I already own a Black Quilted Winter Parka. It doesn't know my evening routine uses 0.1% Adapalene and that a viral glycolic cleanser would conflict. It doesn't know I bookmarked four fragrance discounters carrying the same cologne for $87 less.
Stashov was born from a simple question: What if my digital memory actually understood me — my inventory, my constraints, my budget, my routines — and used that context to gate every impulse before it became a purchase?
What it does
Stashov is a local-first Personal AI that unifies your saved bookmarks, wishlist, living routines, and personal constraints into one connected brain.
Capability: Browser Bookmark Vault Description: Imports 1,346 bookmarks from Chrome/Brave/Edge, deduplicates via canonical URL, classifies into 14 categories (Programming, AI, Menswear, Fragrances, Skincare, Watches, Soccer, Sourcing, etc.) ──────────────────────────────────────── Capability: Reference Library Description: 1,017 non-shopping links organized into 10 sections (Education, Programming, AI, Career, Business, Design, Cyber, Utilities, Gaming, Sourcing) with live health status (858 live, 110 blocked, 61 removed, 9 restored after review) ──────────────────────────────────────── Capability: Impulse Gate Engine Description: 14-day cooling-off state machine (cooling → ready → bought/skipped/snoozed), monthly ledger with editable caps, duplicate overlap check against owned inventory, discounter/dupe cross-reference, price history with sparklines and target alerts ──────────────────────────────────────── Capability: Living Protocols Description: Paste-to-routine builder (TikTok/YouTube caption → AM/PM steps + guardrails), product linking with cached photos/verified prices, conflict detection (blocks AHA/BHA in PM alongside 0.1% Adapalene), daily check-off log with streak tracking ──────────────────────────────────────── Capability: Capture from Anywhere Description: Desktop bookmarklet (#captureDialog) reads JSON-LD/OpenGraph client-side, paste-to-gate, mobile PWA with Web Share Target at /share-target ──────────────────────────────────────── Capability: Nebius Serverless Worker Description: Deal/discounter polling, link-rot verification, cooling-off unlocks, weekly digest compilation ──────────────────────────────────────── Capability: Telemetry Console Description: Live Nebius Token Factory routing latency, token usage, cost per call
How we built it
Architecture
┌─────────────────────────────────────────────────────────────────┐ │ STASHOV VAULT │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │ │Bookmarks │ │ Wishlist │ │Protocols │ │ Profile │ │ │ │ (1,346) │ │ (13 items)│ │ (5) │ │ (sizes, │ │ │ │ 14 cats │ │ + gate │ │ + daily │ │ constraints,│ │ │ └────┬─────┘ └────┬─────┘ └────┬─────┘ │ inventory)│ │ │ │ │ │ └────┬──────┘ │ │ └─────────────┼─────────────┼──────────────┘ │ │ ▼ ▼ │ │ ┌──────────────────────────────┐ │ │ │ IMPULSE GATE ENGINE │ │ │ │ • Duplicate overlap check │ │ │ │ • 14-day cooling-off FSM │ │ │ │ • Monthly ledger + caps │ │ │ │ • Discounter/dupe cross-ref │ │ │ │ • Price history + targets │ │ │ └──────────────┬───────────────┘ │ │ ▼ │ │ ┌──────────────────────────────┐ │ │ │ NEBIUS TOKEN FACTORY │ │ │ │ ┌────────────────────────┐ │ │ │ │ │ nvidia/Nemotron-3-Ultra│──┼──► 1M-context synthesis│ │ │ │ nvidia/Nemotron-3-Super │──┼──► Agentic synthesis │ │ │ │ nvidia/Nemotron-3-Nano │──┼──► Fast extraction │ │ │ │ nvidia/Nemotron-3.5-Lightning│ MTP fast decode │ │ │ │ Qwen/Qwen3-Embedding-8B │──┼──► Semantic memory │ │ │ │ zai-org/GLM-5.3-Flash │──┼──► Vision OCR │ │ │ └────────────────────────┘ │ │ │ └──────────────────────────────┘ │ └─────────────────────────────────────────────────────────────────┘
Core Stack
Layer: Runtime Technology: Node.js 18+ (raw http module — no framework) ──────────────────────────────────────── Layer: AI Platform Technology: Nebius Token Factory (OpenAI-compatible REST) ──────────────────────────────────────── Layer: Models Technology: Nemotron-3 Ultra/Super/Nano/Lightning, Qwen3-Embedding-8B, GLM-5.3-Flash ──────────────────────────────────────── Layer: Storage Technology: JSON vault (2.5MB) + atomic writes (temp + fsync + rename + .bak + 20 snapshots); Vercel Blob in production ──────────────────────────────────────── Layer: Background Technology: Nebius Serverless Jobs (periodic workers, no infra) ──────────────────────────────────────── Layer: Frontend Technology: Vanilla JS SPA (8 tabs), CSS design system, PWA manifest + Web Share Target ──────────────────────────────────────── Layer: Security Technology: Loopback binding, HMAC-SHA256 sessions, CSP/COOP/CORP/HSTS, SSRF-safe fetch, rate limits ──────────────────────────────────────── Layer: Deploy Technology: Vercel (primary), Render (alt), Nebius Serverless Endpoints (native)
Key Modules
| File | Responsibility |
|---|---|
| scripts/sync-bookmarks.js | Chrome/Brave/Edge importer + 14-category classifier |
| scripts/audit-library.js | Link health check + description extraction |
| lib/gate.js | 14-day FSM, ledger, budget caps, buy/skip/snooze/reopen/void |
| lib/promotion.js | Pre-gate review, JSON-LD/OpenGraph capture, price provenance |
| lib/routine.js | Paste-to-routine parser, conflict guardrails |
| lib/safe-fetch.js | SSRF-safe HTTP (DNS pinning, private IP blocking, size/time limits) |
| lib/state.js | Atomic vault writes, backups, hosted storage abstraction |
| jobs/nebius-serverless-worker.js | Background deal polling, link-rot, unlocks, digests |
Challenges we ran into
SSRF-Safe Fetching Without Breaking Legitimate Use Product pages must be fetched server-side for metadata, but that opens SSRF vectors. Solution: lib/safe-fetch.js — every redirect revalidated, DNS resolved and pinned, private/loopback/link-local/metadata addresses blocked, credentials and non-standard ports rejected, response size/time limits enforced.
Price Extraction Confidence Without Guessing Stores return 403 to server requests; JSON-LD absent; visible prices are ranges, "from" prices, installment copy. Solution: Bookmarklet reads DOM client-side, prefers sale price over compare-at, follows selected variants, explicitly marks low confidence in review/gate card/saved note — never fabricating a $95 placeholder.
Atomic Writes at Scale on Serverless Vault is 2.5MB JSON. Vercel Blob + serverless = no local fsync. Solution: lib/state.js abstracts storage — local uses temp-file + fsync + rename + .bak + timestamped snapshots (last 20); hosted uses Vercel Blob with pre-import snapshots. Telemetry no longer rewrites vault on every search.
Model Routing Without Hardcoding Nebius Token Factory exposes /api/public/models_info with capabilities (function_calling, context_and_rag, responses_api, MTP). Solution: Data-driven capability map in server.js selects cheapest model satisfying task requirements.
Duplicate Detection That Doesn't Annoy Title similarity (Jaccard on filtered tokens) + same-domain heuristic + active-wishlist filter. Threshold: 0.65 similarity OR exact title match. Surfaces top 4 matches in review dialog before the 14-day clock starts.
Accomplishments that we're proud of
Achievement: 1M-context synthesis works Impact: Nemotron-3-Ultra processes 1,346 bookmarks + Reddit threads + ingredient sheets + inventory + budget + routines in one pass — genuine multi-document reasoning ──────────────────────────────────────── Achievement: 10× cost reduction via tiered routing Impact: Ultra (deep) → Super (agentic) → Nano (fast) → Lightning (MTP) → Qwen (embeddings) → GLM (vision) — right model per task ──────────────────────────────────────── Achievement: Zero-config local bookmark import Impact: npm run sync-bookmarks scans Chrome/Brave/Edge stores automatically — no manual export/upload ──────────────────────────────────────── Achievement: Bookmarklet that works on 403 pages Impact: Client-side DOM capture falls back when server requests fail, with confidence labeling ──────────────────────────────────────── Achievement: Conflict detector that knows your routine Impact: Blocks AHA/BHA in PM window alongside 0.1% Adapalene — personal context as executable guardrails ──────────────────────────────────────── Achievement: Audit trail on every mutation Impact: Ledger entries, price observations, gate transitions, backup snapshots — everything auditable ──────────────────────────────────────── Achievement: Live demo on Vercel with Blob Impact: https://stashov.com — /api/health 200, /api/vault 401 signed out, unlocks with token ──────────────────────────────────────── Achievement: 13-test suite covering security + logic Impact: Gate lifecycle, product extraction, promotion review, capture DOM, search relevance, SSRF guards, routine daily log, profile, state durability, unlock rate-limits
What we learned
Lesson: 1M-token context isn't a gimmick Evidence: Enables synthesis across entire personal corpus — the differentiator for personal AI ──────────────────────────────────────── Lesson: Tiered routing beats single-model Evidence: 10× latency/cost improvement; capability-driven selection via Nebius model info endpoint ──────────────────────────────────────── Lesson: Local-first + serverless = privacy + scale Evidence: Loopback binding, HMAC sessions, atomic writes; Nebius Jobs for background without infra ──────────────────────────────────────── Lesson: Impulse gate is a state machine, not a prompt Evidence: Deterministic transitions from timestamps — no LLM hallucination of time ──────────────────────────────────────── Lesson: Personal context must be editable, not hardcoded Evidence: Profile editor validates, protects budget/cooling fields, preserves IDs, writes atomically ──────────────────────────────────────── Lesson: Confidence labeling > hallucinated data Evidence: Low-confidence price marks propagate through review → gate card → saved note — user decides ──────────────────────────────────────── Lesson: Serverless Jobs fit periodic personal workloads Evidence: Deal polling, link-rot, unlocks, digests — no always-on server needed
What's next for Stashov — Personal AI Memory
Near-term (Hackathon → v2.1)
- SAM 3.1 integration: Zero-shot segmentation on screenshot ingestion → auto-extract product regions, prices, specs
- Muse Image: Generate contextual illustrations from retrieved memories (e.g., "show me that fragrance layering combo")
- Muse Code: On-demand code synthesis from past snippets in Programming cluster
- 3-minute demo video for submission
Medium-term (v2.2–v3.0)
- Cross-device sync via encrypted conflict-free replicated data type (CRDT)
- Voice capture (Whisper on Nebius) → ingest while walking/driving
- Proactive agent: "You've saved 3 colognes from FragranceNet — Olfactory Factory has the same one for $87 less. Want me to gate it?"
- Fine-tuned Nemotron Impulse Gate distilled from Ultra prompts → smaller, faster, specialized
- WebSocket streaming on Token Factory for perceived latency on 1M-context calls
Long-term vision Stashov becomes the personal context layer that any AI assistant (local or cloud) can query — your inventory, constraints, routines, budget, and memory — with the impulse gate as the universal "pause and think" mechanism before any action commits resources.
Built With
Category: Languages Technologies: JavaScript (Node.js 18+), HTML5, CSS3 ──────────────────────────────────────── Category: AI/ML Platform Technologies: Nebius Token Factory, NVIDIA Nemotron 3 ──────────────────────────────────────── Category: Models Technologies: nvidia/Nemotron-3-Ultra-550b-a55b, nvidia/Nemotron-3-Super-120b-a12b, nvidia/Nemotron-3-Nano-30B-A3B, nvidia/Nemotron-3.5-Lightning, Qwen/Qwen3-Embedding-8B, zai-org/GLM-5.3-Flash ──────────────────────────────────────── Category: Cloud/Hosting Technologies: Vercel, Render, Nebius Serverless Endpoints ──────────────────────────────────────── Category: Storage Technologies: Vercel Blob, JSON + atomic writes, Nebius Serverless Jobs ──────────────────────────────────────── Category: APIs Technologies: Nebius Token Factory REST, Chrome/Brave/Edge bookmark APIs, Web Share Target ──────────────────────────────────────── Category: Security Technologies: HMAC-SHA256, CSP, COOP/CORP, HSTS, SSRF-safe fetch, rate limits ──────────────────────────────────────── Category: Testing Technologies: Node.js native --test (13 test files)
Try It Out
| Link | Description |
|---|---|
| 🌐 Live Demo | https://stashov.com |
| 📁 GitHub Repo | https://github.com/Arafat87/stashov-personal-ai |
| 🏥 Health Check | https://stashov.com/api/health |
HOW TO ACCESS: STASHOV_ACCESS_TOKEN: 9c702e171aa063819a576de7b022992c96b0de0b8a2844f5cae7a37bfc24f3c3
bash git clone https://github.com/Arafat87/stashov-personal-ai.git cd stashov-personal-ai npm ci cp .env.example .env # Add NEBIUS_API_KEY npm run sync-bookmarks npm start # http://localhost:3847
Mathematical Appendix: Gate State Machine
The impulse gate operates as a deterministic finite automaton with timestamp-derived transitions:
$$ \begin{aligned} \text{States} &= {\texttt{cooling}, \texttt{ready}, \texttt{bought}, \texttt{skipped}, \texttt{snoozed}} \ \text{Transitions} &: \ \texttt{cooling} &\xrightarrow{t \geq \texttt{unlock_at}} \texttt{ready} \ \texttt{ready} &\xrightarrow{\text{buy}} \texttt{bought} \quad (\text{ledger entry written}) \ \texttt{ready} &\xrightarrow{\text{skip}} \texttt{skipped} \ \texttt{ready} &\xrightarrow{\text{snooze}(d)} \texttt{snoozed} \quad (\texttt{unlock_at} \leftarrow \texttt{unlock_at} + d) \ \texttt{snoozed} &\xrightarrow{t \geq \texttt{unlock_at}} \texttt{ready} \ \texttt{bought} &\xrightarrow{\text{reopen}} \texttt{ready} \quad (\text{ledger entry voided}) \ \texttt{skipped} &\xrightarrow{\text{reopen}} \texttt{ready} \ \end{aligned} $$
Built With
- css3
- html5
- javascript
- nebius
- node.js
- nvidia
- vercel
Log in or sign up for Devpost to join the conversation.