AI Full-Stack AI Automation Computer Vision

Production R&D Portfolio Harutyun
Grigoryan

AI Full-Stack Engineer building production systems where web apps, automation, data, and real hardware meet.

Specialized in AI-enabled products, backend systems, frontend workflows, Computer Vision, Telegram bots, and PostgreSQL-powered services. I design and ship reliable agents, dashboards, data pipelines, and database-backed applications — from live AI systems in high-availability studio environments to active business tools and Telegram products used in real scenarios.

R&D Engineer Backend Automation CV + Hardware RAG Systems
6y 4m
technical and engineering experience
4 tables
live AI automation deployment
30-40%
game speed improvement shipped
RAG + CV
AI systems built end-to-end
Best Fit For
AI Full-Stack Engineer Full-Stack Automation Engineer AI Automation Engineer Computer Vision Engineer R&D Engineer Hardware-integrated Systems
Featured / Production R&D Video Demos

Four short demonstrations from systems I created during my work as an R&D Engineer in a live gaming studio environment. They show production-facing Computer Vision, hardware-triggered automation, live telemetry, and operator workflows.

Dice Automation Detection

Real-time pip detection, trigger waiting, console feedback, and ROI-based reading for sequential dice automation.

RichWheel Telemetry

Live wheel state monitoring with direction, speed trend, round validation, and final result telemetry.

Lucky Color Validation

Computer Vision result detection with confidence output and validation logic for ambiguous or incomplete game states.

Live Table ROI Tracking

Table-region monitoring with card state detection, named ROIs, and runtime event logs for production operations.

01 / AI Agent Orchestration & Event-Driven Services

AGGREGATOR: AI Agent Orchestration Service

AGG-SYS-01
Python Asyncio Agent Lifecycle Mgmt Event-Driven WebSockets Self-Healing Observability
Project Overview

A production-grade AI agent orchestration service — the central nervous system for live casino AI infrastructure. Manages the full lifecycle of independent AI engines (Computer Vision agents, Hardware I/O agents, Lucky Color classifier) via an event-driven WebSocket API. Built with reliability-first principles: built-in retries, adaptive timeouts, process observability, and automated recovery.

Architecture — Reliability Patterns
01
Agent Discovery & Handshake: On startup, Orchestrator spawns agent subprocesses and establishes bidirectional event streams. Assigns unique AgentID and ProfileConfig per agent.
02
Adaptive Heartbeat Monitor: Tiered timeout logic — not a simple ping. Active state: 12s timeout. Profile switch (CPU spike window): 45s grace period. Prevents false alarms under load.
03
Zombie Detection & Auto-Restart: Observes both process state and network state independently. On zombie detection: SIGTERM → SIGKILL → restart pipeline with state restoration.
04
Lazy Fallback Mode: Caches last known good agent state. Prioritizes internal process health over transient network lag — eliminating false recovery cycles.
Production Status
Live on 4 active game tables since October 2025. 99.9% uptime with near-zero errors — achieved by distinguishing "network lag" from "process crash" at the observability layer.
02 / Embedded R&D Optimization

RICHWHEEL: High-Speed Sensor Consensus

RW-SYS-01
Python Threading RPi.GPIO Gray Code Statistical Analysis Raspberry Pi
The Engineering Challenge

Physical sensors on a roulette wheel generated electrical noise ("bouncing"), producing false results during high-speed rotation. The system required 0% error rate for casino payouts.

Code Solution — Wheel_V2.2.py
Wheel_V2.2.py — Multi-Sample Consensus Logic
def _background_worker(self):
    # Critical loop running on separate Daemon thread
    while True:
        if self.multi_sample_enabled and capture_triggered:
            samples = []

            # 1. Burst Sampling: Capture 100+ raw binary states
            for i in range(self.sample_count):
                binary_str = self._read_binary_string()   # 10 GPIO pins
                sector     = self._decode_gray(binary_str) # Gray Code decode
                samples.append(sector)
                time.sleep(interval)

            # 2. Statistical Mode — find consensus winner
            counts              = Counter(samples)
            most_common, count  = counts.most_common(1)[0]
            consensus_pct       = (count / self.sample_count) * 100

            if consensus_pct >= self.consensus_threshold:
                self.lock_result(most_common)
                print(f"WIN CONFIRMED: {most_common} ({consensus_pct:.1f}%)")
Business Outcome
Eliminated hardware noise entirely. Slashed game round duration by 37% by removing the need for manual result verification.
03 / Computer Vision & Mathematics

MARBLE DETECT: Real-Time Physics Tracking

CV-MD-01
OpenCV (HSV) Linear Algebra WebSockets RTSP sub-100ms latency
The Engineering Challenge

Determine the winner of a live marble race in real-time via IP cameras. Simple "zone" detection was inaccurate due to camera angles — required a mathematically exact finish-line calculation.

Algorithmic Solution — MDetect.py
01
Setup: Operator draws the Finish Line. System converts 2 points into a linear equation: Ax + By + C = 0.
02
Detection: Each frame → convert RTSP stream to HSV → mask by color → extract centroid (x, y) per marble.
03
Math Calculation: Signed algebraic distance of centroid to finish line: Dist = (A·x + B·y + C) / √(A² + B²)
04
Real-Time Ranking: Sort marbles by distance. Smallest distance = Rank #1. Broadcast JSON via WebSockets to Game Engine.
Business Outcome
Enabled fully automated race payouts with 100% fairness verification backed by geometric audit trail.
04 / Complex Automation Systems

DICE AUTOMATION: Sequential State Machine

DA-SYS-01
PyQt5 State Machines Serial / COM MSS (Screen Cap) TCP Override
The Engineering Challenge

A live casino dice game required tracking 2 to 4 dice independently in a single round, depending on the game variant. The core problem: each die physically settles at a different moment in time after being shaken. A naive "snapshot when all dice are done" approach failed — the system couldn't know when the last die stopped, and waiting too long caused player frustration and game delays.

The solution: a pre-configured delay queue. Each die is assigned a settle time (e.g. Die 1 → 1.2s, Die 2 → 1.8s…). The engine activates each die's Region of Interest (ROI) exactly on schedule, reads the pip count via Computer Vision, broadcasts the partial result immediately, then advances to the next die. Operators can override any result via TCP command in real-time. The system also handles "shaking" events — if dice are disturbed mid-read, a fault-recovery state resets the queue without crashing the live session.

Code Solution — main.py
main.py — Sequential Queue Management
if sequential_active:
    if len(sequential_queue) > 0:
        # 1. Pop next dice from sorted delay queue
        target_delay, current_dice_name = sequential_queue[0]

        # 2. Check individual timer
        elapsed   = time.time() - sequential_start_time
        time_left = target_delay - elapsed

        if time_left <= 0:
            # 3. Activate specific ROI for this die only
            coords = ROIS[current_dice_name]
            roi    = frame[coords[0]:coords[1], coords[2]:coords[3]]

            # 4. Run CV on isolated region → get pip count
            val, _ = count_pips_on_die(roi)
            sequential_results[current_dice_name] = val

            # 5. Broadcast partial result & advance queue
            self.detection_complete.emit(sequential_results)
            sequential_queue.pop(0)
Business Outcome
Created a Fault-Tolerant System handling "shaking" events, manual TCP overrides, and automated recovery — zero manual interventions required in production.
05 / AI Knowledge Base — Local RAG System

AGGREGATOR KB: Local RAG Knowledge Base

KB-RAG-01
RAG Architecture Data Chunking TF-IDF Indexing LM Studio scikit-learn Python Tkinter JSON Pipelines
Project Overview

Built a fully local Retrieval-Augmented Generation (RAG) system to serve as the knowledge backbone for the Aggregator project. All inference runs on-device via LM Studio, ensuring that internal technical documentation and system specs never leave the local environment. The system transforms raw, unstructured project documentation into a structured, queryable Knowledge Base that provides precise context to a local LLM at query time.

Data Chunking Pipeline
01
Raw Data Ingestion: Technical project data (system specs, protocol docs, configuration schemas) ingested from source files and normalized into a consistent internal format before processing.
02
Multi-Version Chunking Strategy: Implemented three chunking variants — v3 (balanced granularity), final (production-optimized, context-boundary-aware), and detailed (fine-grained, high-overlap for dense retrieval). Each variant is serialized as structured JSON arrays and stored independently, allowing retrieval strategy to be selected at runtime without re-processing source data.
03
TF-IDF Vectorization & Indexing: Each chunk corpus is vectorized using TfidfVectorizer (scikit-learn). The resulting sparse matrix acts as the search index. At query time, the user query is transformed into the same vector space and matched against all chunks via cosine similarity — enabling semantic-like retrieval without requiring embeddings or a vector database.
04
Context Injection & LLM Inference: The top-ranked chunks are assembled into a structured context block and injected into the prompt sent to the local LLM via the LM Studio HTTP API. This grounds the model's responses in verified, project-specific data rather than general training knowledge — reducing hallucinations on domain-specific queries.
05
Interactive GUI (Tkinter): A lightweight Python desktop interface allows real-time interaction with the Knowledge Base — switching between chunk versions, inspecting retrieved context, and querying the LLM — without requiring a browser or external service.
Technical Outcome
A fully private, offline-capable RAG pipeline. Chunk version selection allows tuning the retrieval precision vs. recall trade-off per query type. TF-IDF indexing provides sub-second retrieval across the full knowledge corpus with no GPU or cloud dependency.
06 / AI Business Platform & Document Automation

AI Estimate & Presentation Platform

BIZ-AI-01
Next.js TypeScript AI Tooling PDF Export CRM Integration PWA / Mobile UX
Project Overview

Contributed to an existing business operations platform for construction estimates and client-facing PDF presentations. The work focused on turning project data, estimates, work-day plans, materials, equipment, and AI-generated text into a practical manager-facing workflow: edit the project, generate a presentation, export an A4 PDF, save versions, and synchronize key actions with the work-management/CRM layer.

Delivered Systems
01
Presentation Builder: normalized project data into editable presentation sections: client request, work days, operations, materials, equipment, cost summary, and final PDF-ready content.
02
A4 PDF Workflow: built export and versioning flow for client-facing documents, including stable PDF layout, saved presentation versions, and file upload integration.
03
AI Tool Separation: split AI knowledge into tool-specific contexts for estimate cost building, presentation editing, and AI-assisted estimate editing.
04
AI Estimate Editing: designed a safer chat flow where AI proposes changes, shows old/new diffs, applies only after explicit confirmation, and supports rollback.
Product Outcome
Converted a complex manager workflow into a structured AI-assisted business tool: presentation generation, cost transparency, PDF delivery, chat history, CRM write-paths, and mobile-ready UX.
07 / Other Projects

LUCKY COLOR: LLM-Driven Validation Pipeline

Hybrid data pipeline combining Computer Vision and Gemini LLM for game result validation. OpenCV classifies the winning color; Gemini provides a secondary LLM verification layer for ambiguous edge cases — dual-source consensus before any payout is triggered. A practical example of LLM tool-calling integrated into a real-time production pipeline.

OpenCV Gemini API LLM Tool-Calling Dual Consensus Real-Time Pipeline

STUDIO MONITORING: Live Ops Dashboard

Real-time monitoring system for live casino streaming studios. Tracks server health, stream quality, and critical incidents. Built to handle simultaneous multi-table monitoring with alerting and auto-escalation logic.

WebSockets RTSP Auto-Alert Multi-Table

RELAY CONTROLLER: Arduino Hardware Bridge

Python-to-Arduino serial bridge for industrial relay control in live game studios. Handles physical game triggers (spin start, bet lock, result reveal) with sub-millisecond timing precision and fail-safe fallback states.

Arduino Serial/COM Relay Logic Fail-Safe

OCR SIGNAL BRIDGE: Video Text Trigger to grandMA3

Built a real-time OCR automation pipeline using Tesseract to monitor selected screen/video regions, extract on-screen text, and trigger external actions when specific phrases appeared. The system sent control signals to grandMA3 for automated LED background lighting changes and continuously logged detected text from defined video areas for operational traceability and post-run analysis.

Tesseract OCR ROI Selection Video Logging grandMA3 Event Triggers

PROFILE SWITCH ENGINE: Zero-Downtime Config Reload

Dynamic configuration reloader for live game engines. Allows operators to switch camera profiles, ROI coordinates, and detection parameters mid-session — without stopping or restarting any running service.

Python Asyncio Hot Reload JSON Config Zero Downtime
08 / Telegram Bots & PostgreSQL Products

@armdriveBOT — Driving Exam Preparation Bot

Built and maintained an active Telegram bot for Armenian driving license exam preparation. Designed the backend logic and integrated it with PostgreSQL for storing user data, learning progress, question flows, and bot interaction records. Focused on stable behavior, clear user flows, and real-world usability.

Telegram Bot API PostgreSQL Python Backend User Progress Production Bot

Management Bot for Local Business

Created a Telegram bot for the managerial staff of a local business to support internal workflows and operational coordination. Implemented the backend logic, structured data handling, and automated interactions to simplify routine manager tasks and improve responsiveness.

Telegram Automation Business Workflow Python Internal Tool Operations
09 / Tech Stack
Core Languages
Python 3.x Async / Typed Code Bash / Shell JavaScript (basic) SQL
AI & LLM Integration
Gemini API LLM Tool-Calling RAG Architecture Data Chunking LM Studio (Local LLM) TF-IDF Retrieval Prompt Engineering CV + AI Consensus Agent Design Patterns
Backend & APIs
Python Asyncio WebSockets REST / TCP APIs Telegram Bot API CRM Integrations Event-Driven Services Microservices
Product Engineering
Next.js TypeScript PDF Generation PWA / Mobile UX Diff & Rollback Flows Version History
Reliability Engineering
Self-Healing Systems Adaptive Retries Process Observability Fault Recovery State Machines
Computer Vision
OpenCV HSV Color Masking RTSP Streams ROI Detection Real-Time Pipelines
Hardware & Embedded
Raspberry Pi / GPIO Arduino / Serial Gray Code Decoding Relay Control BGA Soldering
Databases
PostgreSQL pgAdmin Query Design Data Modeling CRUD Operations
10 / Education & Certifications
🎓
Python — Complete Bootcamp: Zero to Hero
Udemy · José Portilla
Comprehensive Python course covering OOP, data structures, file I/O, decorators, generators, and web scraping. 22+ hours of hands-on projects.
🎓
Python for Data Science and Machine Learning
Udemy · Jose Portilla & Frank Kane
NumPy, Pandas, Matplotlib, Scikit-Learn fundamentals. Statistical analysis and data pipeline techniques directly applied in Computer Vision projects.
11 / Work Experience
R&D Specialist — AI Automation
Confidential Live Gaming Studio — Jul 2025 – Mar 2026
  • Built and deployed the systems below starting October 2025, with improvements delivered through March 2026.
  • Architected the "Aggregator" microservice ecosystem — running live on 4 active game tables with near-zero detection errors.
  • Developed a local RAG Knowledge Base (LM Studio + TF-IDF) to accelerate internal development: raw technical documentation is chunked into structured JSON, indexed, and retrieved at query time to provide grounded context to a local LLM — entirely offline.
  • Developed hybrid AI/CV solutions (OpenCV + Gemini) for automated game result validation.
  • Integrated industrial hardware (Arduino/Relays/RPi) with Python backends via Serial & WebSockets.
  • Deployed solutions increasing game speed by 30–40%; fine-tuned accuracy across all active tables through March 2026.
IT Technical Support
Confidential Live Gaming Studio — Mar 2025 – Oct 2025
  • Maintained live studio servers and resolved critical streaming incidents.
  • Monitored multi-table streaming infrastructure and ensured broadcast stability.
Master Repair Technician — Phones & Laptops
inTOUCH — Jan 2025 – Jul 2025
  • Specialized in BGA reballing, chip-level soldering, and complex motherboard diagnostics.
  • Deep hardware expertise now directly applied to embedded R&D work.
Specialist — Mobile & Laptop Repair
iBOLIT — Dec 2022 – Dec 2024
  • Advanced diagnostics and repair of mobile devices and laptops.
  • Customer technical support and troubleshooting.
Electrotechnician
SMARTLABS — Dec 2019 – Dec 2022
  • Foundational experience in electronics, hardware architecture, and circuit analysis.
  • Maintenance of consumer electronics