SQLew

SQLew

sin5ddd

Provides AI agents with persistent memory by storing architectural decisions, constraints, and task management in SQLite databases to eliminate repeated context and maintain consistency across sessions.

Optimizes multi-agent coordination through intelligent SQLite database design with normalized tables, integer enums, and pre-aggregated views to achieve 96% token reduction in context sharing for decision tracking, agent messaging, file change monitoring, and constraint management.

3258 views1Local (stdio)

What it does

  • Store and version architectural decisions with metadata
  • Track file modifications and database operations
  • Define and manage project constraints with priorities
  • Manage tasks with kanban workflow and file tracking
  • Query past decisions to avoid repeating debates
  • Suggest related decisions based on context patterns

Best for

AI coding assistants that need persistent memoryMulti-agent systems requiring coordinationDevelopment teams tracking architectural decisionsProjects with complex constraint management
96% token reduction in context sharingNo external data transmissionBuilt on Model Context Protocol (MCP)

About SQLew

SQLew is a community-built MCP server published by sin5ddd that provides AI assistants with tools and capabilities via the Model Context Protocol. SQLew boosts multi-agent coordination with efficient SQLite design, cutting context sharing tokens by 96% for decision a It is categorized under ai ml, databases. This server exposes 8 tools that AI clients can invoke during conversations and coding sessions.

How to install

You can install SQLew in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.

License

SQLew is released under the Apache-2.0 license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.

Tools (8)

decision

Context Management - Store decisions with versioning and metadata. Use action: "help" for documentation.

file

File Change Tracking - Track file modifications and database operations (SQLite only). Use action: "help" for documentation.

constraint

Architectural Rules - Define and manage project constraints with priorities. Use action: "help" for documentation.

task

Task Management - Create, track, and manage tasks with kanban workflow, layers, and file tracking. Use action: "help" for documentation.

help

**REQUIRED PARAMETER**: action (must be specified in ALL calls) Help System - Query action documentation, parameters, and workflow guidance Actions: - query_action: Get action documentation with parameters and examples - query_params: Get parameter list only (quick reference) - query_tool: Get tool overview and all actions - workflow_hints: Get common next actions after current action - batch_guide: Get guidance for batch operations - error_recovery: Analyze errors and suggest fixes Use this tool to understand how to use other sqlew tools. Returns only requested information (80-95% token reduction vs legacy help).

sqlew

sqlew_logo

npm version License

Design decisions, remembered by SQL — an MCP server for AI agents

What is sqlew?

The Problem

Every AI coding session starts from scratch. Your agent doesn't remember that you chose PostgreSQL over MongoDB last week, or that the team agreed on a specific API versioning strategy. Without persistent memory, agents repeat mistakes, contradict earlier decisions, and waste tokens re-discovering context.

The Solution

sqlew stores your architectural decisions in a structured SQL database. When a new session starts, the AI agent queries past decisions in milliseconds — not by reading through scattered Markdown files, but through efficient SQL lookups with metadata, tags, and similarity detection.

┌─────────────────────────────────────────────────────────────┐
│  Before sqlew                 │  After sqlew                │
│───────────────────────────────│─────────────────────────────│
│  Session 1: "Use PostgreSQL"  │  Session 1: "Use PostgreSQL"│
│  Session 2: "Use MongoDB?"    │    → decision recorded      │
│  Session 3: "Use PostgreSQL"  │  Session 2: query → got it  │
│  (same debate, every time)    │  Session 3: query → got it  │
│                               │    (instant recall)         │
└─────────────────────────────────────────────────────────────┘

sqlew is built on the Model Context Protocol (MCP), so it works with any MCP-compatible AI coding tool.

This software does not send any data to external networks. We NEVER collect any data or usage statistics.

Quick Start

1. Install

npm install -g sqlew

2. Setup

Choose the setup that matches your environment:

Claude Code (Plugin)

claude plugin marketplace add sqlew-io/sqlew-plugin
claude plugin install sqlew

The plugin automatically configures MCP server, Skills (Plan Mode guidance), and Hooks (automatic decision capture).

Codex CLI

See sqlew-codex for Codex CLI integration.

Manual

Add to .mcp.json in your project root:

{
    "mcpServers": {
        "sqlew": {
            "command": "sqlew"
        }
    }
}

The database (~/.config/sqlew/sqlew-shared.db) and config are auto-created on first run. See Shared Database for details.

3. Just use Plan Mode!

That's it. Every time you create a plan and get user approval, your architectural decisions are automatically recorded.

No special commands needed — just plan your work normally, and sqlew captures the decisions in the background.

Features

  • Structured Records — Decisions stored as relational data with metadata, tags, layers, and version history
  • Fast Queries — 2-50ms retrieval via SQL, even with thousands of decisions
  • Duplicate Detection — Three-tier similarity scoring (0-100) prevents redundant decisions
  • Constraint Tracking — Architectural rules and principles as first-class entities
  • Auto-Capture — Hooks automatically record decisions from Plan Mode (Claude Code plugin)
  • Multi-Database — SQLite (default), PostgreSQL, MySQL/MariaDB, or Cloud
  • Git Worktree Ready — Each worktree shares the same context database

For Teams (sqlew.io)

Connect to sqlew.io for team-shared decisions:

Step 1: Get your API key

Visit sqlew.io and save your API key:

# ~/.config/sqlew/.sqlew.env (shared across all projects)
SQLEW_API_KEY=your-api-key

Step 2: Configure each project

# .sqlew/config.toml
[database]
type = "cloud"

[project]
name = "your-project-name"

Benefits:

  • All team members share the same decision database
  • Works seamlessly with Git worktree workflows
  • No local database setup required

Performance

MetricValue
Query speed2-50ms
Concurrent agents5+ simultaneous
Storage efficiency~140 bytes/decision
Token savings60-75% vs Markdown ADRs

Use Cases

  • Architecture Evolution — Document major decisions with full context and alternatives considered
  • Pattern Standardization — Establish coding patterns as constraints, enforce via AI code generation
  • Cross-Session Continuity — AI maintains context across days/weeks without re-reading docs
  • Multi-Agent Coordination — Multiple AI agents share architectural understanding
  • Onboarding Acceleration — New AI sessions instantly understand project history

Documentation

GuideDescription
ADR ConceptsArchitecture Decision Records explained
ConfigurationConfig file setup, database options
Hooks GuideClaude Code Hooks integration
Cross DatabaseMulti-database support
CLI UsageDatabase migration, export/import

Upgrade Guides

MCP Tools

7 action-based tools: decision, constraint, suggest, help, example, use_case, queue

All tools support action: "help" for documentation.

Support

Support development via GitHub Sponsors.

Version

Current version: 5.0.8

See CHANGELOG.md for release history.

What's New in v5.0.8:

  • PR ADR enforcement — PreToolUse Hook blocks gh pr create without ADR markers, file-grouped format
  • Codex CLI support — Works beyond Claude Code via sqlew-codex
  • Plugin-first architecture — Simplified setup via sqlew-plugin
  • Cloud backend — Connect to sqlew.io for team-shared decisions

License

Apache License 2.0 — Free for commercial and personal use. See LICENSE for details.

Links


Built with MCP SDK, better-sqlite3, and TypeScript.

Alternatives

Related Skills

Browse all skills
literature-review

Conduct comprehensive, systematic literature reviews using multiple academic databases (PubMed, arXiv, bioRxiv, Semantic Scholar, etc.). This skill should be used when conducting systematic literature reviews, meta-analyses, research synthesis, or comprehensive literature searches across biomedical, scientific, and technical domains. Creates professionally formatted markdown documents and PDFs with verified citations in multiple citation styles (APA, Nature, Vancouver, etc.).

377
postgresql-psql

Comprehensive guide for PostgreSQL psql - the interactive terminal client for PostgreSQL. Use when connecting to PostgreSQL databases, executing queries, managing databases/tables, configuring connection options, formatting output, writing scripts, managing transactions, and using advanced psql features for database administration and development.

38
fullstack-developer

Modern web development expertise covering React, Node.js, databases, and full-stack architecture. Use when: building web applications, developing APIs, creating frontends, setting up databases, deploying web apps, or when user mentions React, Next.js, Express, REST API, GraphQL, MongoDB, PostgreSQL, or full-stack development.

11
supabase-rls-policy-generator

This skill should be used when the user requests to generate, create, or add Row-Level Security (RLS) policies for Supabase databases in multi-tenant or role-based applications. It generates comprehensive RLS policies using auth.uid(), auth.jwt() claims, and role-based access patterns. Trigger terms include RLS, row level security, supabase security, generate policies, auth policies, multi-tenant security, role-based access, database security policies, supabase permissions, tenant isolation.

10
notion

Notion workspace integration. Use when user wants to read/write Notion pages, search databases, create tasks, or sync content with Notion.

10
biomni

Autonomous biomedical AI agent framework for executing complex research tasks across genomics, drug discovery, molecular biology, and clinical analysis. Use this skill when conducting multi-step biomedical research including CRISPR screening design, single-cell RNA-seq analysis, ADMET prediction, GWAS interpretation, rare disease diagnosis, or lab protocol optimization. Leverages LLM reasoning with code execution and integrated biomedical databases.

9