@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.
@@ -2270,110 +2270,115 @@ To: Your current project directory
2270
2270
  }
2271
2271
  })
2272
2272
  );
2273
- const memoryEnabled = process.env.MEMORY_ENABLED === "true";
2274
- if (memoryEnabled) {
2275
- registerTool(
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
- "Store a conversation with messages for semantic similarity search. Messages are embedded using pgvector for later retrieval.",
2278
- {
2279
- apiKey: z23.string().optional().describe("API key for authentication (optional if provided via --api_key)"),
2280
- title: z23.string().optional().describe("Optional title for the conversation"),
2281
- metadata: z23.record(z23.unknown()).optional().describe("Optional metadata to associate with the conversation"),
2282
- messages: z23.array(
2283
- z23.object({
2284
- role: z23.enum(["user", "assistant", "system", "tool"]).describe("Message role"),
2285
- content: z23.string().describe("Message content"),
2286
- metadata: z23.record(z23.unknown()).optional().describe("Optional message metadata")
2287
- })
2288
- ).min(1).describe("Array of messages to store"),
2289
- embeddingModel: z23.string().optional().describe("Embedding model to use (uses project default if not specified)")
2290
- },
2291
- withUsageTracking(
2292
- "store-conversation",
2293
- async ({ apiKey, title, metadata, messages, embeddingModel }) => {
2294
- try {
2295
- const actualApiKey = getApiKey(apiKey);
2296
- const response = await fetch2(`${API_BASE_URL}/api/memory/conversations`, {
2297
- method: "POST",
2298
- headers: {
2299
- "x-api-key": actualApiKey,
2300
- "Content-Type": "application/json"
2301
- },
2302
- body: JSON.stringify({ title, metadata, messages, embeddingModel })
2303
- });
2304
- const result = await handleApiResponse(response);
2305
- return await addBackgroundContext({
2306
- content: [
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
- registerTool(
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
- "Search for conversations by semantic similarity using pgvector. Returns conversations ranked by relevance to the query.",
2331
- {
2332
- apiKey: z23.string().optional().describe("API key for authentication (optional if provided via --api_key)"),
2333
- query: z23.string().describe("Search query to find similar conversations"),
2334
- limit: z23.number().int().positive().max(100).optional().default(10).describe("Maximum number of results to return (default: 10)"),
2335
- threshold: z23.number().min(0).max(1).optional().default(0).describe("Minimum similarity threshold 0-1 (default: 0)"),
2336
- metadataFilter: z23.record(z23.unknown()).optional().describe("Filter conversations by metadata (JSONB containment)"),
2337
- embeddingModel: z23.string().optional().describe("Embedding model for the query (uses project default if not specified)")
2338
- },
2339
- withUsageTracking(
2340
- "search-conversations",
2341
- async ({ apiKey, query, limit, threshold, metadataFilter, embeddingModel }) => {
2342
- try {
2343
- const actualApiKey = getApiKey(apiKey);
2344
- const response = await fetch2(`${API_BASE_URL}/api/memory/search`, {
2345
- method: "POST",
2346
- headers: {
2347
- "x-api-key": actualApiKey,
2348
- "Content-Type": "application/json"
2349
- },
2350
- body: JSON.stringify({ query, limit, threshold, metadataFilter, embeddingModel })
2351
- });
2352
- const result = await handleApiResponse(response);
2353
- return await addBackgroundContext({
2354
- content: [
2355
- {
2356
- type: "text",
2357
- text: formatSuccessMessage("Conversation search completed", result)
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,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  registerInsforgeTools
4
- } from "./chunk-742PFYYV.js";
4
+ } from "./chunk-43OCZIXR.js";
5
5
 
6
6
  // src/http/server.ts
7
7
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  registerInsforgeTools
4
- } from "./chunk-742PFYYV.js";
4
+ } from "./chunk-43OCZIXR.js";
5
5
 
6
6
  // src/stdio/index.ts
7
7
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insforge/mcp",
3
- "version": "1.2.6-memory.0",
3
+ "version": "1.2.6-memory.2",
4
4
  "description": "MCP (Model Context Protocol) server for Insforge backend-as-a-service",
5
5
  "mcpName": "io.github.InsForge/insforge-mcp",
6
6
  "type": "module",