@agentmemory/agentmemory 0.9.2 → 0.9.3

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.mjs CHANGED
@@ -5618,7 +5618,7 @@ function registerAutoForgetFunction(sdk, kv) {
5618
5618
 
5619
5619
  //#endregion
5620
5620
  //#region src/version.ts
5621
- const VERSION = "0.9.2";
5621
+ const VERSION = "0.9.3";
5622
5622
 
5623
5623
  //#endregion
5624
5624
  //#region src/functions/export-import.ts
@@ -5738,7 +5738,8 @@ function registerExportImportFunction(sdk, kv) {
5738
5738
  "0.8.13",
5739
5739
  "0.9.0",
5740
5740
  "0.9.1",
5741
- "0.9.2"
5741
+ "0.9.2",
5742
+ "0.9.3"
5742
5743
  ]).has(importData.version)) return {
5743
5744
  success: false,
5744
5745
  error: `Unsupported export version: ${importData.version}`
@@ -13036,6 +13037,28 @@ function requireConfiguredSecret(secret, feature) {
13036
13037
  body: { error: `${feature} requires AGENTMEMORY_SECRET` }
13037
13038
  };
13038
13039
  }
13040
+ function flagDisabledResponse(opts) {
13041
+ return {
13042
+ status_code: 503,
13043
+ body: opts
13044
+ };
13045
+ }
13046
+ function graphDisabledResponse() {
13047
+ return flagDisabledResponse({
13048
+ error: "Knowledge graph not enabled",
13049
+ flag: "GRAPH_EXTRACTION_ENABLED",
13050
+ enableHow: "Set GRAPH_EXTRACTION_ENABLED=true and restart. Requires an LLM provider key.",
13051
+ docsHref: "https://github.com/rohitg00/agentmemory#knowledge-graph"
13052
+ });
13053
+ }
13054
+ function consolidationDisabledResponse() {
13055
+ return flagDisabledResponse({
13056
+ error: "Consolidation pipeline not enabled",
13057
+ flag: "CONSOLIDATION_ENABLED",
13058
+ enableHow: "Set CONSOLIDATION_ENABLED=true and restart. Requires an LLM provider key.",
13059
+ docsHref: "https://github.com/rohitg00/agentmemory#consolidation"
13060
+ });
13061
+ }
13039
13062
  function asNonEmptyString$1(value) {
13040
13063
  if (typeof value !== "string") return null;
13041
13064
  const trimmed = value.trim();
@@ -13087,6 +13110,78 @@ function registerApiTriggers(sdk, kv, secret, metricsStore, provider) {
13087
13110
  http_method: "GET"
13088
13111
  }
13089
13112
  });
13113
+ sdk.registerFunction("api::config-flags", async (req) => {
13114
+ const authErr = checkAuth(req, secret);
13115
+ if (authErr) return authErr;
13116
+ const env = process.env;
13117
+ return {
13118
+ status_code: 200,
13119
+ body: {
13120
+ version: VERSION,
13121
+ provider: env["ANTHROPIC_API_KEY"] || env["GEMINI_API_KEY"] || env["OPENROUTER_API_KEY"] || env["MINIMAX_API_KEY"] ? "llm" : "noop",
13122
+ embeddingProvider: detectEmbeddingProvider() ? "embeddings" : "none",
13123
+ flags: [
13124
+ {
13125
+ key: "GRAPH_EXTRACTION_ENABLED",
13126
+ label: "Knowledge graph extraction",
13127
+ enabled: isGraphExtractionEnabled(),
13128
+ default: false,
13129
+ affects: ["Graph", "Dashboard"],
13130
+ needsLlm: true,
13131
+ description: "Extracts entities and relations from observations into a knowledge graph.",
13132
+ enableHow: "Set GRAPH_EXTRACTION_ENABLED=true and provide an LLM key, then restart.",
13133
+ docsHref: "https://github.com/rohitg00/agentmemory#knowledge-graph"
13134
+ },
13135
+ {
13136
+ key: "CONSOLIDATION_ENABLED",
13137
+ label: "Memory consolidation",
13138
+ enabled: isConsolidationEnabled(),
13139
+ default: false,
13140
+ affects: [
13141
+ "Dashboard",
13142
+ "Memories",
13143
+ "Crystals"
13144
+ ],
13145
+ needsLlm: true,
13146
+ description: "Periodically summarizes sessions into semantic facts + procedures.",
13147
+ enableHow: "Set CONSOLIDATION_ENABLED=true and provide an LLM key, then restart.",
13148
+ docsHref: "https://github.com/rohitg00/agentmemory#consolidation"
13149
+ },
13150
+ {
13151
+ key: "AGENTMEMORY_AUTO_COMPRESS",
13152
+ label: "LLM-powered observation compression",
13153
+ enabled: isAutoCompressEnabled(),
13154
+ default: false,
13155
+ affects: ["Memories", "Timeline"],
13156
+ needsLlm: true,
13157
+ description: "Every observation is compressed by the LLM for richer summaries (costs tokens). OFF uses zero-LLM synthetic compression.",
13158
+ enableHow: "Set AGENTMEMORY_AUTO_COMPRESS=true and provide an LLM key.",
13159
+ docsHref: "https://github.com/rohitg00/agentmemory/issues/138"
13160
+ },
13161
+ {
13162
+ key: "AGENTMEMORY_INJECT_CONTEXT",
13163
+ label: "In-conversation context injection",
13164
+ enabled: isContextInjectionEnabled(),
13165
+ default: false,
13166
+ affects: ["Hooks"],
13167
+ needsLlm: false,
13168
+ description: "Hooks write recalled context into Claude Code's conversation. OFF captures in the background without injecting.",
13169
+ enableHow: "Set AGENTMEMORY_INJECT_CONTEXT=true and restart.",
13170
+ docsHref: "https://github.com/rohitg00/agentmemory/issues/143"
13171
+ }
13172
+ ]
13173
+ }
13174
+ };
13175
+ });
13176
+ sdk.registerTrigger({
13177
+ type: "http",
13178
+ function_id: "api::config-flags",
13179
+ config: {
13180
+ api_path: "/agentmemory/config/flags",
13181
+ http_method: "GET",
13182
+ middleware_function_ids: ["middleware::api-auth"]
13183
+ }
13184
+ });
13090
13185
  sdk.registerFunction("api::health", async (req) => {
13091
13186
  const health = await getLatestHealth(kv);
13092
13187
  const functionMetrics = metricsStore ? await metricsStore.getAll() : [];
@@ -13907,10 +14002,7 @@ function registerApiTriggers(sdk, kv, secret, metricsStore, provider) {
13907
14002
  })
13908
14003
  };
13909
14004
  } catch {
13910
- return {
13911
- status_code: 404,
13912
- body: { error: "Knowledge graph not enabled" }
13913
- };
14005
+ return graphDisabledResponse();
13914
14006
  }
13915
14007
  });
13916
14008
  sdk.registerTrigger({
@@ -13933,10 +14025,7 @@ function registerApiTriggers(sdk, kv, secret, metricsStore, provider) {
13933
14025
  })
13934
14026
  };
13935
14027
  } catch {
13936
- return {
13937
- status_code: 404,
13938
- body: { error: "Knowledge graph not enabled" }
13939
- };
14028
+ return graphDisabledResponse();
13940
14029
  }
13941
14030
  });
13942
14031
  sdk.registerTrigger({
@@ -13963,10 +14052,7 @@ function registerApiTriggers(sdk, kv, secret, metricsStore, provider) {
13963
14052
  })
13964
14053
  };
13965
14054
  } catch {
13966
- return {
13967
- status_code: 404,
13968
- body: { error: "Knowledge graph not enabled" }
13969
- };
14055
+ return graphDisabledResponse();
13970
14056
  }
13971
14057
  });
13972
14058
  sdk.registerTrigger({
@@ -13989,10 +14075,7 @@ function registerApiTriggers(sdk, kv, secret, metricsStore, provider) {
13989
14075
  })
13990
14076
  };
13991
14077
  } catch {
13992
- return {
13993
- status_code: 404,
13994
- body: { error: "Consolidation pipeline not enabled" }
13995
- };
14078
+ return consolidationDisabledResponse();
13996
14079
  }
13997
14080
  });
13998
14081
  sdk.registerTrigger({