# Mcp Sqlite Memory Bank

> a dynamic, agent- and LLM-friendly SQLite memory bank designed for Model Context Protocol (MCP) servers and modern AI agent platforms.

- **Type:** MCP server
- **Install:** `agentstack add mcp-robertmeisner-mcp-sqlite-memory-bank`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [robertmeisner](https://agentstack.voostack.com/s/robertmeisner)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [robertmeisner](https://github.com/robertmeisner)
- **Source:** https://github.com/robertmeisner/mcp_sqlite_memory_bank

## Install

```sh
agentstack add mcp-robertmeisner-mcp-sqlite-memory-bank
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# mcp_sqlite_memory_bank

## Overview

**mcp_sqlite_memory_bank** is a dynamic, agent- and LLM-friendly SQLite memory bank designed for Model Context Protocol (MCP) servers and modern AI agent platforms.

This project provides a robust, discoverable API for creating, exploring, and managing SQLite tables and knowledge graphs. It enables Claude, Anthropic, Github Copilot, Claude Desktop, VS Code, Cursor, and other LLM-powered tools to interact with structured data in a safe, explicit, and extensible way.

**Key Use Cases:**
- Build and query knowledge graphs for semantic search and reasoning
- Store, retrieve, and organize notes or structured data for LLM agents
- Enable natural language workflows for database management and exploration
- Intelligent content discovery with semantic search capabilities
- Access memory content through standardized MCP Resources and Prompts
- Integrate with FastMCP, Claude Desktop, and other agent platforms for seamless tool discovery

**Why mcp_sqlite_memory_bank?**
- **Full MCP Compliance:** Resources, Prompts, and 40+ organized tools
- **Semantic Search:** Natural language content discovery with AI-powered similarity matching
- **Explicit, discoverable APIs** for LLMs and agents with enhanced categorization
- Safe, parameterized queries and schema management
- Designed for extensibility and open source collaboration

---

## Quick Start

Get started with SQLite Memory Bank in your IDE in under 2 minutes:

### 1. Install and Run
```bash
# Install uvx if you don't have it
pip install uvx

# Run SQLite Memory Bank
uvx mcp-sqlite-memory-bank
```

### 2. Configure Your IDE

**VS Code / Cursor:** Add to `.vscode/mcp.json`:
```jsonc
{
  "servers": {
    "SQLite_Memory": {
      "type": "stdio",
      "command": "uvx",
      "args": ["--refresh", "mcp-sqlite-memory-bank"],
      "env": {
        "DB_PATH": "${workspaceFolder}/.vscode/project_memory.sqlite"
      }
    }
  }
}
```

**Claude Desktop:** Add to `claude_desktop_config.json`:
```jsonc
{
  "mcpServers": {
    "sqlite_memory": {
      "command": "uvx",
      "args": ["--refresh", "mcp-sqlite-memory-bank"],
      "env": {
        "DB_PATH": "/path/to/your/memory.db"
      }
    }
  }
}
```

### 3. Test It
Restart your IDE and try asking your AI assistant:
> "Create a table called 'notes' with columns 'id' (integer, primary key) and 'content' (text). Then add a note saying 'Hello SQLite Memory Bank!'"

✅ You should see the AI using the SQLite Memory Bank tools to create the table and add the note!

---

## Features

- **Dynamic Table Management:** Create, list, describe, rename, and drop tables at runtime
- **Advanced CRUD Operations:** Insert, read, update, delete with intelligent batch processing and change tracking
- **Safe SQL:** Run parameterized SELECT queries with comprehensive input validation
- **Semantic Search Engine:** Natural language search using sentence-transformers for intelligent content discovery
- **Zero-Setup Search:** Auto-embedding generation with `auto_semantic_search` and `auto_smart_search`
- **Batch Operations Suite:** Efficient bulk create, update, and delete operations with partial success handling
- **Advanced Optimization:** Duplicate detection, memory bank optimization, and intelligent archiving
- **LLM-Assisted Analysis:** AI-powered duplicate detection, optimization strategies, and archiving policies
- **Discovery & Intelligence:** AI-guided exploration, relationship discovery, and pre-built workflow templates
- **3D Visualization:** Stunning Three.js/WebGL knowledge graphs with real-time lighting and VR support
- **Interactive Dashboards:** Professional D3.js visualizations with enterprise-grade features
- **MCP Resources:** Access memory content through standardized MCP resource URIs
- **MCP Prompts:** Built-in intelligent prompts for common memory analysis workflows
- **Tool Categorization:** Organized tool discovery with detailed usage examples for enhanced LLM integration
- **Knowledge Graph Tools:** Built-in support for node/edge schemas and immersive 3D property graphs
- **Agent/LLM Integration:** Explicit, tool-based APIs for easy discovery and automation
- **Enterprise Scale:** Production-ready with comprehensive optimization and analytics capabilities
- **Open Source:** MIT licensed, fully tested, and ready for community use

---

## MCP Compliance & Enhanced Integration

SQLite Memory Bank v1.6.4+ provides full Model Context Protocol (MCP) compliance with advanced features for enhanced LLM and agent integration:

### 🔧 MCP Tools (40+ Available)
Organized into logical categories for easy discovery:
- **Schema Management** (6 tools): Table creation, modification, and inspection
- **Data Operations** (11 tools): CRUD operations with validation and advanced batch processing
- **Search & Discovery** (6 tools): Content search, exploration, and intelligent discovery
- **Semantic Search** (5 tools): AI-powered natural language content discovery
- **Optimization & Analytics** (8 tools): Memory bank optimization, duplicate detection, and insights
- **Visualization & Knowledge Graphs** (4 tools): Interactive visualizations and 3D knowledge graphs

### 📄 MCP Resources (5 Available)
Real-time access to memory content via standardized URIs:
- `memory://tables/list` - List of all available tables
- `memory://tables/{table_name}/schema` - Table schema information
- `memory://tables/{table_name}/data` - Table data content
- `memory://search/{query}` - Search results as resources
- `memory://analytics/overview` - Memory bank overview analytics

### 💡 MCP Prompts (4 Available)
Intelligent prompts for common memory analysis workflows:
- `analyze-memory-content` - Analyze memory bank content and provide insights
- `search-and-summarize` - Search and create summary prompts
- `technical-decision-analysis` - Analyze technical decisions from memory
- `memory-bank-context` - Provide memory bank context for AI conversations

### 🎯 Enhanced Discoverability
- **Tool Categorization:** `list_tool_categories()` for organized tool discovery
- **Usage Examples:** `get_tools_by_category()` with detailed examples for each tool
- **Semantic Search:** Natural language queries for intelligent content discovery
- **LLM-Friendly APIs:** Explicit, descriptive tool names and comprehensive documentation

---

## Tools & API Reference

All tools are designed for explicit, discoverable use by LLMs, agents, and developers. Each function is available as a direct Python import and as an MCP tool.

**🔍 Tool Discovery:** Use `list_tool_categories()` to see all organized tool categories, or `get_tools_by_category(category)` for detailed information about specific tool groups with usage examples.

### Schema Management Tools (6 tools)

| Tool | Description | Required Parameters | Optional Parameters |
|------|-------------|---------------------|---------------------|
| `create_table` | Create new table with custom schema | `table_name` (str), `columns` (list[dict]) | None |
| `drop_table` | Delete a table | `table_name` (str) | None |
| `rename_table` | Rename an existing table | `old_name` (str), `new_name` (str) | None |
| `list_tables` | List all tables | None | None |
| `describe_table` | Get schema details | `table_name` (str) | None |
| `list_all_columns` | List all columns for all tables | None | None |

### Data Operations Tools (11 tools)

| Tool | Description | Required Parameters | Optional Parameters |
|------|-------------|---------------------|---------------------|
| `create_row` | Insert row into table | `table_name` (str), `data` (dict) | None |
| `read_rows` | Read rows from table | `table_name` (str) | `where` (dict), `limit` (int) |
| `update_rows` | Update existing rows | `table_name` (str), `data` (dict), `where` (dict) | None |
| `delete_rows` | Delete rows from table | `table_name` (str), `where` (dict) | None |
| `run_select_query` | Run safe SELECT query | `table_name` (str) | `columns` (list[str]), `where` (dict), `limit` (int) |
| `upsert_memory` | Smart update or create memory record with change tracking | `table_name` (str), `data` (dict), `match_columns` (list[str]) | None |
| `batch_create_memories` | Efficiently create multiple memory records | `table_name` (str), `data_list` (list[dict]) | `match_columns` (list[str]), `use_upsert` (bool) |
| `batch_delete_memories` | Delete multiple memory records efficiently | `table_name` (str), `where_conditions` (list[dict]) | `match_all` (bool) |
| `find_duplicates` | Find duplicate and near-duplicate content | `table_name` (str), `content_columns` (list[str]) | `similarity_threshold` (float), `sample_size` (int) |
| `archive_old_memories` | Archive old memories to reduce active storage | `table_name` (str) | `archive_days` (int), `archive_table_suffix` (str), `delete_after_archive` (bool) |
| `optimize_memory_bank` | Comprehensive memory bank optimization | `table_name` (str) | `optimization_strategy` (str), `dry_run` (bool) |

### Search & Discovery Tools (6 tools)

| Tool | Description | Required Parameters | Optional Parameters |
|------|-------------|---------------------|---------------------|
| `search_content` | Full-text search across table content | `query` (str) | `tables` (list[str]), `limit` (int) |
| `explore_tables` | Explore and discover table structures | None | `pattern` (str), `include_row_counts` (bool) |
| `intelligent_discovery` | AI-guided exploration of memory bank | None | `discovery_goal` (str), `focus_area` (str), `depth` (str), `agent_id` (str) |
| `discovery_templates` | Pre-built exploration workflows | None | `template_type` (str), `customize_for` (str) |
| `discover_relationships` | Find hidden connections in data | None | `table_name` (str), `relationship_types` (list[str]), `similarity_threshold` (float) |
| `generate_knowledge_graph` | Create interactive HTML knowledge graphs | None | `output_path` (str), `include_temporal` (bool), `min_connections` (int), `open_in_browser` (bool) |

### Semantic Search Tools (5 tools)

| Tool | Description | Required Parameters | Optional Parameters |
|------|-------------|---------------------|---------------------|
| `add_embeddings` | Generate vector embeddings for semantic search | `table_name` (str), `text_columns` (list[str]) | `embedding_column` (str), `model_name` (str) |
| `semantic_search` | Natural language search using vector similarity | `query` (str) | `tables` (list[str]), `similarity_threshold` (float), `limit` (int) |
| `find_related` | Find content related to specific row by similarity | `table_name` (str), `row_id` (int) | `similarity_threshold` (float), `limit` (int) |
| `smart_search` | Hybrid keyword + semantic search | `query` (str) | `tables` (list[str]), `semantic_weight` (float), `text_weight` (float) |
| `embedding_stats` | Get statistics about semantic search readiness | `table_name` (str) | `embedding_column` (str) |

### Optimization & Analytics Tools (8 tools)

| Tool | Description | Required Parameters | Optional Parameters |
|------|-------------|---------------------|---------------------|
| `analyze_memory_patterns` | Comprehensive content distribution analysis | None | `focus_tables` (list[str]), `include_semantic` (bool) |
| `get_content_health_score` | Overall health scoring with recommendations | None | `tables` (list[str]), `detailed_analysis` (bool) |
| `intelligent_duplicate_analysis` | LLM-assisted semantic duplicate detection | `table_name` (str), `content_columns` (list[str]) | `analysis_depth` (str) |
| `intelligent_optimization_strategy` | AI-powered optimization planning | `table_name` (str) | `optimization_goals` (list[str]) |
| `smart_archiving_policy` | AI-powered retention strategy | `table_name` (str) | `business_context` (str), `retention_requirements` (dict) |
| `auto_semantic_search` | Zero-setup semantic search with auto-embeddings | `query` (str) | `tables` (list[str]), `similarity_threshold` (float), `limit` (int), `model_name` (str) |
| `auto_smart_search` | Zero-setup hybrid search with auto-embeddings | `query` (str) | `tables` (list[str]), `semantic_weight` (float), `text_weight` (float), `limit` (int), `model_name` (str) |
| `list_tool_categories` | List all available tool categories | None | None |

### Visualization & Knowledge Graphs Tools (4 tools)

| Tool | Description | Required Parameters | Optional Parameters |
|------|-------------|---------------------|---------------------|
| `create_3d_knowledge_graph` | Create stunning 3D knowledge graphs with Three.js | None | `output_path` (str), `table_name` (str), `include_semantic_links` (bool), `color_scheme` (str), `camera_position` (str), `animation_enabled` (bool), `export_formats` (list[str]) |
| `create_interactive_d3_graph` | Professional D3.js interactive knowledge graphs | None | `output_path` (str), `include_semantic_links` (bool), `filter_tables` (list[str]), `layout_algorithm` (str), `color_scheme` (str), `export_formats` (list[str]) |
| `create_advanced_d3_dashboard` | Enterprise D3.js dashboard with multiple visualizations | None | `output_path` (str), `dashboard_type` (str), `include_metrics` (bool), `real_time_updates` (bool), `custom_widgets` (list[str]) |
| `export_graph_data` | Export graph data in professional formats | None | `output_path` (str), `format` (str), `include_metadata` (bool), `compress_output` (bool) |

## [1.6.4] - 3D Visualization & Comprehensive Features (2025-06-29)

**Current Version**: The most advanced SQLite Memory Bank release with 40+ MCP tools, 3D visualization, LLM-assisted optimization, and enterprise-scale features.

### 🚀 Recent Major Features
- **3D Knowledge Graphs**: Immersive Three.js/WebGL visualizations with real-time lighting
- **Batch Operations**: Efficient bulk processing with smart duplicate prevention
- **LLM-Assisted Tools**: AI-powered optimization strategies and duplicate analysis
- **Advanced Discovery**: Intelligent exploration with relationship detection
- **Enhanced Upsert**: Detailed change tracking with old vs new value comparisons
- **Zero-Setup Search**: Automatic embedding generation for immediate semantic search
- **Enterprise Optimization**: Comprehensive memory bank optimization with archiving

For detailed changes, see [CHANGELOG.md](CHANGELOG.md).

## 🚀 Batch Operations & Advanced Memory Management

SQLite Memory Bank v1.6.4+ provides powerful batch operations and intelligent optimization for efficient memory management:

### Smart Memory Updates & Change Tracking
- **Enhanced `upsert_memory`**: Intelligent update-or-create with detailed change tracking
- **Field-Level Changes**: See exactly what changed with old vs new value comparisons
- **Duplicate Prevention**: Uses match columns to find existing records
- **Transparency**: Complete visibility into field modifications for debugging

### Efficient Batch Processing
- **`batch_create_memories`**: Create multiple records in a single operation
- **Smart vs Fast Modes**: Choose between upsert logic (prevents duplicates) or fast insertion
- **Partial Success Handling**: Continues processing even if some records fail
- **Detailed Feedback**: Returns counts for created, updated, and failed records

### Flexible Batch Deletion
- **`batch_delete_memories`**: Delete multiple records with complex conditions
- **Flexible Matching**: Support for OR logic (match_any) and AND logic (match_all)
- **Condition Lists**: Delete based on multiple different criteria
- **Safe Operations**: Validates conditions before deletion

### Advanced Optimization Suite
- **`find_duplicates`**: Detect exact and near-duplicate content with semantic analysis
- **`optimize_memory_bank`**: Comprehensive optimization with deduplication and archiving
- **`archive_old_memories`**: Intelligent archiving with configurable retention policies
- **Dry Run Support**: Analyze optimizations before applying changes

### LLM-Assisted Optimization
- **`intelligent_duplicate_analysis`**: AI-powered semantic duplicate detection
- **`intelligent_optimization_strategy`**: Customized o

…

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [robertmeisner](https://github.com/robertmeisner)
- **Source:** [robertmeisner/mcp_sqlite_memory_bank](https://github.com/robertmeisner/mcp_sqlite_memory_bank)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** yes
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-robertmeisner-mcp-sqlite-memory-bank
- Seller: https://agentstack.voostack.com/s/robertmeisner
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
