Spec Kit Memory Hub
Repository-native, Git-reviewable memory extension for AI coding assistants to persist project context across features, using SQLite caching for up to 10x token reduction.
README
🧠 Spec Kit Memory Hub
Durable project memory and context for AI-assisted development.
Spec Kit Memory Hub (memory-md) is a repository-native, Git-reviewable memory extension that provides AI coding assistants with persistent context across features. It ensures your agents reuse past architectural decisions, domain constraints, bug patterns, and lessons learned instead of repeating mistakes.
⚡ Core Value: Up to 10x Token Savings
Traditional systems either read the entire codebase (wasting thousands of tokens) or start every prompt from scratch. Memory Hub uses a three-tier architecture with a SQLite Caching Optimizer to compress context:
| Feature Layer | Storage Location | Retention / Scope | Context Strategy |
|---|---|---|---|
| 1. Governance Law | .specify/memory/ |
Immutable guidelines (principles, rules, constitution) | Injected only during planning/validation |
| 2. Project History | docs/memory/ |
Long-term memory (decisions, worklogs, bug preventions) | Stored as Markdown, indexed and retrieved selectively |
| 3. Feature Memory | specs/<feature>/ |
Temporary context (watchpoints, open questions) | Generates memory-synthesis.md hard-capped at 900 words |
Why Developers and Teams Use It:
- Up to 10x Token Reduction: Replaces broad codebase context dumps with highly compressed, 900-word targeted synthesis.
- Prevent Recurring Bugs: Ensures a bug solved in Feature #2 is never reintroduced in Feature #5.
- Seamless Onboarding: New developers and AI agents immediately inherit the project's historical memory.
- Zero-Leak Privacy: Global cross-project sync operates entirely locally using SHA-256 project path anonymization.
🚀 Quick Start in 3 Steps
1. Install the Extension
Add the extension to Spec Kit CLI (either from the official registry, a release artifact URL, or a local directory):
From the Registry (Recommended):
specify extension add memory-md
From a Release Artifact (ZIP):
specify extension add memory-md --from https://github.com/DyanGalih/spec-kit-memory-hub/archive/refs/tags/v1.0.0.zip
From a Local Developer Artifact:
specify extension add memory-md --dev /path/to/spec-kit-memory-hub
2. Bootstrap Your Project
Initialize the folder structure and instructions inside your repository:
/speckit.memory-md.init
This creates:
docs/memory/— Permanent, Git-tracked project memory templates..github/copilot-instructions.md— Active agent workflow context..specify/extensions/memory-md/config.yml— Customizable extension settings.
3. Profile Stack sync channels
Profile the repository's technologies to subscribe to cross-project shared lessons:
/speckit.memory-md.init-project
🛠️ Memory Commands Directory
| Spec Kit Command | When To Use | What It Does |
|---|---|---|
/speckit.memory-md.init |
Once, at project setup | Bootstraps the folder structure, templates, and config. |
/speckit.memory-md.plan-with-memory |
Before planning a feature | Selectively indexes memory files and synthesizes a memory-synthesis.md file. |
/speckit.memory-md.prepare-context |
During active implementation | Refreshes the local database cache and regenerates synthesis blocks. |
/speckit.memory-md.capture |
After verifying feature work | Reviews work to propose high-value permanent lessons for BUGS.md or DECISIONS.md. |
/speckit.memory-md.capture-from-diff |
After rapid bug fixes | Fast capture path: reviews git diffs and extracts durable bug prevention patterns. |
/speckit.memory-md.share-lesson |
When local lesson is validated | Elevates an approved local lesson globally and anonymizes paths via SHA-256. |
/speckit.memory-md.sync-shared |
When beginning a new feature | Syncs matching tech-stack lessons from other projects into docs/memory/SHARED_LESSONS.md. |
/speckit.memory-md.audit |
When memory gets noisy | Finds contradictions, stale items, or duplicates, proposing cleanups. |
🔌 Native Model Context Protocol (MCP) Server
Memory Hub includes a native, fully-compliant Model Context Protocol (MCP) Server. This allows modern LLM clients (such as Claude Desktop, VS Code Cline, Roo-Cline, Cursor, etc.) to query, synthesize, share, and sync memory directly via JSON-RPC, without needing to execute terminal CLI subprocesses.
Key MCP Tools Exposed to Your Agent:
speckit_memory_search: Fast SQLite-cached semantic search across local project memories.speckit_memory_synthesize: Directly generates a 900-word compressedmemory-synthesis.mdcontext file.speckit_memory_share_lesson: Elevates and publishes an approved local lesson into the global local database.speckit_memory_sync_shared: Pulls matching technology stack lessons intodocs/memory/SHARED_LESSONS.mdwith interactive review banners.speckit_memory_init_project: Profiles active project languages/frameworks to configure sync channels.speckit_memory_token_report: Generates an estimated token savings report. (Note: This compares the theoretical token cost of reading raw codebase files vs. reading the optimized.spec-kit-memorycache. It does not track real-time LLM API usage.)
To start the server, configure your client to run the mcp-start command:
npx -y speckit-memory mcp-start
For complete configurations for Claude Desktop, Cline, and other IDE client settings, see the SQLite & MCP Architecture Guide.
📚 Technical Documentation Map
We have split the Spec Kit Memory Hub manual into focused technical resources:
spec-kit-memory-hub/
├── README.md ← Highly readable, high-level project summary
└── docs/
├── value-proposition.md ← Business case: Team velocity, alignment, and 10x token ROI
├── governed-memory-workflow.md ← Integration guides for Architecture Guard governed pipelines
├── reference-manual.md ← Detailed specs: File formats, CLI command list, and config schemas
├── sqlite-mcp-architecture.md ← Blueprints: SQLite cache, Model Context Protocol (MCP), and global sync
├── first-ten-minutes.md ← Step-by-step developer walkthrough for bootstrapping a new project
└── optimizer-roadmap.md ← Execution roadmap: SQLite Phase 1-4 and Phase 3.5 milestones
Direct Links:
- 🧠 Value Proposition & ROI — Deep-dive on team velocity, alignment gains, and exact token benchmarks.
- 🛡️ Governed Memory Workflow — Best practices for combining Memory Hub with Architecture Guard and Security Review validation gates.
- 📘 Reference Manual — File schema layouts, available prompts, environment variables, configuration properties, and IDE agent settings.
- 🔌 SQLite & MCP Architecture — Architectural details of the local optimizer, exposed Stdio MCP JSON-RPC tools, and anonymized sync protocols.
- ⏱️ First 10 Minutes: Concrete Example — Practical developer walkthrough from
/initthrough context planning. - 🗺️ Technical Roadmap — The active development roadmap across SQLite, MCP, and high-performance hybrid indexing.
⚖️ Design Philosophy
- Automated Confidence-Based Capture: Memory capture evaluates AI confidence. If confidence is > 50%, memory is automatically captured and registered. If <= 50%, it is ignored to keep permanent memory pristine.
- Visible in Git: All decisions and lessons are fully tracked in Git history, not hidden in local app state.
- Specs Remain Clean: Specifications define the active target; Memory Hub captures durable past constraints.
- AI Complements Thinking: The agent prepares synthesis context, but developers review and authorize all changes.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。