FPInsight Coder
A production-grade, LLM-powered coding assistant built from the ground up in Rust, with a full Plan-Act-Observe-Reflect execution loop.
What it is
FPInsight Coder is an autonomous coding assistant with a terminal-based UI that goes beyond simple code generation. It implements the same agentic architecture behind leading commercial tools — Plan, Act, Observe, Reflect — giving it the ability to reason about complex multi-step tasks, use tools, learn from outcomes, and adapt its approach in real time.
The system comprises ~165,000 lines of Rust across 463 source files, backed by 56 Architecture Decision Records documenting every significant design choice.
Technical highlights
Multi-Provider LLM Gateway
A unified abstraction layer supporting 21 LLM providers (Anthropic, OpenAI, Google Gemini, DeepSeek, xAI, Groq, Ollama, and more), with provider-specific optimisations including prompt caching, token counting, and cache-aware model routing that achieves up to 90% cost reduction on knowledge-intensive tasks.
Oracle Pattern for Code Validation
Instead of the typical "generate, compile, fix errors" cycle, FPInsight Coder performs speculative validation before writing to disk. For Rust, it integrates directly with rust-analyzer for zero-latency semantic analysis, type inference injection, and automated repair suggestions. For Python, JavaScript, Go, and dbt/SQL, it integrates with language-specific linters and BigQuery dry-run validation.
Four-Layer Memory Architecture
Working memory, episodic memory (conversation history with vector embeddings), semantic memory (symbol graphs and code summaries), and procedural memory (learned patterns and error recovery strategies). The system includes a knowledge distiller that extracts generalizable rules from observed patterns — a form of lifelong learning.
DAG-Based Parallel Execution
Complex tasks are decomposed into atomic checkpointed units ("Atoms of Thought") with explicit dependency graphs. Independent atoms execute in parallel with conflict detection, while verification contracts (compilation checks, test runs, oracle validation) gate progression between stages.
Enterprise-Grade Tool System
25+ built-in tools (file operations, sandboxed bash, semantic search, git integration, diff generation) organised into risk tiers with a human-in-the-loop approval system supporting permanent, temporary, and pattern-based authorisation rules.
MCP Integration
Full Model Context Protocol client with stdio and HTTP/SSE transport, including a companion data-mesh MCP server for BigQuery and data catalog integration — bridging AI-assisted coding with enterprise data governance.
Terminal UI
A Ratatui-based frontend with streaming responses, model selection, voice input, image rendering, and agent management — all communicating through a single clean API boundary.
Architecture and engineering
The codebase serves as a reference implementation for several advanced patterns:
- Dependency injection via a typed service container with lazy initialisation and coordinated shutdown
- Two-database persistence (redb for structured data, LanceDB for vector embeddings) selected through rigorous benchmarking
- Tree-sitter multi-language parsing (6 languages) for AST-aware code chunking and semantic search
- gix (pure-Rust git) integration for change tracking and workspace indexing
- Assistant-friendly code organisation — strict file size limits (<800 lines), function size limits (<100 lines), and standardised module split patterns designed for efficient modification by AI coding tools
What this demonstrates
| Competency | Evidence |
|---|---|
| Agentic AI Systems | Full Plan-Act-Observe-Reflect loop, subagent spawning, DAG-based parallel execution |
| LLM Engineering | 21-provider gateway, prompt caching strategies, cache-aware routing, token budget management |
| Compiler & Toolchain Integration | rust-analyzer embedding, tree-sitter parsing, language oracle pattern |
| Systems Programming in Rust | 165k LOC, async/tokio, zero-copy Arrow, embedded vector DB |
| Enterprise Architecture | DI container, tiered security model, MCP interoperability, 56 ADRs |
| Applied ML Infrastructure | Vector search (LanceDB), hybrid retrieval, reranking, multi-provider embeddings |
| Human-AI Interaction Design | Approval system, preference learning, proactive analysis, TUI with streaming |
Technology stack
| Layer | Technology |
|---|---|
| Language | Rust (async/tokio) |
| Storage | redb + LanceDB (Arrow) |
| Code Analysis | tree-sitter, rust-analyzer |
| LLM Providers | Anthropic, OpenAI, Gemini, DeepSeek, xAI, Groq, Ollama, + 14 more |
| Protocol | MCP (Model Context Protocol) |
| UI | Ratatui |
| Git | gix (pure Rust) |
Want to discuss?
We build these products with the same rigour we bring to our consulting engagements.
Get in touch