@memly/mcp-server 0.2.3 → 0.2.5
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.
- package/dist/index.js +27 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19954,7 +19954,7 @@ class MemlyClient {
|
|
|
19954
19954
|
body: JSON.stringify({
|
|
19955
19955
|
content,
|
|
19956
19956
|
project_id: projectId,
|
|
19957
|
-
source: source ?? "
|
|
19957
|
+
source: source ?? "metadata"
|
|
19958
19958
|
})
|
|
19959
19959
|
});
|
|
19960
19960
|
}
|
|
@@ -19977,7 +19977,7 @@ function registerTools(server, client) {
|
|
|
19977
19977
|
}, async ({ topic }) => {
|
|
19978
19978
|
try {
|
|
19979
19979
|
const query = topic ?? "recent technical decisions architecture patterns current work";
|
|
19980
|
-
const result = await client.searchMemories(query, undefined,
|
|
19980
|
+
const result = await client.searchMemories(query, undefined, 20);
|
|
19981
19981
|
if (result.is_cold_start || result.memories.length === 0) {
|
|
19982
19982
|
return {
|
|
19983
19983
|
content: [{
|
|
@@ -19986,14 +19986,36 @@ function registerTools(server, client) {
|
|
|
19986
19986
|
}]
|
|
19987
19987
|
};
|
|
19988
19988
|
}
|
|
19989
|
-
const
|
|
19990
|
-
|
|
19989
|
+
const MIN_CONFIDENCE = 0.25;
|
|
19990
|
+
const quality = result.memories.filter((m) => (m.confidence ?? 0) >= MIN_CONFIDENCE);
|
|
19991
|
+
if (quality.length === 0) {
|
|
19992
|
+
return {
|
|
19993
|
+
content: [{
|
|
19994
|
+
type: "text",
|
|
19995
|
+
text: "\uD83E\uDDE0 Memly: No high-quality memories found yet. I'll start capturing important context from this session."
|
|
19996
|
+
}]
|
|
19997
|
+
};
|
|
19998
|
+
}
|
|
19999
|
+
const seen = new Set;
|
|
20000
|
+
const deduped = quality.filter((m) => {
|
|
20001
|
+
const key = (m.content ?? "").slice(0, 80).toLowerCase().replace(/\s+/g, " ");
|
|
20002
|
+
if (seen.has(key))
|
|
20003
|
+
return false;
|
|
20004
|
+
seen.add(key);
|
|
20005
|
+
return true;
|
|
20006
|
+
}).slice(0, 10);
|
|
20007
|
+
const formatted = deduped.map((m, i) => {
|
|
20008
|
+
const confidence = m.confidence ? `${(m.confidence * 100).toFixed(0)}%` : "n/a";
|
|
20009
|
+
const type = m.chunk_type ?? "general";
|
|
20010
|
+
return `[${i + 1}] ${type} | confidence: ${confidence}
|
|
20011
|
+
${m.content}`;
|
|
20012
|
+
}).join(`
|
|
19991
20013
|
|
|
19992
20014
|
`);
|
|
19993
20015
|
return {
|
|
19994
20016
|
content: [{
|
|
19995
20017
|
type: "text",
|
|
19996
|
-
text: `\uD83E\uDDE0 Memly: Loaded ${
|
|
20018
|
+
text: `\uD83E\uDDE0 Memly: Loaded ${deduped.length} memories from previous sessions.
|
|
19997
20019
|
|
|
19998
20020
|
${formatted}
|
|
19999
20021
|
|