mcp-sqlite-memory-bank 1.3.0__tar.gz → 1.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mcp_sqlite_memory_bank-1.3.0/src/mcp_sqlite_memory_bank.egg-info → mcp_sqlite_memory_bank-1.4.1}/PKG-INFO +168 -4
- {mcp_sqlite_memory_bank-1.3.0 → mcp_sqlite_memory_bank-1.4.1}/README.md +163 -3
- {mcp_sqlite_memory_bank-1.3.0 → mcp_sqlite_memory_bank-1.4.1}/pyproject.toml +6 -2
- {mcp_sqlite_memory_bank-1.3.0 → mcp_sqlite_memory_bank-1.4.1}/src/mcp_sqlite_memory_bank/database.py +247 -160
- mcp_sqlite_memory_bank-1.4.1/src/mcp_sqlite_memory_bank/prompts.py +252 -0
- mcp_sqlite_memory_bank-1.4.1/src/mcp_sqlite_memory_bank/resources.py +164 -0
- {mcp_sqlite_memory_bank-1.3.0 → mcp_sqlite_memory_bank-1.4.1}/src/mcp_sqlite_memory_bank/semantic.py +107 -95
- {mcp_sqlite_memory_bank-1.3.0 → mcp_sqlite_memory_bank-1.4.1}/src/mcp_sqlite_memory_bank/server.py +183 -33
- {mcp_sqlite_memory_bank-1.3.0 → mcp_sqlite_memory_bank-1.4.1}/src/mcp_sqlite_memory_bank/types.py +6 -0
- {mcp_sqlite_memory_bank-1.3.0 → mcp_sqlite_memory_bank-1.4.1}/src/mcp_sqlite_memory_bank/utils.py +5 -2
- {mcp_sqlite_memory_bank-1.3.0 → mcp_sqlite_memory_bank-1.4.1/src/mcp_sqlite_memory_bank.egg-info}/PKG-INFO +168 -4
- {mcp_sqlite_memory_bank-1.3.0 → mcp_sqlite_memory_bank-1.4.1}/src/mcp_sqlite_memory_bank.egg-info/SOURCES.txt +2 -0
- mcp_sqlite_memory_bank-1.4.1/src/mcp_sqlite_memory_bank.egg-info/requires.txt +11 -0
- mcp_sqlite_memory_bank-1.3.0/src/mcp_sqlite_memory_bank.egg-info/requires.txt +0 -7
- {mcp_sqlite_memory_bank-1.3.0 → mcp_sqlite_memory_bank-1.4.1}/LICENSE +0 -0
- {mcp_sqlite_memory_bank-1.3.0 → mcp_sqlite_memory_bank-1.4.1}/MANIFEST.in +0 -0
- {mcp_sqlite_memory_bank-1.3.0 → mcp_sqlite_memory_bank-1.4.1}/setup.cfg +0 -0
- {mcp_sqlite_memory_bank-1.3.0 → mcp_sqlite_memory_bank-1.4.1}/src/mcp_sqlite_memory_bank/__init__.py +0 -0
- {mcp_sqlite_memory_bank-1.3.0 → mcp_sqlite_memory_bank-1.4.1}/src/mcp_sqlite_memory_bank/py.typed +0 -0
- {mcp_sqlite_memory_bank-1.3.0 → mcp_sqlite_memory_bank-1.4.1}/src/mcp_sqlite_memory_bank.egg-info/dependency_links.txt +0 -0
- {mcp_sqlite_memory_bank-1.3.0 → mcp_sqlite_memory_bank-1.4.1}/src/mcp_sqlite_memory_bank.egg-info/entry_points.txt +0 -0
- {mcp_sqlite_memory_bank-1.3.0 → mcp_sqlite_memory_bank-1.4.1}/src/mcp_sqlite_memory_bank.egg-info/top_level.txt +0 -0
- {mcp_sqlite_memory_bank-1.3.0 → mcp_sqlite_memory_bank-1.4.1}/tests/test_api.py +0 -0
- {mcp_sqlite_memory_bank-1.3.0 → mcp_sqlite_memory_bank-1.4.1}/tests/test_server.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: mcp_sqlite_memory_bank
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.4.1
|
4
4
|
Summary: A dynamic, agent/LLM-friendly SQLite memory bank for MCP servers with semantic search capabilities.
|
5
5
|
Author-email: Robert Meisner <robert@catchit.pl>
|
6
6
|
License-Expression: MIT
|
@@ -16,6 +16,10 @@ Requires-Dist: fastapi>=0.100.0
|
|
16
16
|
Requires-Dist: uvicorn>=0.22.0
|
17
17
|
Requires-Dist: pydantic>=1.10.0
|
18
18
|
Requires-Dist: fastmcp
|
19
|
+
Requires-Dist: sqlalchemy>=2.0.0
|
20
|
+
Requires-Dist: sentence-transformers>=2.2.0
|
21
|
+
Requires-Dist: torch>=1.9.0
|
22
|
+
Requires-Dist: numpy>=1.21.0
|
19
23
|
Provides-Extra: test
|
20
24
|
Requires-Dist: pytest; extra == "test"
|
21
25
|
Dynamic: license-file
|
@@ -36,10 +40,14 @@ This project provides a robust, discoverable API for creating, exploring, and ma
|
|
36
40
|
- Build and query knowledge graphs for semantic search and reasoning
|
37
41
|
- Store, retrieve, and organize notes or structured data for LLM agents
|
38
42
|
- Enable natural language workflows for database management and exploration
|
43
|
+
- Intelligent content discovery with semantic search capabilities
|
44
|
+
- Access memory content through standardized MCP Resources and Prompts
|
39
45
|
- Integrate with FastMCP, Claude Desktop, and other agent platforms for seamless tool discovery
|
40
46
|
|
41
47
|
**Why mcp_sqlite_memory_bank?**
|
42
|
-
-
|
48
|
+
- **Full MCP Compliance:** Resources, Prompts, and 20+ organized tools
|
49
|
+
- **Semantic Search:** Natural language content discovery with AI-powered similarity matching
|
50
|
+
- **Explicit, discoverable APIs** for LLMs and agents with enhanced categorization
|
43
51
|
- Safe, parameterized queries and schema management
|
44
52
|
- Designed for extensibility and open source collaboration
|
45
53
|
|
@@ -104,18 +112,59 @@ Restart your IDE and try asking your AI assistant:
|
|
104
112
|
- **Dynamic Table Management:** Create, list, describe, rename, and drop tables at runtime
|
105
113
|
- **CRUD Operations:** Insert, read, update, and delete rows in any table
|
106
114
|
- **Safe SQL:** Run parameterized SELECT queries with input validation
|
115
|
+
- **Semantic Search:** Natural language search using sentence-transformers for intelligent content discovery
|
116
|
+
- **MCP Resources:** Access memory content through standardized MCP resource URIs
|
117
|
+
- **MCP Prompts:** Built-in intelligent prompts for common memory analysis workflows
|
118
|
+
- **Tool Categorization:** Organized tool discovery with detailed usage examples for enhanced LLM integration
|
107
119
|
- **Knowledge Graph Tools:** Built-in support for node/edge schemas and property graphs
|
108
120
|
- **Agent/LLM Integration:** Explicit, tool-based APIs for easy discovery and automation
|
109
121
|
- **Open Source:** MIT licensed, fully tested, and ready for community use
|
110
122
|
|
111
123
|
---
|
112
124
|
|
125
|
+
## MCP Compliance & Enhanced Integration
|
126
|
+
|
127
|
+
SQLite Memory Bank v1.4.0+ provides full Model Context Protocol (MCP) compliance with advanced features for enhanced LLM and agent integration:
|
128
|
+
|
129
|
+
### 🔧 MCP Tools (20 Available)
|
130
|
+
Organized into logical categories for easy discovery:
|
131
|
+
- **Schema Management** (6 tools): Table creation, modification, and inspection
|
132
|
+
- **Data Operations** (5 tools): CRUD operations with validation
|
133
|
+
- **Search & Discovery** (2 tools): Content search and exploration
|
134
|
+
- **Semantic Search** (5 tools): AI-powered natural language content discovery
|
135
|
+
- **Analytics** (2 tools): Memory bank insights and statistics
|
136
|
+
|
137
|
+
### 📄 MCP Resources (5 Available)
|
138
|
+
Real-time access to memory content via standardized URIs:
|
139
|
+
- `memory://tables/list` - List of all available tables
|
140
|
+
- `memory://tables/{table_name}/schema` - Table schema information
|
141
|
+
- `memory://tables/{table_name}/data` - Table data content
|
142
|
+
- `memory://search/{query}` - Search results as resources
|
143
|
+
- `memory://analytics/overview` - Memory bank overview analytics
|
144
|
+
|
145
|
+
### 💡 MCP Prompts (4 Available)
|
146
|
+
Intelligent prompts for common memory analysis workflows:
|
147
|
+
- `analyze-memory-content` - Analyze memory bank content and provide insights
|
148
|
+
- `search-and-summarize` - Search and create summary prompts
|
149
|
+
- `technical-decision-analysis` - Analyze technical decisions from memory
|
150
|
+
- `memory-bank-context` - Provide memory bank context for AI conversations
|
151
|
+
|
152
|
+
### 🎯 Enhanced Discoverability
|
153
|
+
- **Tool Categorization:** `list_tool_categories()` for organized tool discovery
|
154
|
+
- **Usage Examples:** `get_tools_by_category()` with detailed examples for each tool
|
155
|
+
- **Semantic Search:** Natural language queries for intelligent content discovery
|
156
|
+
- **LLM-Friendly APIs:** Explicit, descriptive tool names and comprehensive documentation
|
157
|
+
|
158
|
+
---
|
159
|
+
|
113
160
|
|
114
161
|
## Tools & API Reference
|
115
162
|
|
116
163
|
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.
|
117
164
|
|
118
|
-
|
165
|
+
**🔍 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.
|
166
|
+
|
167
|
+
### Schema Management Tools (6 tools)
|
119
168
|
|
120
169
|
| Tool | Description | Required Parameters | Optional Parameters |
|
121
170
|
|------|-------------|---------------------|---------------------|
|
@@ -126,7 +175,7 @@ All tools are designed for explicit, discoverable use by LLMs, agents, and devel
|
|
126
175
|
| `describe_table` | Get schema details | `table_name` (str) | None |
|
127
176
|
| `list_all_columns` | List all columns for all tables | None | None |
|
128
177
|
|
129
|
-
### Data
|
178
|
+
### Data Operations Tools (5 tools)
|
130
179
|
|
131
180
|
| Tool | Description | Required Parameters | Optional Parameters |
|
132
181
|
|------|-------------|---------------------|---------------------|
|
@@ -136,6 +185,30 @@ All tools are designed for explicit, discoverable use by LLMs, agents, and devel
|
|
136
185
|
| `delete_rows` | Delete rows from table | `table_name` (str), `where` (dict) | None |
|
137
186
|
| `run_select_query` | Run safe SELECT query | `table_name` (str) | `columns` (list[str]), `where` (dict), `limit` (int) |
|
138
187
|
|
188
|
+
### Search & Discovery Tools (2 tools)
|
189
|
+
|
190
|
+
| Tool | Description | Required Parameters | Optional Parameters |
|
191
|
+
|------|-------------|---------------------|---------------------|
|
192
|
+
| `search_content` | Full-text search across table content | `query` (str) | `tables` (list[str]), `limit` (int) |
|
193
|
+
| `explore_tables` | Explore and discover table structures | None | `pattern` (str), `include_row_counts` (bool) |
|
194
|
+
|
195
|
+
### Semantic Search Tools (5 tools)
|
196
|
+
|
197
|
+
| Tool | Description | Required Parameters | Optional Parameters |
|
198
|
+
|------|-------------|---------------------|---------------------|
|
199
|
+
| `add_embeddings` | Generate vector embeddings for semantic search | `table_name` (str), `text_columns` (list[str]) | `embedding_column` (str), `model_name` (str) |
|
200
|
+
| `semantic_search` | Natural language search using vector similarity | `query` (str) | `tables` (list[str]), `similarity_threshold` (float), `limit` (int) |
|
201
|
+
| `find_related` | Find content related to specific row by similarity | `table_name` (str), `row_id` (int) | `similarity_threshold` (float), `limit` (int) |
|
202
|
+
| `smart_search` | Hybrid keyword + semantic search | `query` (str) | `tables` (list[str]), `semantic_weight` (float), `text_weight` (float) |
|
203
|
+
| `embedding_stats` | Get statistics about semantic search readiness | `table_name` (str) | `embedding_column` (str) |
|
204
|
+
|
205
|
+
### Tool Discovery & Organization (2 tools)
|
206
|
+
|
207
|
+
| Tool | Description | Required Parameters | Optional Parameters |
|
208
|
+
|------|-------------|---------------------|---------------------|
|
209
|
+
| `list_tool_categories` | List all available tool categories | None | None |
|
210
|
+
| `get_tools_by_category` | Get detailed tool information by category | `category` (str) | None |
|
211
|
+
|
139
212
|
Each tool validates inputs and returns consistent response formats with success/error indicators and appropriate data payloads.
|
140
213
|
|
141
214
|
---
|
@@ -464,6 +537,97 @@ For a complete agent memory implementation example, see [examples/agent_memory_e
|
|
464
537
|
|
465
538
|
---
|
466
539
|
|
540
|
+
## MCP Resources and Prompts Usage
|
541
|
+
|
542
|
+
### Using MCP Resources
|
543
|
+
|
544
|
+
MCP Resources provide real-time access to memory content through standardized URIs:
|
545
|
+
|
546
|
+
```python
|
547
|
+
# Access resource via MCP client
|
548
|
+
resource_uri = "memory://tables/list"
|
549
|
+
tables_resource = await client.read_resource(resource_uri)
|
550
|
+
|
551
|
+
# Get table schema
|
552
|
+
schema_uri = "memory://tables/user_preferences/schema"
|
553
|
+
schema_resource = await client.read_resource(schema_uri)
|
554
|
+
|
555
|
+
# Access table data
|
556
|
+
data_uri = "memory://tables/user_preferences/data"
|
557
|
+
data_resource = await client.read_resource(data_uri)
|
558
|
+
|
559
|
+
# Search as resource
|
560
|
+
search_uri = "memory://search/user preferences coding style"
|
561
|
+
search_resource = await client.read_resource(search_uri)
|
562
|
+
|
563
|
+
# Analytics overview
|
564
|
+
analytics_uri = "memory://analytics/overview"
|
565
|
+
analytics_resource = await client.read_resource(analytics_uri)
|
566
|
+
```
|
567
|
+
|
568
|
+
### Using MCP Prompts
|
569
|
+
|
570
|
+
MCP Prompts provide intelligent analysis workflows:
|
571
|
+
|
572
|
+
```python
|
573
|
+
# Analyze memory content
|
574
|
+
analysis_prompt = await client.get_prompt("analyze-memory-content", {
|
575
|
+
"focus_area": "technical_decisions"
|
576
|
+
})
|
577
|
+
|
578
|
+
# Search and summarize
|
579
|
+
summary_prompt = await client.get_prompt("search-and-summarize", {
|
580
|
+
"query": "database performance optimization",
|
581
|
+
"max_results": 10
|
582
|
+
})
|
583
|
+
|
584
|
+
# Technical decision analysis
|
585
|
+
decision_analysis = await client.get_prompt("technical-decision-analysis", {
|
586
|
+
"decision_category": "architecture"
|
587
|
+
})
|
588
|
+
|
589
|
+
# Get memory context for conversations
|
590
|
+
context_prompt = await client.get_prompt("memory-bank-context", {
|
591
|
+
"conversation_topic": "API design patterns"
|
592
|
+
})
|
593
|
+
```
|
594
|
+
|
595
|
+
### Semantic Search Examples
|
596
|
+
|
597
|
+
```python
|
598
|
+
# Enable semantic search on existing table
|
599
|
+
add_embeddings("technical_decisions", ["decision_name", "rationale"])
|
600
|
+
|
601
|
+
# Natural language search
|
602
|
+
results = semantic_search("machine learning algorithms",
|
603
|
+
similarity_threshold=0.4,
|
604
|
+
limit=5)
|
605
|
+
|
606
|
+
# Find related content
|
607
|
+
related = find_related("technical_decisions",
|
608
|
+
row_id=123,
|
609
|
+
similarity_threshold=0.5)
|
610
|
+
|
611
|
+
# Hybrid search (keyword + semantic)
|
612
|
+
hybrid_results = smart_search("API design patterns",
|
613
|
+
semantic_weight=0.7,
|
614
|
+
text_weight=0.3)
|
615
|
+
```
|
616
|
+
|
617
|
+
### Tool Organization Discovery
|
618
|
+
|
619
|
+
```python
|
620
|
+
# Discover tool categories
|
621
|
+
categories = list_tool_categories()
|
622
|
+
# Returns: {"schema_management": 6, "data_operations": 5, ...}
|
623
|
+
|
624
|
+
# Get detailed tool information
|
625
|
+
schema_tools = get_tools_by_category("schema_management")
|
626
|
+
# Returns detailed info with usage examples for each tool
|
627
|
+
```
|
628
|
+
|
629
|
+
---
|
630
|
+
|
467
631
|
## Troubleshooting
|
468
632
|
|
469
633
|
### Common MCP Connection Issues
|
@@ -14,10 +14,14 @@ This project provides a robust, discoverable API for creating, exploring, and ma
|
|
14
14
|
- Build and query knowledge graphs for semantic search and reasoning
|
15
15
|
- Store, retrieve, and organize notes or structured data for LLM agents
|
16
16
|
- Enable natural language workflows for database management and exploration
|
17
|
+
- Intelligent content discovery with semantic search capabilities
|
18
|
+
- Access memory content through standardized MCP Resources and Prompts
|
17
19
|
- Integrate with FastMCP, Claude Desktop, and other agent platforms for seamless tool discovery
|
18
20
|
|
19
21
|
**Why mcp_sqlite_memory_bank?**
|
20
|
-
-
|
22
|
+
- **Full MCP Compliance:** Resources, Prompts, and 20+ organized tools
|
23
|
+
- **Semantic Search:** Natural language content discovery with AI-powered similarity matching
|
24
|
+
- **Explicit, discoverable APIs** for LLMs and agents with enhanced categorization
|
21
25
|
- Safe, parameterized queries and schema management
|
22
26
|
- Designed for extensibility and open source collaboration
|
23
27
|
|
@@ -82,18 +86,59 @@ Restart your IDE and try asking your AI assistant:
|
|
82
86
|
- **Dynamic Table Management:** Create, list, describe, rename, and drop tables at runtime
|
83
87
|
- **CRUD Operations:** Insert, read, update, and delete rows in any table
|
84
88
|
- **Safe SQL:** Run parameterized SELECT queries with input validation
|
89
|
+
- **Semantic Search:** Natural language search using sentence-transformers for intelligent content discovery
|
90
|
+
- **MCP Resources:** Access memory content through standardized MCP resource URIs
|
91
|
+
- **MCP Prompts:** Built-in intelligent prompts for common memory analysis workflows
|
92
|
+
- **Tool Categorization:** Organized tool discovery with detailed usage examples for enhanced LLM integration
|
85
93
|
- **Knowledge Graph Tools:** Built-in support for node/edge schemas and property graphs
|
86
94
|
- **Agent/LLM Integration:** Explicit, tool-based APIs for easy discovery and automation
|
87
95
|
- **Open Source:** MIT licensed, fully tested, and ready for community use
|
88
96
|
|
89
97
|
---
|
90
98
|
|
99
|
+
## MCP Compliance & Enhanced Integration
|
100
|
+
|
101
|
+
SQLite Memory Bank v1.4.0+ provides full Model Context Protocol (MCP) compliance with advanced features for enhanced LLM and agent integration:
|
102
|
+
|
103
|
+
### 🔧 MCP Tools (20 Available)
|
104
|
+
Organized into logical categories for easy discovery:
|
105
|
+
- **Schema Management** (6 tools): Table creation, modification, and inspection
|
106
|
+
- **Data Operations** (5 tools): CRUD operations with validation
|
107
|
+
- **Search & Discovery** (2 tools): Content search and exploration
|
108
|
+
- **Semantic Search** (5 tools): AI-powered natural language content discovery
|
109
|
+
- **Analytics** (2 tools): Memory bank insights and statistics
|
110
|
+
|
111
|
+
### 📄 MCP Resources (5 Available)
|
112
|
+
Real-time access to memory content via standardized URIs:
|
113
|
+
- `memory://tables/list` - List of all available tables
|
114
|
+
- `memory://tables/{table_name}/schema` - Table schema information
|
115
|
+
- `memory://tables/{table_name}/data` - Table data content
|
116
|
+
- `memory://search/{query}` - Search results as resources
|
117
|
+
- `memory://analytics/overview` - Memory bank overview analytics
|
118
|
+
|
119
|
+
### 💡 MCP Prompts (4 Available)
|
120
|
+
Intelligent prompts for common memory analysis workflows:
|
121
|
+
- `analyze-memory-content` - Analyze memory bank content and provide insights
|
122
|
+
- `search-and-summarize` - Search and create summary prompts
|
123
|
+
- `technical-decision-analysis` - Analyze technical decisions from memory
|
124
|
+
- `memory-bank-context` - Provide memory bank context for AI conversations
|
125
|
+
|
126
|
+
### 🎯 Enhanced Discoverability
|
127
|
+
- **Tool Categorization:** `list_tool_categories()` for organized tool discovery
|
128
|
+
- **Usage Examples:** `get_tools_by_category()` with detailed examples for each tool
|
129
|
+
- **Semantic Search:** Natural language queries for intelligent content discovery
|
130
|
+
- **LLM-Friendly APIs:** Explicit, descriptive tool names and comprehensive documentation
|
131
|
+
|
132
|
+
---
|
133
|
+
|
91
134
|
|
92
135
|
## Tools & API Reference
|
93
136
|
|
94
137
|
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.
|
95
138
|
|
96
|
-
|
139
|
+
**🔍 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.
|
140
|
+
|
141
|
+
### Schema Management Tools (6 tools)
|
97
142
|
|
98
143
|
| Tool | Description | Required Parameters | Optional Parameters |
|
99
144
|
|------|-------------|---------------------|---------------------|
|
@@ -104,7 +149,7 @@ All tools are designed for explicit, discoverable use by LLMs, agents, and devel
|
|
104
149
|
| `describe_table` | Get schema details | `table_name` (str) | None |
|
105
150
|
| `list_all_columns` | List all columns for all tables | None | None |
|
106
151
|
|
107
|
-
### Data
|
152
|
+
### Data Operations Tools (5 tools)
|
108
153
|
|
109
154
|
| Tool | Description | Required Parameters | Optional Parameters |
|
110
155
|
|------|-------------|---------------------|---------------------|
|
@@ -114,6 +159,30 @@ All tools are designed for explicit, discoverable use by LLMs, agents, and devel
|
|
114
159
|
| `delete_rows` | Delete rows from table | `table_name` (str), `where` (dict) | None |
|
115
160
|
| `run_select_query` | Run safe SELECT query | `table_name` (str) | `columns` (list[str]), `where` (dict), `limit` (int) |
|
116
161
|
|
162
|
+
### Search & Discovery Tools (2 tools)
|
163
|
+
|
164
|
+
| Tool | Description | Required Parameters | Optional Parameters |
|
165
|
+
|------|-------------|---------------------|---------------------|
|
166
|
+
| `search_content` | Full-text search across table content | `query` (str) | `tables` (list[str]), `limit` (int) |
|
167
|
+
| `explore_tables` | Explore and discover table structures | None | `pattern` (str), `include_row_counts` (bool) |
|
168
|
+
|
169
|
+
### Semantic Search Tools (5 tools)
|
170
|
+
|
171
|
+
| Tool | Description | Required Parameters | Optional Parameters |
|
172
|
+
|------|-------------|---------------------|---------------------|
|
173
|
+
| `add_embeddings` | Generate vector embeddings for semantic search | `table_name` (str), `text_columns` (list[str]) | `embedding_column` (str), `model_name` (str) |
|
174
|
+
| `semantic_search` | Natural language search using vector similarity | `query` (str) | `tables` (list[str]), `similarity_threshold` (float), `limit` (int) |
|
175
|
+
| `find_related` | Find content related to specific row by similarity | `table_name` (str), `row_id` (int) | `similarity_threshold` (float), `limit` (int) |
|
176
|
+
| `smart_search` | Hybrid keyword + semantic search | `query` (str) | `tables` (list[str]), `semantic_weight` (float), `text_weight` (float) |
|
177
|
+
| `embedding_stats` | Get statistics about semantic search readiness | `table_name` (str) | `embedding_column` (str) |
|
178
|
+
|
179
|
+
### Tool Discovery & Organization (2 tools)
|
180
|
+
|
181
|
+
| Tool | Description | Required Parameters | Optional Parameters |
|
182
|
+
|------|-------------|---------------------|---------------------|
|
183
|
+
| `list_tool_categories` | List all available tool categories | None | None |
|
184
|
+
| `get_tools_by_category` | Get detailed tool information by category | `category` (str) | None |
|
185
|
+
|
117
186
|
Each tool validates inputs and returns consistent response formats with success/error indicators and appropriate data payloads.
|
118
187
|
|
119
188
|
---
|
@@ -442,6 +511,97 @@ For a complete agent memory implementation example, see [examples/agent_memory_e
|
|
442
511
|
|
443
512
|
---
|
444
513
|
|
514
|
+
## MCP Resources and Prompts Usage
|
515
|
+
|
516
|
+
### Using MCP Resources
|
517
|
+
|
518
|
+
MCP Resources provide real-time access to memory content through standardized URIs:
|
519
|
+
|
520
|
+
```python
|
521
|
+
# Access resource via MCP client
|
522
|
+
resource_uri = "memory://tables/list"
|
523
|
+
tables_resource = await client.read_resource(resource_uri)
|
524
|
+
|
525
|
+
# Get table schema
|
526
|
+
schema_uri = "memory://tables/user_preferences/schema"
|
527
|
+
schema_resource = await client.read_resource(schema_uri)
|
528
|
+
|
529
|
+
# Access table data
|
530
|
+
data_uri = "memory://tables/user_preferences/data"
|
531
|
+
data_resource = await client.read_resource(data_uri)
|
532
|
+
|
533
|
+
# Search as resource
|
534
|
+
search_uri = "memory://search/user preferences coding style"
|
535
|
+
search_resource = await client.read_resource(search_uri)
|
536
|
+
|
537
|
+
# Analytics overview
|
538
|
+
analytics_uri = "memory://analytics/overview"
|
539
|
+
analytics_resource = await client.read_resource(analytics_uri)
|
540
|
+
```
|
541
|
+
|
542
|
+
### Using MCP Prompts
|
543
|
+
|
544
|
+
MCP Prompts provide intelligent analysis workflows:
|
545
|
+
|
546
|
+
```python
|
547
|
+
# Analyze memory content
|
548
|
+
analysis_prompt = await client.get_prompt("analyze-memory-content", {
|
549
|
+
"focus_area": "technical_decisions"
|
550
|
+
})
|
551
|
+
|
552
|
+
# Search and summarize
|
553
|
+
summary_prompt = await client.get_prompt("search-and-summarize", {
|
554
|
+
"query": "database performance optimization",
|
555
|
+
"max_results": 10
|
556
|
+
})
|
557
|
+
|
558
|
+
# Technical decision analysis
|
559
|
+
decision_analysis = await client.get_prompt("technical-decision-analysis", {
|
560
|
+
"decision_category": "architecture"
|
561
|
+
})
|
562
|
+
|
563
|
+
# Get memory context for conversations
|
564
|
+
context_prompt = await client.get_prompt("memory-bank-context", {
|
565
|
+
"conversation_topic": "API design patterns"
|
566
|
+
})
|
567
|
+
```
|
568
|
+
|
569
|
+
### Semantic Search Examples
|
570
|
+
|
571
|
+
```python
|
572
|
+
# Enable semantic search on existing table
|
573
|
+
add_embeddings("technical_decisions", ["decision_name", "rationale"])
|
574
|
+
|
575
|
+
# Natural language search
|
576
|
+
results = semantic_search("machine learning algorithms",
|
577
|
+
similarity_threshold=0.4,
|
578
|
+
limit=5)
|
579
|
+
|
580
|
+
# Find related content
|
581
|
+
related = find_related("technical_decisions",
|
582
|
+
row_id=123,
|
583
|
+
similarity_threshold=0.5)
|
584
|
+
|
585
|
+
# Hybrid search (keyword + semantic)
|
586
|
+
hybrid_results = smart_search("API design patterns",
|
587
|
+
semantic_weight=0.7,
|
588
|
+
text_weight=0.3)
|
589
|
+
```
|
590
|
+
|
591
|
+
### Tool Organization Discovery
|
592
|
+
|
593
|
+
```python
|
594
|
+
# Discover tool categories
|
595
|
+
categories = list_tool_categories()
|
596
|
+
# Returns: {"schema_management": 6, "data_operations": 5, ...}
|
597
|
+
|
598
|
+
# Get detailed tool information
|
599
|
+
schema_tools = get_tools_by_category("schema_management")
|
600
|
+
# Returns detailed info with usage examples for each tool
|
601
|
+
```
|
602
|
+
|
603
|
+
---
|
604
|
+
|
445
605
|
## Troubleshooting
|
446
606
|
|
447
607
|
### Common MCP Connection Issues
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "mcp_sqlite_memory_bank"
|
7
|
-
version = "1.
|
7
|
+
version = "1.4.1"
|
8
8
|
description = "A dynamic, agent/LLM-friendly SQLite memory bank for MCP servers with semantic search capabilities."
|
9
9
|
authors = [
|
10
10
|
{ name="Robert Meisner", email="robert@catchit.pl" }
|
@@ -21,7 +21,11 @@ dependencies = [
|
|
21
21
|
"fastapi>=0.100.0",
|
22
22
|
"uvicorn>=0.22.0",
|
23
23
|
"pydantic>=1.10.0",
|
24
|
-
"fastmcp"
|
24
|
+
"fastmcp",
|
25
|
+
"sqlalchemy>=2.0.0",
|
26
|
+
"sentence-transformers>=2.2.0",
|
27
|
+
"torch>=1.9.0",
|
28
|
+
"numpy>=1.21.0"
|
25
29
|
]
|
26
30
|
|
27
31
|
[project.scripts]
|