@insforge/mcp 1.2.6-memory.0 → 1.2.6-memory.2
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/{chunk-742PFYYV.js → chunk-43OCZIXR.js} +105 -100
- package/dist/http-server.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -2270,110 +2270,115 @@ To: Your current project directory
|
|
|
2270
2270
|
}
|
|
2271
2271
|
})
|
|
2272
2272
|
);
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2273
|
+
registerTool(
|
|
2274
|
+
"store-conversation",
|
|
2275
|
+
`IMPORTANT: Call this tool automatically when a task or conversation is complete to save it for future reference.
|
|
2276
|
+
|
|
2277
|
+
Store a conversation with messages for semantic similarity search. Messages are embedded using pgvector for later retrieval.
|
|
2278
|
+
|
|
2279
|
+
Include a descriptive title and relevant metadata (e.g., topic, project, keywords) to improve search results later.`,
|
|
2280
|
+
{
|
|
2281
|
+
apiKey: z23.string().optional().describe("API key for authentication (optional if provided via --api_key)"),
|
|
2282
|
+
title: z23.string().optional().describe("Optional title for the conversation"),
|
|
2283
|
+
metadata: z23.record(z23.unknown()).optional().describe("Optional metadata to associate with the conversation"),
|
|
2284
|
+
messages: z23.array(
|
|
2285
|
+
z23.object({
|
|
2286
|
+
role: z23.enum(["user", "assistant", "system", "tool"]).describe("Message role"),
|
|
2287
|
+
content: z23.string().describe("Message content"),
|
|
2288
|
+
metadata: z23.record(z23.unknown()).optional().describe("Optional message metadata")
|
|
2289
|
+
})
|
|
2290
|
+
).min(1).describe("Array of messages to store"),
|
|
2291
|
+
embeddingModel: z23.string().optional().describe("Embedding model to use (uses project default if not specified)")
|
|
2292
|
+
},
|
|
2293
|
+
withUsageTracking(
|
|
2276
2294
|
"store-conversation",
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
})
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
type: "text",
|
|
2309
|
-
text: formatSuccessMessage("Conversation stored successfully", result)
|
|
2310
|
-
}
|
|
2311
|
-
]
|
|
2312
|
-
});
|
|
2313
|
-
} catch (error) {
|
|
2314
|
-
const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
|
|
2315
|
-
return {
|
|
2316
|
-
content: [
|
|
2317
|
-
{
|
|
2318
|
-
type: "text",
|
|
2319
|
-
text: `Error storing conversation: ${errMsg}`
|
|
2320
|
-
}
|
|
2321
|
-
],
|
|
2322
|
-
isError: true
|
|
2323
|
-
};
|
|
2324
|
-
}
|
|
2295
|
+
async ({ apiKey, title, metadata, messages, embeddingModel }) => {
|
|
2296
|
+
try {
|
|
2297
|
+
const actualApiKey = getApiKey(apiKey);
|
|
2298
|
+
const response = await fetch2(`${API_BASE_URL}/api/memory/conversations`, {
|
|
2299
|
+
method: "POST",
|
|
2300
|
+
headers: {
|
|
2301
|
+
"x-api-key": actualApiKey,
|
|
2302
|
+
"Content-Type": "application/json"
|
|
2303
|
+
},
|
|
2304
|
+
body: JSON.stringify({ title, metadata, messages, embeddingModel })
|
|
2305
|
+
});
|
|
2306
|
+
const result = await handleApiResponse(response);
|
|
2307
|
+
return await addBackgroundContext({
|
|
2308
|
+
content: [
|
|
2309
|
+
{
|
|
2310
|
+
type: "text",
|
|
2311
|
+
text: formatSuccessMessage("Conversation stored successfully", result)
|
|
2312
|
+
}
|
|
2313
|
+
]
|
|
2314
|
+
});
|
|
2315
|
+
} catch (error) {
|
|
2316
|
+
const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
|
|
2317
|
+
return {
|
|
2318
|
+
content: [
|
|
2319
|
+
{
|
|
2320
|
+
type: "text",
|
|
2321
|
+
text: `Error storing conversation: ${errMsg}`
|
|
2322
|
+
}
|
|
2323
|
+
],
|
|
2324
|
+
isError: true
|
|
2325
|
+
};
|
|
2325
2326
|
}
|
|
2326
|
-
|
|
2327
|
-
)
|
|
2328
|
-
|
|
2327
|
+
}
|
|
2328
|
+
)
|
|
2329
|
+
);
|
|
2330
|
+
registerTool(
|
|
2331
|
+
"search-conversations",
|
|
2332
|
+
`IMPORTANT: Call this tool automatically at the START of each new task or conversation to retrieve relevant context from past interactions.
|
|
2333
|
+
|
|
2334
|
+
Search for conversations by semantic similarity using pgvector. Returns conversations ranked by relevance to the query.
|
|
2335
|
+
|
|
2336
|
+
Use the user's question or task description as the query to find related past conversations that may provide helpful context.`,
|
|
2337
|
+
{
|
|
2338
|
+
apiKey: z23.string().optional().describe("API key for authentication (optional if provided via --api_key)"),
|
|
2339
|
+
query: z23.string().describe("Search query to find similar conversations"),
|
|
2340
|
+
limit: z23.number().int().positive().max(100).optional().default(10).describe("Maximum number of results to return (default: 10)"),
|
|
2341
|
+
threshold: z23.number().min(0).max(1).optional().default(0).describe("Minimum similarity threshold 0-1 (default: 0)"),
|
|
2342
|
+
metadataFilter: z23.record(z23.unknown()).optional().describe("Filter conversations by metadata (JSONB containment)"),
|
|
2343
|
+
embeddingModel: z23.string().optional().describe("Embedding model for the query (uses project default if not specified)")
|
|
2344
|
+
},
|
|
2345
|
+
withUsageTracking(
|
|
2329
2346
|
"search-conversations",
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
} catch (error) {
|
|
2362
|
-
const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
|
|
2363
|
-
return {
|
|
2364
|
-
content: [
|
|
2365
|
-
{
|
|
2366
|
-
type: "text",
|
|
2367
|
-
text: `Error searching conversations: ${errMsg}`
|
|
2368
|
-
}
|
|
2369
|
-
],
|
|
2370
|
-
isError: true
|
|
2371
|
-
};
|
|
2372
|
-
}
|
|
2347
|
+
async ({ apiKey, query, limit, threshold, metadataFilter, embeddingModel }) => {
|
|
2348
|
+
try {
|
|
2349
|
+
const actualApiKey = getApiKey(apiKey);
|
|
2350
|
+
const response = await fetch2(`${API_BASE_URL}/api/memory/search`, {
|
|
2351
|
+
method: "POST",
|
|
2352
|
+
headers: {
|
|
2353
|
+
"x-api-key": actualApiKey,
|
|
2354
|
+
"Content-Type": "application/json"
|
|
2355
|
+
},
|
|
2356
|
+
body: JSON.stringify({ query, limit, threshold, metadataFilter, embeddingModel })
|
|
2357
|
+
});
|
|
2358
|
+
const result = await handleApiResponse(response);
|
|
2359
|
+
return await addBackgroundContext({
|
|
2360
|
+
content: [
|
|
2361
|
+
{
|
|
2362
|
+
type: "text",
|
|
2363
|
+
text: formatSuccessMessage("Conversation search completed", result)
|
|
2364
|
+
}
|
|
2365
|
+
]
|
|
2366
|
+
});
|
|
2367
|
+
} catch (error) {
|
|
2368
|
+
const errMsg = error instanceof Error ? error.message : "Unknown error occurred";
|
|
2369
|
+
return {
|
|
2370
|
+
content: [
|
|
2371
|
+
{
|
|
2372
|
+
type: "text",
|
|
2373
|
+
text: `Error searching conversations: ${errMsg}`
|
|
2374
|
+
}
|
|
2375
|
+
],
|
|
2376
|
+
isError: true
|
|
2377
|
+
};
|
|
2373
2378
|
}
|
|
2374
|
-
|
|
2375
|
-
)
|
|
2376
|
-
|
|
2379
|
+
}
|
|
2380
|
+
)
|
|
2381
|
+
);
|
|
2377
2382
|
return {
|
|
2378
2383
|
apiKey: GLOBAL_API_KEY,
|
|
2379
2384
|
apiBaseUrl: API_BASE_URL,
|
package/dist/http-server.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED