Masih Moafi

AI/ML engineer building and evaluating AI coding agents, context engineering systems, LLM safety research, retrieval tools, and machine-learning projects.

Engineering Specialization & Core Pillars

I build, evaluate, and optimize autonomous LLM agent systems with an emphasis on context engineering, local hybrid retrieval (RAG), and empirical LLM safety research. My work bridges low-level systems programming in Rust and C++ with high-throughput neural pipelines in PyTorch and transformers.

  • Context Engineering & Agent Harnesses: Explicit token admission, context inspection, memory compaction, and session continuity for autonomous coding assistants.
  • High-Throughput Local Retrieval: Merging Tantivy BM25 lexical indexing with LanceDB columnar vector storage via Reciprocal Rank Fusion for air-gapped search.
  • LLM Safety & Red-Teaming: Controlled evaluations of prompt injection, role confusion, chain-of-thought forgery, and reasoning-channel leakage.

Selected Projects & Applied Research

  • Elpis

    Open-source Rust fork of OpenAI Codex CLI with explicit context pruning, memory compaction, and continuity for AI coding agents. Provides selective context admission, auditable pruning records, portable checkpoints, and provider-neutral model access.

  • Eyes Wide Shut

    AI safety and red-teaming research on prompt framing, dialogue state, tool use, and reasoning-channel exposure in LLMs, evaluating multi-vector jailbreak resistance on open-weight models.

  • rag-mcp

    High-throughput local hybrid RAG engine combining Tantivy BM25 lexical indexing, LanceDB vector search, and Cross-Encoder reranking for AI coding agents and technical workflows.

  • WhisperType

    Local GPU-accelerated voice input and speech-to-text with whisper.cpp CUDA transcription and optional LLM refinement for developer productivity.

  • Financial Market Analysis

    FX signal prediction and time-series forecasting with double-tower gated transformers, LightGBM, and CatBoost on five years of tick-level market data.