Overview & Architecture
Recursive Engineering Memory Interface (REMI) is a Node.js-based CLI application providing autonomous project memory and interactive work graphs.
REMI (Recursive Engineering Memory Interface) acts as an automated memory layer for developers. It bridges the gap between chaotic git commits, daily standups, and multi-project knowledge management.
The system is designed with a local-first philosophy: zero cloud latency by default, optional real-time Supabase cloud synchronization, and 100% operational uptime via a multi-model AI fallback router.
System Architecture Overview
REMI is built as a zero-latency, local-first engineering memory interface. The architecture couples embedded SQLite FTS5 for offline querying, an intelligent multi-model AI routing cascade for natural language parsing, native OS notification dispatchers, and live cloud synchronization with Supabase.
Figure 1.1 — High-Level System Architecture of REMI Ecosystem1. Local SQLite FTS5 Full-Text Search Engine
REMI stores all work logs, project relations, and tags locally in an embedded SQLite database (~/.remi/remi.db). Uses FTS5 virtual tables to perform full-text search across thousands of commit logs in under 2ms.
Figure 1.2 — Local SQLite FTS5 Virtual Table & Supabase Cloud Dual Engine Schema| 1 | -- FTS5 Virtual Table Schema for Instant Local Search |
| 2 | CREATE VIRTUAL TABLE IF NOT EXISTS work_logs_fts USING fts5( |
| 3 | project, |
| 4 | action_summary, |
| 5 | tags, |
| 6 | author, |
| 7 | content='work_logs', |
| 8 | content_rowid='id' |
| 9 | ); |
| 10 | |
| 11 | -- Ultra-fast BM25 Relevance Search Query |
| 12 | SELECT w.id, w.project, w.action_summary, w.tags, rank |
| 13 | FROM work_logs w |
| 14 | JOIN work_logs_fts fts ON w.id = fts.rowid |
| 15 | WHERE work_logs_fts MATCH 'Stripe OR auth' |
| 16 | ORDER BY rank LIMIT 25; |
2. Multi-Model AI Fallback Router
When logging work in natural language (e.g. remi log "Built Stripe checkout webhooks with @Amit"), REMI routes the string through an intelligent multi-model cascade. If the primary model (Gemini 2.5-Flash) encounters downtime or 404/rate-limit errors, REMI autonomously cascades to Gemini 2.0-Flash, Gemini 2.5-Pro, local Ollama, Groq, or deterministic fallback.
Figure 1.3 — Multi-Model AI Fallback Router Execution Flowchart| 1 | // REMI Multi-Model AI Routing Cascade |
| 2 | async function parseWorkLogWithFallback(inputString) { |
| 3 | const models = [ |
| 4 | { provider: 'gemini-2.5-flash', api: callGeminiFlash25 }, |
| 5 | { provider: 'gemini-2.0-flash', api: callGeminiFlash20 }, |
| 6 | { provider: 'gemini-2.5-pro', api: callGeminiPro25 }, |
| 7 | { provider: 'gemini-2.0-flash-lite',api: callGeminiLite20 }, |
| 8 | { provider: 'ollama-local', api: callLocalOllama }, |
| 9 | { provider: 'groq-llama3', api: callGroqLlama }, |
| 10 | { provider: 'strict-parser', api: parseDeterministicFlags } |
| 11 | ]; |
| 12 | |
| 13 | for (const { provider, api } of models) { |
| 14 | try { |
| 15 | const result = await api(inputString); |
| 16 | if (result) return { ...result, _provider: provider }; |
| 17 | } catch (err) { |
| 18 | console.warn(`[REMI Router] Provider ${provider} failed, trying fallback...`); |
| 19 | } |
| 20 | } |
| 21 | } |
3. Zero-Dependency Native OS Notification Dispatcher
To push desktop reminders (remi schedule) without introducing security vulnerabilities or heavy background processes, REMI uses zero external dependencies (0 vulnerabilities). It dispatches notifications using native operating system binaries.
| 1 | // Native OS Notification Dispatcher (Zero NPM Dependencies) |
| 2 | import { exec } from 'child_process'; |
| 3 | import os from 'os'; |
| 4 | |
| 5 | export function notifyOS({ title, message, iconPath }) { |
| 6 | const platform = os.platform(); |
| 7 | |
| 8 | if (platform === 'win32') { |
| 9 | // Windows PowerShell WinRT Balloon Tooltip Fallback |
| 10 | const psScript = `[reflection.assembly]::loadwithpartialname('System.Windows.Forms'); |
| 11 | $notify = new-object system.windows.forms.notifyicon; |
| 12 | $notify.icon = [system.drawing.systemicons]::information; |
| 13 | $notify.visible = $true; |
| 14 | $notify.showballoontip(3000, '${title}', '${message}', [system.windows.forms.tooltipicon]::info);`; |
| 15 | exec(`powershell -Command "${psScript}"`); |
| 16 | } else if (platform === 'darwin') { |
| 17 | // macOS AppleScript Dispatcher |
| 18 | exec(`osascript -e 'display notification "${message}" with title "${title}"'`); |
| 19 | } else { |
| 20 | // Linux Desktop Notification |
| 21 | exec(`notify-send "${title}" "${message}"`); |
| 22 | } |
| 23 | } |
4. Autonomous Git Hooks & Work Graph Engine
The post-commit git hook automatically captures your git commit messages, extracts project context and author tags (@User), and builds a D3 force-directed physics network graph.
Figure 1.4 — Interactive D3.js Force-Directed Physics Knowledge Graph Output| 1 | #!/bin/sh |
| 2 | # REMI Git Post-Commit Hook |
| 3 | COMMIT_MSG=$(git log -1 --pretty=%B) |
| 4 | AUTHOR=$(git log -1 --pretty=%an | tr -d ' ') |
| 5 | SUBJECT=$(echo "$COMMIT_MSG" | head -n 1) |
| 6 | |
| 7 | # Log work with project & author tags |
| 8 | zaarvy-remi log -p "zaarvy-landing" -m "Committed: $SUBJECT" -t "git, @$AUTHOR" |