# Asim Ansari — Full Engineering Specification & System Curriculum > Autonomous Systems Engineer, Small Language Models (SLMs) Distillation Specialist, and Backend Infrastructure Engineer. --- ## 1. Professional Overview & Engineering Philosophy - **Name:** Asim Ansari - **Online Identity:** @asimansari-git (GitHub), link-asimansari (LinkedIn) - **Email:** asimansari.mail@proton.me - **Core Specialization:** Autonomous agent runtimes, sub-1B parameter local tool-calling models and CLI harnesses, hybrid retrieval-augmented generation (dense vector + sparse BM25 + AST graph), and enterprise backend infrastructure (Java 21/Spring Boot 3, Python/FastAPI, C#/.NET 9). - **Academic Background:** Master of Computer Applications (MCA), ICFAI University. - **Engineering Philosophy:** 1. *First-Principles Verification:* Rejection of shallow wrapper libraries; deep understanding of state transitions, vector embeddings, and memory hierarchies. 2. *Deterministic Execution:* Prioritizing cyclic reducer graphs and validation loops over brittle linear LLM chains. 3. *Local-First & Resource Efficiency:* Specializing compact models (`Qwen3-0.6B`) capable of CPU-only execution without telemetry leakage or cloud latency. 4. *Interface Engineering:* Strict monochrome palette, high typographic contrast, and zero layout shift over superficial decorative telemetry. --- ## 2. Core Project Architectures & Technical Blueprints ### A. NanoHat OS Agent (Flagship Local System Control CLI) - **Summary:** Sub-1B parameter on-demand Linux system control CLI and model tailored for Fedora Workstation environments. - **Model Hierarchy:** `NanoHat-0.6B` fine-tuned on `Qwen/Qwen3-0.6B` for structured 10-tool Linux system calls (Ollama: `asimansari-o/nanohat`, Hugging Face: `blackpirates/nanohat-qwen3-0.6b-final`). - **Harness & Tool Routing:** Lightweight Python CLI runtime (`subprocess`, `shutil`, `psutil`, `ollama`) with zero shell injection (`shell=False`) and zero agent framework bloat. Dispatches across a hardened 10-tool direct-dispatch catalog: - Hardware Telemetry & Power: `system_health(metric)` (`psutil`, `/sys/class/thermal`, DRM sysfs Intel/AMD, `nvidia-smi`), `power_profile(action, profile)` (`powerprofilesctl`). - Network Radios: `toggle_wifi(state)` (`nmcli`), `toggle_bluetooth(state)` (`bluetoothctl`). - Daemons & Storage: `service_status(service_name)` (`systemctl`), `restart_service(service_name)` (allowlisted user-space daemons with Wayland crash guardrails), `disk_usage(path)` (`shutil.disk_usage`). - System Environment: `package_manager(action, package_name, provider)` (`dnf`/`rpm`/`flatpak`), `audio_control(action, level)` (`wpctl`), `desktop_appearance(setting, value)` (`gsettings`). - **Key Metrics (Unseen 299-Query Evaluation):** 595.7 ms (P50 think=OFF) / 1307.6 ms (think=ON) median execution latency, all-time record 93.98% overall canonical accuracy (281/299 queries), 100.0% destructive security refusal pass, 100.0% multi-tool partial coverage with zero duplicate calls, 1.68% read-only safety violations, 99.58% sandbox safety pass, 0 outgoing network bytes. - **Deployment Status:** `v4.1.2` (`nanohat:latest` and `nanohat:v4.1.2`) serves as the official flagship production default release with full multi-GPU telemetry support. - **Repository:** https://github.com/asimansari-git/NanoHat - **Hugging Face:** https://huggingface.co/blackpirates/nanohat-qwen3-0.6b-final - **Ollama Registry:** https://ollama.com/asimansari-o/nanohat - **Case Study:** https://asimansari.com/projects/nanohat.html - **Raw Markdown:** https://asimansari.com/projects/nanohat.md ### B. Sage Knowledge Vault (Internal Knowledge Engine) - **Summary:** Private, air-gapped knowledge retrieval and reasoning vault operating over an internal corpus. - **Architecture:** Hybrid multi-index retrieval system: - Dense Vector Store: ChromaDB with cosine distance indexing over chunked markdown and technical specifications. - Sparse Lexical Index: SQLite FTS5 with BM25 ranking for exact keyword, function name, and identifier matching. - Knowledge Graph AST: Code AST parsing via Graphify to model semantic edges and dependency hierarchies. - Security & Sandbox: Strict Torikago containerization preventing network egress and unauthorized filesystem traversal. - **Interface:** Exposed locally through a 9-tool Model Context Protocol (MCP) server integration. - **Case Study:** https://asimansari.com/projects/sage.html - **Raw Markdown:** https://asimansari.com/projects/sage.md ### C. BillProds AI (Product Intelligence & Vision Ledger) - **Summary:** Item-level grocery and retail intelligence ledger transforming physical paper receipts into structured financial time-series. - **Architecture:** - Ingestion & Vision: Asynchronous OCR pipeline using Gemini Vision and fine-tuned boundary detectors to extract store, timestamps, SKU items, unit prices, and category tags. - Deduplication & Reconciliation: Levenshtein distance and embedding similarity to unify fragmented store item names into global product entities. - Backend Stack: Python 3.12, FastAPI, PostgreSQL / SQLite with SQLAlchemy, Pydantic v2 schemas. - Frontend: Progressive Web App (PWA) with responsive mobile client and offline caching. - **Repository:** https://github.com/asimansari-git/billprods-ai - **Case Study:** https://asimansari.com/projects/billprods-ai.html - **Raw Markdown:** https://asimansari.com/projects/billprods-ai.md ### D. Teaching Loop (Agentic Socratic Tutoring Engine) - **Summary:** Interactive educational platform enforcing active recall and Socratic guidance with automated Human-In-The-Loop (HITL) teacher escalation. - **Architecture:** - Cyclic State Machine: Manages dialogue state, tracks learner misconception markers, and gates hint delivery. - Retrieval Layer: ChromaDB indexing official syllabus documents, lecture transcripts, and rubric guides. - Teacher Intervention Protocol: Triggers asynchronous alerts to human educators when student frustration scores or repeated failure loops exceed thresholds. - Stack: FastAPI backend, ChromaDB vector store, multi-page Streamlit instructor dashboard. - **Repository:** https://github.com/asimansari-git/teaching-loop - **Case Study:** https://asimansari.com/projects/teaching-loop.html - **Raw Markdown:** https://asimansari.com/projects/teaching-loop.md ### E. Liz OS (Workstation Orchestration Engine) - **Summary:** Personal development assistant and context orchestration runtime operating locally on Linux. - **Architecture:** - Runtime: Agentic sidecar architecture utilizing native tool dispatch and local memory stores. - Memory System: Markdown-based Open Knowledge Format (OKF v0.1) maintaining 3-day operational sliding windows, skill documentation, and project registries. - Subagent Coordination: Dispatches specialized subagents for research, code editing, and background verification tasks. - **Case Study:** https://asimansari.com/projects/brain-liz.html - **Raw Markdown:** https://asimansari.com/projects/brain-liz.md ### F. Gemini-RAG (Progressive Retrieval Curriculum) - **Summary:** 6-stage algorithmic benchmark curriculum isolating modern retrieval techniques on isolated Git branches. - **Stages:** 1. *Naive Vector Search:* Base similarity lookup exposing chunking boundary degradation and query-document drift. 2. *Recursive Character Chunking:* Semantic boundary preservation with overlap tuning. 3. *Maximal Marginal Relevance (MMR):* Algorithmic balancing of relevance and diversity to prevent redundant context retrieval. 4. *SelfQueryRetriever:* Dynamic metadata filter extraction from natural language questions using LLM query translators. 5. *Contextual Compression & Re-Ranking:* Post-retrieval context pruning with Cross-Encoder rankers. 6. *Hybrid Search & Fusion:* Reciprocal Rank Fusion (RRF) combining dense embeddings and sparse BM25 scores. - **Repository:** https://github.com/asimansari-git/Gemini-RAG - **Case Study:** https://asimansari.com/projects/gemini-rag.html - **Raw Markdown:** https://asimansari.com/projects/gemini-rag.md --- ## 3. Technical Articles & Deep Dives ### Article 1: Why Linear Prompt Chains Fail: The Case for Cyclic StateGraphs - **URL:** https://asimansari.com/blogs/cyclic-stategraphs.html - **Raw Markdown:** https://asimansari.com/blogs/cyclic-stategraphs.md - **Key Concepts:** - *Failure Modes of DAGs:* Directed Acyclic Graphs cannot recover from transient tool failure, invalid JSON outputs, or hallucinated arguments without catastrophic termination. - *Cyclic Reducer Architecture:* State transition machines where agents evaluate feedback, maintain immutable state histories, and cycle back to remediation nodes. - *LangGraph State Machines:* Practical implementation patterns using TypedDict state schemas, conditional edges, and persistent checkpointers. ### Article 2: Engineering Sub-1B Local Tool-Calling Harnesses for Linux - **URL:** https://asimansari.com/blogs/sub-1b-desktop-distillation.html - **Raw Markdown:** https://asimansari.com/blogs/sub-1b-desktop-distillation.md - **Key Concepts:** - *The Latency & Shell-Synthesis Bottleneck:* Cloud LLMs introduce multi-second latency and raw `bash -c` command synthesis risks destructive flag hallucinations. - *Orthogonal 10-Tool Contracts:* Designing explicit read-only vs. state-mutating parameter schemas for `Qwen3-0.6B` on Fedora Workstation. - *Four-Layer Runtime Guardrails:* Zero-shell `subprocess.run(..., shell=False)` execution, Wayland session crash shields, allowlisted daemon recovery, and `NANOHAT_SANDBOX=1` dry-run verification. --- ## 4. Technical Stack & Tooling Matrix - **Languages:** Python 3.12+, Java 21 (LTS), C# 13 / .NET 9, SQL, Bash / POSIX Shell. - **AI & Agentic Frameworks:** LangChain, LangGraph, Google Antigravity SDK, Ollama, Llama.cpp, ChromaDB, Hugging Face Transformers & PEFT. - **Backend Infrastructure:** FastAPI, Uvicorn, Spring Boot 3, ASP.NET Core Minimal APIs, PostgreSQL, SQLite (with FTS5), Docker, Podman. - **Operating Systems & Environments:** Fedora Linux Workstation, Linux POSIX subsystems, Systemd, D-Bus, X11/Wayland automation tooling. - **Architecture Paradigms:** Event-driven architecture, Cyclic State Graphs, Microservices, Clean/Hexagonal Architecture, Test-Driven Development. --- ## 5. Contact & Social Graph - **Portfolio Website:** https://asimansari.com - **GitHub Profile:** https://github.com/asimansari-git - **LinkedIn Profile:** https://linkedin.com/in/link-asimansari - **Direct Email:** asimansari.mail@proton.me