
S
Selvedge
Free๐ Alt to ADRs / Mem0Local decision history and persistent memory that coding agents can retrieve across sessions
๐ณ Self-Hostable๐ No Sign-upโก Editorial Signal: 77/100โ
27 Stars
pip install selvedgeSelvedge is a lightweight, local-first decision history engine engineered specifically for autonomous AI coding agents (such as Cursor, Claude Code, and Cline). Instead of relying on lossy conversation context or monolithic system instruction files, Selvedge tracks the architectural 'why' behind codebasesโrecording design decisions, stated rationales, constraints, and explicitly rejected approaches in a project-local SQLite database. Future agent sessions can query historical decisions by function, column, or route via a Python CLI or native Model Context Protocol (MCP) server, preventing agents from breaking unwritten rules or repeating failed code implementations.
Stores architectural decisions, stated rationales, and rejected paths in a zero-latency SQLite database versioned alongside the project codebase.
Look up relevant design constraints and past attempts by querying specific named functions, database columns, API routes, or custom entities.
Seamlessly accessible via standard Python CLI commands or natively integrated into AI coding agents via the Model Context Protocol (MCP).
Preventing autonomous coding agents from repeating previously tested and rejected implementation approaches across fresh conversation sessions
Preserving architectural decisions and unwritten constraints without bloating agent context windows with monolithic instruction documents
Providing human developers with a structured, queryable rationale log of why specific functions or schemas were engineered a certain way
While Architecture Decision Records (ADRs) capture formal high-level project milestones and rule files (e.g. .cursorrules) define standing constraints, Selvedge provides granular, entity-keyed micro-decisions and rejected paths stored locally in SQLite and queryable on demand via MCP.
AI software engineers, agent framework developers, and teams building with autonomous coding assistants who need reliable cross-session architectural continuity.
Selvedge is engineered to eliminate critical operational friction in ai agents & autonomous. From an architectural standpoint, the system adopts a local-first, self-contained deployment posture, ensuring streamlined onboarding and minimal setup overhead.
Delivered for local workstation execution, allowing developers to run workflows directly within their local environment according to official documentation.
Modern AI coding agentsโranging from terminal agents like Claude Code to IDE extensions like Cursor and Windsurfโexcel at localized code generation and refactoring. However, they suffer from a systemic operational flaw: cross-session amnesia. When an agent starts a new conversation session, the entire chain-of-thought, intermediate trial-and-error, and architectural trade-offs discussed in previous sessions vanish. Developers frequently observe agents reverting intentional trade-offs or repeatedly proposing implementations that were already tested and explicitly rejected days earlier. Traditional solutions fall short: git blame only reveals line mutations without capturing rejected paths; Architecture Decision Records (ADRs) are too heavyweight for micro-decisions; and monolithic instruction files (such as .cursorrules) quickly exhaust precious context window tokens. Selvedge solves this fundamental friction by introducing a structured, entity-keyed decision ledger designed to run locally alongside the codebase.
At the core of Selvedge is a zero-latency, local SQLite storage engine embedded directly within the target repository. Instead of indexing generic text blobs or embedding vectors, Selvedge structures memory around named programmatic entitiesโfunctions, classes, database columns, API routes, or config parameters. Every recorded entry captures three vital dimensions: the decision taken, the technical rationale behind it, and the alternatives that were rejected along with reasons for their rejection. Because storage is local SQLite, reads execute in sub-millisecond time with zero cloud latency, zero external API costs, and complete privacy for proprietary codebases. Decisions can be grouped using shared changeset tags across multiple files and routes, allowing agents to inspect full architectural blast radiuses before modifying dependent modules.
Selvedge achieves seamless integration with modern coding workflows through two interoperable interfaces: a lightweight Python CLI and a native Model Context Protocol (MCP) server. When configured as an MCP client within an agent environment (such as Claude Desktop, Cursor, or Cline), Selvedge exposes specialized retrieval and mutation tools directly to the agent's function-calling runtime. Before refactoring a database schema or modifying an authentication route, the agent autonomously executes a lookup tool against the relevant entity name. The MCP server returns the structured decision history and rejected approaches directly into the agent's scratchpad, steering the model toward compliant implementations without human intervention. Developers can also inspect, export, or audit records using standard CLI commands like 'selvedge log' or generate markdown digests for documentation.
Selvedge provides an exceptionally pragmatic balance between informal code comments and formal enterprise architecture documentation. Its primary strength lies in its explicit capture of negative knowledge: recording why an approach failed is often ten times more valuable for an AI agent than merely seeing the current code. The operational requirement is discipline: either the developer or the agent must invoke the recording tool when a key technical fork is decided. For software engineering teams leveraging autonomous AI coding assistants, Selvedge represents a high-signal, zero-cost productivity multiplier. By pairing local SQLite data ownership with standardized MCP connectivity, it establishes a reliable architectural memory substrate that preserves hard-won engineering context across agent sessions.
Selvedge is a local decision history engine that stores architectural decisions, rationales, and rejected approaches in project-local SQLite. It gives AI coding agents persistent cross-session memory so they don't repeat failed approaches or break unwritten constraints.
Coding agents connect to Selvedge natively via the Model Context Protocol (MCP) or by invoking the local Python CLI. When editing a specific function, class, or route, the agent queries Selvedge for entity-specific decision history.
No. Agent instruction files (like AGENTS.md or .cursorrules) suit standing rules, and ADRs suit reviewed high-level architecture milestones. Selvedge complements them by adding queryable entity-level micro-decision history and rejected alternatives.
Yes. Selvedge is 100% free and open source under the permissive MIT license. All data is stored locally on your machine in SQLite with zero cloud telemetry.
You can install Selvedge via pip (pip install selvedge) or uv. Run 'selvedge init' in your repository root to initialize the local SQLite database and configure the local MCP server.
ToolsRadar maintains strict editorial independence. This review of Selvedge was conducted using our standardized 5-pillar evaluation framework (Setup, Code Auditability, Maintenance Vitality, Cost Advantage, and Community Signal). We do not accept paid placements to inflate benchmark scores.
Maintainers of Selvedge and community advocates can display this real-time verification badge in your GitHub README, official documentation, or landing page.
[](https://lordorange.top/tool/selvedge)<a href="https://lordorange.top/tool/selvedge" target="_blank"><img src="https://lordorange.top/badge/selvedge.svg" alt="Featured on ToolsRadar" /></a>Compare other trending developer tools and open-source projects in this space.
Cross-referenced architectural playbooks and category rankings featuring Selvedge.
Take back data ownership by replacing expensive monthly cloud subscriptions with self-hosted software.
Command-line agents, local repository indexers, and unconstrained software engineering assistants.
From simple autocomplete to multi-agent SWE loops: how autonomous agents read repos, run test suites, and write production software.
The definitive guide to escaping SaaS subscription sprawl with Coolify, Traefik, Tailscale, and automated S3 backup pipelines.