This commit brings v2.0.4 changes to main without problematic SQLite database files: ### 🗄️ SQLite Memory System - Enhanced SQLite Schema with 12 specialized tables - Persistent storage in .swarm/memory.db with WAL mode - Cross-session persistence for Claude Code sessions - Namespace support for organized memory management ### 🔧 MCP Server Integration - EnhancedMemory class extending SqliteMemoryStore - 14 Hook types for comprehensive operation tracking - Memory synchronization between CLI and MCP tools - Robust error handling and database integrity ### 📁 Project Organization - Archive legacy systems to archive/legacy-memory-system - Clean root structure for better maintainability - Updated documentation reflecting SQLite architecture ### 🔗 NPM Package Updates - Include memory JS/SQL files in distribution - MCP server files included in npm package - Version updated to 2.0.0-alpha.42 ### ⚙️ Configuration Updates - .gitignore excludes SQLite database files - .npmignore includes necessary memory components - CLI version consistency at 2.0.0-alpha.42 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
SPARC Memory Bank System
Overview
The SPARC Memory Bank is a sophisticated, distributed memory management system designed for multi-agent collaborative development environments. It provides persistent, searchable, and conflict-resistant storage with advanced features including CRDT-based synchronization, vector search, namespace isolation, and multiple storage backends.
Key Features
- Dual Storage Backends: SQLite for performance, Markdown for human-readability and git integration
- Advanced Caching: Multiple eviction strategies with TTL support and performance metrics
- Vector Search: Semantic similarity search with embeddings and indexing
- CRDT Conflict Resolution: Automatic conflict resolution for concurrent updates
- Namespace Isolation: Multi-tenant support with permissions and access control
- Replication: Distributed synchronization across multiple instances
- Import/Export: Multiple formats with compression and encryption
- Full-Text Search: Integrated FTS5 search for SQLite backend
Quick Start
import { MemoryManager } from '@sparc/memory-bank';
// Initialize with SQLite backend
const memory = new MemoryManager({
backend: 'sqlite',
storage: { path: './memory.db' },
cache: { enabled: true, maxSize: 100 * 1024 * 1024 }, // 100MB
indexing: { vectorSearch: true }
});
// Store a memory item
const item = await memory.store({
id: 'task-001',
category: 'implementation',
content: 'Implemented user authentication system',
tags: ['auth', 'security', 'backend'],
metadata: {
assignee: 'alice',
priority: 'high',
completion: 0.8
}
});
// Query memories
const results = await memory.query({
category: 'implementation',
tags: ['auth'],
fullText: 'authentication',
limit: 10
});
Documentation Structure
- Architecture Overview - System design and component interactions
- API Reference - Complete API documentation
- Usage Guide - Practical examples and best practices
- Backends - Storage backend configuration and capabilities
- Configuration - Complete configuration reference
- Performance - Optimization and monitoring
- Security - Security features and best practices
- Deployment - Production deployment guide
- Troubleshooting - Common issues and solutions
Installation
# Using npm
npm install @sparc/memory-bank
# Using deno
import { MemoryManager } from 'https://deno.land/x/sparc_memory@latest/mod.ts';
Core Concepts
Memory Items
Memory items are the fundamental unit of storage in the SPARC Memory Bank:
interface MemoryItem {
id: string; // Unique identifier
category: string; // Logical grouping
content: string; // Main content
tags: string[]; // Searchable tags
namespace?: string; // Isolation boundary
metadata?: Record<string, unknown>; // Additional data
embedding?: number[]; // Vector representation
version: number; // CRDT version
vectorClock: Record<string, number>; // Conflict resolution
created: Date; // Creation timestamp
updated: Date; // Last modification
checksum: string; // Integrity verification
}
Backends
SQLite Backend: Optimized for performance with FTS5 search, WAL mode, and proper indexing.
Markdown Backend: Human-readable storage with git integration for version control and collaboration.
Caching
Intelligent caching layer with multiple eviction strategies:
- LRU: Least Recently Used (default)
- LFU: Least Frequently Used
- FIFO: First In, First Out
- TTL: Time To Live based expiration
Vector Search
Semantic similarity search using vector embeddings:
- Automatic embedding generation
- Cosine similarity matching
- Configurable similarity thresholds
- Integration with external embedding services
System Requirements
- Runtime: Node.js 18+ or Deno 1.30+
- Storage: SQLite 3.38+ (for SQLite backend)
- Memory: Minimum 512MB RAM (varies with cache size)
- Disk: Variable (depends on data volume and caching)
License
MIT License - see LICENSE for details.
Contributing
See CONTRIBUTING.md for development setup and guidelines.
Support
- Documentation: GitHub Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions