---
status: current
covers-version: v0.8.0
last-verified: 2026-05-10
sources-of-truth:
  - CHANGELOG.md
  - docs/ROADMAP.md
  - internal/lang/lang.go
audience: [contributors, evaluators, prospective users]
supersedes: []
---

# Prior Art & Landscape

## Introduction

Mache is an **AI-native projection engine** that turns structured data (JSON, SQLite, source code) into a navigable graph. A declarative schema defines the topology — how source nodes map to a tree of constructs — or, with `--infer`, the schema is derived automatically via Formal Concept Analysis (FCA). The engine handles ingestion, on-demand content resolution, cross-references (`callers/`, `callees/`, address refs, capnp-backed bindings), structural analysis (`find_smells`), schema inference, identity-preserving write-back, semantic search over `all-MiniLM-L6-v2` embeddings, pre-baked LSP results (defs/refs/hover/diagnostics), and hot-swap on a substrate-identity (`current_root`) primitive — paired with [ley-line-open](https://github.com/agentic-research/ley-line-open) as a coordinated release wave (v0.8.0 ↔ ley-line-open v0.2.0).

The unit of comparison throughout this document is **mache (+ ley-line-open)**, not standalone mache. ley-line-open ships the substrate mache consumes: AST tables, capnp binding event log, LSP outputs, and fastembed embeddings. A few mache tools (`semantic_search`, `get_type_info`, `get_diagnostics`, and parts of `find_smells`) only light up when a `.db` is present; the other thirteen MCP tools work standalone. See [ADR-0014](adr/0014-mache-in-constellation.md) for the architectural framing.

The graph is the product. Two equal-footing surfaces expose it: an **MCP server** (primary; 17 tools) and an optional **embedded NFS server** (via `go-nfs` + `billy`, in-process — not an OS export). The NFS choice is AI-native: agents already speak filesystem operations, so giving them a real path tree is the lowest-friction interface. Calling Mache "a filesystem" undersells it — the filesystem is one expression layer over a graph engine that also ships canonical refs/defs views, content-addressable substrate identity, AST-aware write-back, and structural-rule analysis.

This positions Mache at the intersection of several traditions — filesystem-as-interface (Plan 9), data virtualization (FUSE-DB tools), and AI-agent context engineering — but no existing tool combines all of its properties: schema-driven projection, AST decomposition, identity-preserving write-back, content-addressable substrate identity, and dual MCP+FS expressions of the same graph designed for agent consumption from day one.

> See [`competitive-landscape-2026.md`](competitive-landscape-2026.md) for the current commercial-tool comparison (Cursor, Cody, Augment, etc.). This document focuses on **intellectual lineage** — the academic and open-source traditions Mache descends from — rather than head-to-head feature comparison.

## Comparison Table

| Tool                                      | Schema-Driven Projection | AST-Aware Decomposition | Identity-Preserving Write-Back | On-Demand Content |       Cross-References       |          Real FS Mount           |
| ----------------------------------------- | :----------------------: | :---------------------: | :----------------------------: | :---------------: | :--------------------------: | :------------------------------: |
| **Mache**                                 |           Yes            |     Yes (28 langs)      |              Yes               |        Yes        | Yes (`callers/`, `callees/`) |            Yes (NFS)             |
| **codebase-memory-mcp**                   |            No            |     Yes (64 langs)      |               No               |        No         |       Yes (call graph)       |                No                |
| **lean-ctx**                              |    No (4 fixed modes)    |    Yes (signatures)     |               No               |   Yes (cached)    |    Yes (multi-edge graph)    |                No                |
| **AgentFS** (Turso)                       |            No            |           No            |         Yes (KV store)         |        No         |              No              |                No                |
| **Dust**                                  |            No            |           No            |               No               |        No         |              No              | No (synthetic FS via tool calls) |
| **Vercel bash-tool**                      |            No            |           No            |               No               |        No         |              No              |     No (manual file staging)     |
| **MCP**                                   |            No            |           No            |        Varies by server        |        N/A        |             N/A              |       No (protocol layer)        |
| **LlamaIndex / LangChain**                |            No            |           No            |               No               | Yes (retrievers)  |              No              |                No                |
| **AIGNE / AFS**                           |            No            |           No            |               No               |        No         |              No              |     No (namespace metaphor)      |
| **FUSE-DB tools** (FusqlFS, DBFS, wddbfs) |            No            |           No            |              Some              |        Yes        |              No              |               Yes                |
| **Plan 9 / 9P**                           |     Yes (per-server)     |           No            |              Yes               |        Yes        |              No              |               Yes                |

## Detailed Analysis

### codebase-memory-mcp (DeusData)

[codebase-memory-mcp](https://github.com/DeusData/codebase-memory-mcp) is a persistent knowledge graph MCP server for codebases. It indexes source code via tree-sitter into a SQLite-backed graph (nodes: Function, Class, Module, Route, etc.; edges: CALLS, HTTP_CALLS, IMPORTS, etc.) and exposes 12 MCP tools for structural queries. Key capabilities include Cypher-like query syntax, Louvain community detection, call-path tracing with risk classification, git diff impact analysis, and cross-service HTTP link discovery. It supports 64 languages, auto-syncs on file changes, and claims 99.2% token reduction vs. file-by-file exploration.

**Relationship to Mache:** codebase-memory-mcp is the closest tool in the landscape. Both use tree-sitter for AST parsing, SQLite for persistence, Louvain for community detection, and MCP for agent integration. Mache's `get_communities`, `get_overview`, and `find_definition` tools were directly inspired by codebase-memory-mcp's feature set.

**Key differences:**

- **Projection vs. indexing.** codebase-memory-mcp indexes code into a fixed graph schema (Function → CALLS → Function). Mache projects data through a user-defined topology schema — the same engine handles JSON, SQLite, and source code, and the directory structure is configurable rather than predetermined.
- **Write-back.** codebase-memory-mcp is read-only. Mache supports identity-preserving write-back: validate → format → splice → surgical node update, all through the MCP `write_file` tool or the mounted filesystem.
- **Real filesystem mount.** codebase-memory-mcp is MCP-only. Mache mounts as a real NFS filesystem (in-process `go-nfs` + `billy` server) — agents can use standard `ls`/`cat`/`echo` without any MCP client.
- **Language breadth vs. depth.** codebase-memory-mcp supports 64 languages with a uniform graph schema. Mache supports 28 languages and provides deeper structural features per language: context files (imports/globals per scope), doc comment extraction, write-back formatting, and configurable AST queries.
- **Data generality.** codebase-memory-mcp is code-only. Mache handles JSON, SQLite databases, and source code through the same schema-driven pipeline — e.g., projecting 323K NVD vulnerability records or 9.4K MCP registry entries alongside source code.
- **Query language.** codebase-memory-mcp offers Cypher-like queries over its graph. Mache uses SQL directly against the SQLite-backed graph (the `mache_refs` virtual table is available to MCP tools that need ad-hoc structural queries, e.g. `search`).

### lean-ctx

[lean-ctx](https://github.com/yvgude/lean-ctx) is a context-runtime layer for AI coding agents — a single Rust binary that compresses what reaches the LLM. It works at two layers: an MCP server that returns mode-aware file reads (`full`, `map`, `signatures`, `diff`), and a shell hook that compresses noisy CLI output (`git`, `npm`, `cargo`, `docker`, etc.) via 95+ patterns. Cached re-reads drop to ~13 tokens. It also ships a multi-edge property graph (imports, calls, exports, type_ref) with hybrid BM25 + embedding + graph-proximity search.

**Relationship to Mache:** the closest tool *philosophically* aimed at the same agent-context-shrinking problem, but with an inverted structure. Lean-ctx wraps every byte that reaches the LLM and shrinks it; Mache exposes a navigable filesystem and lets the agent pick its own granularity.

**Key differences:**

- **Modes are hardcoded vs. schema-driven.** Lean-ctx's 4 modes are baked in. Mache's planned mode-aware reads (bead `mache-qzsk`) will be schema-driven — each schema can ship its own modes (`mode=public-api`, `mode=protocol-only`) without code changes.
- **Layer.** Lean-ctx is in the LLM-tool path (MCP) and the shell-output path (hook). Mache is in the filesystem layer (NFS) plus MCP. Different layers — they could even compose (lean-ctx as middleware in front of mache).
- **Write-back.** Lean-ctx is read-only; mache supports identity-preserving write-back.
- **Filesystem mount.** Lean-ctx is MCP-only with no filesystem mount; mache mounts as real NFS so any tool that speaks paths works without an MCP client.
- **Data scope.** Lean-ctx is code-only. Mache projects arbitrary structured data through the same engine.

### AgentFS (Turso)

[AgentFS](https://github.com/tursodatabase/agentfs) provides a filesystem-like key-value store for AI agents backed by libSQL/Turso. It solves agent state persistence — saving and retrieving files that agents create during execution. It does not project external data into a filesystem; there is no schema, no topology reshaping, and no AST awareness. The "filesystem" is a storage abstraction, not an OS mount.

### "FUSE is All You Need" (Emmerling, 2025)

This [blog post](https://blog.philipmemmerling.com/fuse-is-all-you-need/) articulates the philosophical argument that FUSE filesystems are the ideal interface for AI agents — tools already speak files, so mount your data as files. Mache shares this philosophy entirely but goes further: it provides a general-purpose engine with declarative schemas, multi-format ingestion, and write-back, rather than a one-off FUSE implementation for a specific data source.

### Dust

[Dust](https://dust.tt/) provides AI assistants with access to company data through tool calls that return file-like results. The "filesystem" is synthetic — constructed per-query by the orchestration layer, not mounted as a real directory tree. There is no persistent topology, no schema-driven projection, and no write-back.

### Vercel bash-tool

Vercel's approach to agent file access uses a sandboxed bash environment where files are staged manually into the agent's working directory. This gives agents real file operations but requires explicit file preparation — there is no projection engine to reshape data, no schema, and no on-demand content resolution. The agent sees whatever files were placed in its sandbox.

### MCP (Model Context Protocol)

[MCP](https://modelcontextprotocol.io/) is a protocol standard for connecting AI models to data sources and tools. It defines the transport layer (JSON-RPC, stdio/SSE) but not the data plane. An MCP server *could* expose a filesystem, but MCP itself provides no schema language, no ingestion engine, and no topology projection. Mache could be wrapped as an MCP server, but it operates at a different layer — MCP is plumbing, Mache is the projection engine.

### LangChain / LlamaIndex

These frameworks provide RAG (Retrieval-Augmented Generation) pipelines: ingest documents, chunk them, embed them, and retrieve relevant fragments at query time. They solve the retrieval problem — finding relevant context — but not the structural problem. There is no filesystem interface, no schema-driven topology, and no write-back. An agent using LlamaIndex gets text chunks; an agent using Mache gets a navigable directory tree with cross-references.

### AIGNE / AFS (Agent Filesystem)

AIGNE's "Agent Filesystem" uses filesystem metaphors for agent tool registration — tools are "mounted" at namespace paths. This is a naming convention for tool dispatch, not a real filesystem. There are no inodes, no directory traversal, no read/write operations at the OS level.

### FUSE-DB Tools (FusqlFS, DBFS, wddbfs)

These tools mount databases as real FUSE filesystems — tables become directories, rows become files. They provide genuine OS-level mounts with read (and sometimes write) support. However, they **mirror** the database schema directly: the filesystem topology is 1:1 with the source schema. Mache adds a projection layer — the topology schema reshapes data into task-appropriate structures (e.g., temporal sharding by year/month, AST decomposition into function directories) that may differ entirely from the source layout.

### Plan 9 / 9P

Plan 9 from Bell Labs is the closest philosophical ancestor. Its core principle — "everything is a file server" — directly inspires Mache's approach. In Plan 9, every resource (network, process table, window system) is exposed as a synthetic filesystem via the 9P protocol. Each server defines its own namespace topology.

Mache applies this idea to structured data with two modern additions: (1) declarative schemas that specify the projection without writing a custom file server, and (2) AST-aware decomposition that understands source code structure. Plan 9 required implementing a new file server for each data source; Mache requires only a JSON schema.

## Academic Validation

Two recent papers provide independent validation of the file-as-interface approach for AI agents:

### "Files Are All You Need" (Piskala, January 2026)

This paper argues that the filesystem is the natural interface between AI agents and structured data — agents already operate on files, so exposing data as files eliminates the impedance mismatch between data access patterns and agent tool interfaces. The paper surveys existing approaches and concludes that real OS-level mounts (not synthetic file metaphors) are essential for seamless agent integration. Mache's architecture aligns directly with this thesis.

### "Structured Context Engineering" (McMillan, February 2026)

Based on 9,649 experiments across multiple LLMs, this paper demonstrates that domain-partitioned file schemas significantly improve agent task performance compared to flat file dumps or RAG retrieval. The key finding: when data is organized into semantically meaningful directory hierarchies (by domain, by time period, by construct type), agents navigate more efficiently and produce more accurate results. This validates Mache's schema-driven topology approach — the projection is not just convenient, it materially affects agent performance.

## Sources

- codebase-memory-mcp (DeusData): https://github.com/DeusData/codebase-memory-mcp
- lean-ctx: https://github.com/yvgude/lean-ctx
- AgentFS (Turso): https://github.com/tursodatabase/agentfs
- "FUSE is All You Need": https://blog.philipmemmerling.com/fuse-is-all-you-need/
- Dust: https://dust.tt/
- Model Context Protocol: https://modelcontextprotocol.io/
- LlamaIndex: https://www.llamaindex.ai/
- LangChain: https://www.langchain.com/
- FusqlFS: https://github.com/jking/fusqlfs
- Plan 9 from Bell Labs: https://9p.io/plan9/
- 9P Protocol: https://9p.io/sys/man/5/INDEX.html
