This post, originally published on zhichai.net, examines how AI coding assistants are moving beyond probabilistic retrieval toward systems with true structural understanding, persistent memory, and on-device presence. It analyzes three projects that together signal a paradigm shift from "blindfolded giant" tools to accountable "digital retainers."
Key points
GitNexus: giving AI a code map
- Problem: RAG-based coding assistants only see fragments; they miss call chains, module dependencies, and blast radius of changes—probabilistic guessing rather than deterministic lookup.
- Solution: GitNexus builds a deterministic knowledge graph of a codebase:
- Parsing: Tree-sitter (incremental AST parsing), supporting 14 languages (TypeScript, Python, Java, Go, Rust, C/C++, etc.)
- Storage: LadybugDB (formerly KuzuDB), an embedded, privacy-first graph database—no server, data never leaves the machine
- Visualization: Sigma.js + Graphology
- MCP integration: 7 Model Context Protocol tools (
query,context,impact,detect_changes,rename,list_repos,cypher), letting agents deterministically answer "who calls this function?" and analyze change impact. Multi-repo support via a global registry. - Risk model L0–L4: from purely local edits (L0) to architecture-level changes (L4), each tier mapping to review/test recommendations.
- Use cases: onboarding to a 100k-line codebase in hours instead of weeks, safe large-scale migrations, automated PR risk analysis in CI/CD, and technical-debt visualization via Leiden community detection.
- Concept: proposed by Seamus Brady (March 2026 paper, arXiv:2604.04660)—an AI with persistent memory, explicit permissions, domain autonomy, and full auditability, modeled on the trusted retainer relationship.
- Sensorium: a structured XML block auto-injected each reasoning cycle providing time awareness, situational context, performance vitals (success rate, cost trend, CBR hit rate), sub-agent health, and affect states—read from in-memory ETS tables with zero latency.
- Memory: ten append-only JSONL stores (narrative, CBR cases, facts, tasks, endeavours, affect, telemetry, etc.).
- Case-Based Reasoning (CBR): stores full problem-solution-outcome cases with hybrid retrieval and usefulness scoring. In a 23-day deployment it accumulated 483 cases, self-diagnosed infrastructure bugs, and classified its own failure modes.
- Auditability: append-only logs, a cycle-log DAG (24,035 entries), normative-calculation safety gating with nameable axiom traces, and honest post-cycle reflections—the system can reconstruct any decision.
- Tech stack: ~62,000 lines of statically typed Gleam on Erlang/OTP.
Resulttypes force explicit error handling,Subject<T>gives type-safe message passing, and OTP supervision trees enabled 23 days of unattended uptime, auto-recovering from 714 LLM timeouts with zero data corruption. - AI Edge Gallery + LiteRT-LM: fully offline inference across Android, iOS (in progress), Windows/Linux/macOS (Metal), WebGPU, and IoT boards (Raspberry Pi 5 at 7.6 tokens/sec; Qualcomm IQ8 NPU at 31 tokens/sec).
- Gemma 4 family: 1B/4B/12B/27B dense models plus MoE variants E2B (2B active of 26B total) and E4B—E2B runs in under 1.5GB RAM via quantization and memory-mapped layer embeddings. Supports text+image input, 140+ languages, and local tool/function calling.
- Why on-device: privacy (data never leaves the device), zero API cost, low latency, offline availability. Hybrid architectures—simple/private tasks on-device, complex reasoning in the cloud—are the likely mainstream.
- GitNexus solves vision (deterministic code understanding), Springdrift solves memory (persistent, auditable learning), Google's stack solves presence (local, private, always-available inference).
- Together they sketch an assistant that knows your codebase's structure, remembers your preferences and past mistakes, runs locally, and can explain and be held accountable for its decisions.
- Remaining challenges: capability gaps vs. cloud models, context-length limits on low-memory devices, stale knowledge, battery cost, and safety/regulation of unmonitored local models.
- The post predicts: broad on-device adoption for simple tasks by 2026–2027, near-parity hybrid architectures by 2028–2029, and mainstream personal "digital retainers" by 2030+.