Skip to content

Commit 601b1be

Browse files
authored
Merge branch 'main' into changeset-release/main
2 parents 7574572 + 7526230 commit 601b1be

5 files changed

Lines changed: 80 additions & 17 deletions

File tree

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# mcp-memory-libsql
22

3+
## 0.0.8
4+
5+
### Patch Changes
6+
7+
- db5b2e8: tags
8+
9+
## 0.0.7
10+
11+
### Patch Changes
12+
13+
- readme again!
14+
15+
## 0.0.6
16+
17+
### Patch Changes
18+
19+
- readme update manual publish
20+
321
## 0.0.5
422

523
### Patch Changes

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# mcp-memory-libsql
22

3+
[![smithery badge](https://smithery.ai/badge/mcp-memory-libsql)](https://smithery.ai/server/mcp-memory-libsql)
4+
35
A high-performance, persistent memory system for the Model Context Protocol (MCP) powered by libSQL. This server provides vector search capabilities and efficient knowledge storage using libSQL as the backing store.
46

57
## Features
@@ -104,6 +106,27 @@ The server uses a libSQL database with the following schema:
104106
- Relations table: Stores relationships between entities
105107
- Vector search capabilities implemented using libSQL's built-in vector operations
106108

109+
## Development
110+
111+
### Publishing
112+
113+
Due to npm 2FA requirements, publishing needs to be done manually:
114+
115+
1. Create a changeset (documents your changes):
116+
```bash
117+
pnpm changeset
118+
```
119+
120+
2. Version the package (updates version and CHANGELOG):
121+
```bash
122+
pnpm changeset version
123+
```
124+
125+
3. Publish to npm (will prompt for 2FA code):
126+
```bash
127+
pnpm release
128+
```
129+
107130
## Contributing
108131

109132
Contributions are welcome! Please read our contributing guidelines before submitting pull requests.

package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mcp-memory-libsql",
3-
"version": "0.0.5",
3+
"version": "0.0.8",
44
"description": "LibSQL-based persistent memory tool for MCP",
55
"type": "module",
66
"main": "dist/index.js",
@@ -21,6 +21,17 @@
2121
"url": "https://github.com/spences10/mcp-memory-libsql/issues"
2222
},
2323
"homepage": "https://github.com/spences10/mcp-memory-libsql#readme",
24+
"keywords": [
25+
"mcp",
26+
"memory",
27+
"vector",
28+
"libsql",
29+
"knowledge-graph",
30+
"database",
31+
"vector-search",
32+
"semantic-search",
33+
"knowledge-management"
34+
],
2435
"scripts": {
2536
"build": "tsc && chmod +x dist/index.js",
2637
"start": "node dist/index.js",

src/db/client.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,19 @@ export class DatabaseManager {
2929
return DatabaseManager.instance;
3030
}
3131

32-
// Convert array to vector string representation
33-
private arrayToVectorString(numbers: number[]): string {
32+
// Convert array to vector string representation with validation
33+
private arrayToVectorString(numbers: number[] | undefined): string | null {
34+
if (!numbers || !Array.isArray(numbers)) {
35+
return null;
36+
}
37+
// Validate vector dimensions match schema (4 dimensions for testing)
38+
if (numbers.length !== 4) {
39+
throw new Error(`Vector must have exactly 4 dimensions, got ${numbers.length}`);
40+
}
41+
// Validate all elements are numbers
42+
if (!numbers.every(n => typeof n === 'number' && !isNaN(n))) {
43+
throw new Error('Vector must contain only valid numbers');
44+
}
3445
return `[${numbers.join(', ')}]`;
3546
}
3647

@@ -60,7 +71,7 @@ export class DatabaseManager {
6071
args: [
6172
entity.name,
6273
entity.entityType,
63-
entity.embedding ? this.arrayToVectorString(entity.embedding) : null
74+
this.arrayToVectorString(entity.embedding)
6475
],
6576
});
6677

src/db/migrations/schema.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
export const schema = [
2-
// Create entities table
3-
`CREATE TABLE IF NOT EXISTS entities (
2+
// Create entities table
3+
`CREATE TABLE IF NOT EXISTS entities (
44
name TEXT PRIMARY KEY,
55
entity_type TEXT NOT NULL,
66
embedding F32_BLOB(4), -- 4 dimensions for testing
77
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
88
)`,
99

10-
// Create observations table
11-
`CREATE TABLE IF NOT EXISTS observations (
10+
// Create observations table
11+
`CREATE TABLE IF NOT EXISTS observations (
1212
id INTEGER PRIMARY KEY AUTOINCREMENT,
1313
entity_name TEXT NOT NULL,
1414
content TEXT NOT NULL,
1515
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
1616
FOREIGN KEY (entity_name) REFERENCES entities(name)
1717
)`,
1818

19-
// Create relations table
20-
`CREATE TABLE IF NOT EXISTS relations (
19+
// Create relations table
20+
`CREATE TABLE IF NOT EXISTS relations (
2121
id INTEGER PRIMARY KEY AUTOINCREMENT,
2222
source TEXT NOT NULL,
2323
target TEXT NOT NULL,
@@ -27,12 +27,12 @@ export const schema = [
2727
FOREIGN KEY (target) REFERENCES entities(name)
2828
)`,
2929

30-
// Create indexes
31-
`CREATE INDEX IF NOT EXISTS idx_entities_name ON entities(name)`,
32-
`CREATE INDEX IF NOT EXISTS idx_observations_entity ON observations(entity_name)`,
33-
`CREATE INDEX IF NOT EXISTS idx_relations_source ON relations(source)`,
34-
`CREATE INDEX IF NOT EXISTS idx_relations_target ON relations(target)`,
30+
// Create indexes
31+
`CREATE INDEX IF NOT EXISTS idx_entities_name ON entities(name)`,
32+
`CREATE INDEX IF NOT EXISTS idx_observations_entity ON observations(entity_name)`,
33+
`CREATE INDEX IF NOT EXISTS idx_relations_source ON relations(source)`,
34+
`CREATE INDEX IF NOT EXISTS idx_relations_target ON relations(target)`,
3535

36-
// Create vector index for similarity search
37-
`CREATE INDEX IF NOT EXISTS idx_entities_embedding ON entities(libsql_vector_idx(embedding))`
36+
// Create vector index for similarity search
37+
`CREATE INDEX IF NOT EXISTS idx_entities_embedding ON entities(libsql_vector_idx(embedding))`,
3838
];

0 commit comments

Comments
 (0)