Writ: Local Knowledge Graph and Bash Hooks for AI Coding Agents
This review examines Writ, an open-source enforcement layer for AI coding agents. It focuses on its local knowledge graph, hybrid RAG pipeline, and bash hook system for ensuring compliance with…
This review examines Writ, an open-source enforcement layer for AI coding agents. It focuses on its local knowledge graph, hybrid RAG pipeline, and bash hook system for ensuring compliance with coding standards.
TL;DR
Best for: Indie founders and small teams requiring strict, local-first enforcement of coding standards and architectural rules for AI-powered development, especially when using local LLMs or privacy-sensitive codebases. Skip if: You need a fully managed, cloud-native solution for AI agent orchestration or lack the technical expertise to configure and maintain a local knowledge graph and bash hooks. Bottom line: Writ offers a novel, local-first approach to ensure AI coding agents adhere to defined rules through a hybrid RAG architecture and process-level enforcement, preventing non-compliant code from being executed.
METHODOLOGY
This v0 review draws on the founder's published claims on Reddit and the technical details available in the associated GitHub repository. Independent benchmarks are pending. We will re-test Writ when claims diverge from observed behavior or significant new versions are released.
- Tool Name + Version + Date Observed: Writ (version unspecified, based on
infinri/WritGitHub repository), observed 2026-05-28. - Source Signal URL:
https://www.reddit.com/r/LocalLLaMA/comments/1tq6sd0/i_built_an_enforcement_layer_for_ai_coding_agents/ - What's Covered in This Review: The founder's claims regarding Writ's architecture, specifically its local Neo4j knowledge graph, five-stage hybrid RAG pipeline, and bash hook enforcement mechanism. We also cover the technical stack (Tantivy, hnswlib, ONNX runtime for
all-MiniLM-L6-v2embeddings) and its stated provider independence for the retrieval engine. - What's NOT Covered: Independent performance benchmarks, long-term workflow integration, ease of maintenance for complex rule sets, or edge case behavior with various coding agents beyond the currently wired Claude Code system. We have not performed hands-on testing.
WHAT IT DOES
Writ aims to solve two core problems with AI coding agents: context overload from irrelevant rules and a lack of enforcement for compliance. It achieves this through a two-pronged architecture: a local knowledge layer and a process-level enforcement layer.
Local Knowledge Graph for Context Management
Writ stores coding rules, skills, techniques, antipatterns, and playbooks as nodes within a Neo4j knowledge graph. These nodes are connected by typed relationships, allowing for structured representation of complex coding standards. This layer is designed to manage and retrieve only the most relevant information for a given task, preventing the agent's context window from being filled with extraneous data.
Hybrid RAG Pipeline for Relevant Retrieval
The system employs a five-stage retrieval pipeline to fetch relevant information from the knowledge graph. This pipeline combines BM25 for keyword search (over Tantivy), vector similarity search (over HNSW with a local ONNX embedding model using all-MiniLM-L6-v2), and graph traversal. The results are then fused using reciprocal rank fusion, and a context budget manager prunes the final selection. All retrieval operations run locally, eliminating external API calls and enabling fast inference without a dedicated GPU.
Bash Hook Enforcement for Compliance
An enforcement layer, consisting of 30 bash hook scripts, intercepts tool calls made by the AI agent before execution. These scripts act as hard blocks at the process level, not merely as prompt instructions. For example, an agent cannot write code without an approved plan, cannot skip tests, and cannot claim
- I built an enforcement layer for AI coding agents using a local knowledge graph and hybrid RAG ↗
- infinri/Writ ↗
Every claim ties to a primary source. See our methodology.