cozo-memory 1.2.3 → 1.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.
Files changed (2) hide show
  1. package/dist/index.js +32 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2188,11 +2188,25 @@ ids[id] <- $ids
2188
2188
  const actualHeaders = validationRes.headers;
2189
2189
  const missingHeaders = expectedHeaders.filter(h => !actualHeaders.includes(h));
2190
2190
  if (missingHeaders.length > 0) {
2191
- return { error: `Invalid Datalog result set. Missing columns: ${missingHeaders.join(", ")}. Expected: ${expectedHeaders.join(", ")}` };
2191
+ return {
2192
+ error: `Invalid Datalog result set. Missing columns: ${missingHeaders.join(", ")}. Expected: ${expectedHeaders.join(", ")}`,
2193
+ hint: "Ensure all variables in the rule head are bound in the rule body. See docs/USAGE-GUIDE.md for examples."
2194
+ };
2192
2195
  }
2193
2196
  }
2194
2197
  catch (validationError) {
2195
- return { error: `Datalog syntax error: ${validationError.message}` };
2198
+ const errorMsg = validationError.message || String(validationError);
2199
+ let hint = "";
2200
+ if (errorMsg.includes("unbound")) {
2201
+ hint = "All variables in the rule head must appear in the rule body. Example: if you use 'relation_type' in the head, it must be bound to a value or extracted from a table in the body.";
2202
+ }
2203
+ else if (errorMsg.includes("syntax")) {
2204
+ hint = "Check Datalog syntax. Common issues: missing commas, incorrect table names, or malformed predicates.";
2205
+ }
2206
+ return {
2207
+ error: `Datalog syntax error: ${errorMsg}`,
2208
+ hint: hint || "See docs/USAGE-GUIDE.md for correct Datalog syntax and examples."
2209
+ };
2196
2210
  }
2197
2211
  const id = (0, uuid_1.v4)();
2198
2212
  const now = Date.now();
@@ -3428,7 +3442,7 @@ Advanced: run_transaction, add_inference_rule, ingest_file, session/task managem
3428
3442
 
3429
3443
  Use entity_id='global_user_profile' for storing persistent user preferences (automatically boosted in searches).
3430
3444
 
3431
- For detailed action descriptions, parameters, and examples, see the cozo-memory-guide steering file.
3445
+ For detailed action descriptions, parameters, and examples, see docs/USAGE-GUIDE.md.
3432
3446
 
3433
3447
  Note: Inference rules must return exactly 5 columns: [from_id, to_id, relation_type, confidence, reason]. Invalid syntax will result in errors.`,
3434
3448
  parameters: MutateMemoryParameters,
@@ -3778,9 +3792,17 @@ Note: Inference rules must return exactly 5 columns: [from_id, to_id, relation_t
3778
3792
 
3779
3793
  Use 'search' for quick lookups, 'adaptive_retrieval' for auto-optimization, or 'context' for comprehensive exploration.
3780
3794
 
3781
- Available actions: search, advancedSearch, context, entity_details, history, graph_rag, graph_walking, adaptive_retrieval, dynamic_fusion, agentic_search, spreading_activation, suggest_connections, get_zettelkasten_stats, get_activation_stats, get_salience_stats, qafd_search, hierarchical_memory_query.
3795
+ Available actions:
3796
+ - search, advancedSearch: Hybrid search with query (required)
3797
+ - context: Context retrieval with query (required)
3798
+ - entity_details, history: Entity info with entity_id (required)
3799
+ - graph_rag, graph_walking: Graph traversal with query (required)
3800
+ - adaptive_retrieval, dynamic_fusion, agentic_search: Advanced search with query (required)
3801
+ - spreading_activation, qafd_search, hierarchical_memory_query: Specialized search with query (required)
3802
+ - suggest_connections: Connection suggestions with entity_id (required)
3803
+ - get_zettelkasten_stats, get_activation_stats, get_salience_stats: Statistics (no params required)
3782
3804
 
3783
- Note: User profile observations (entity_id='global_user_profile') are automatically boosted in searches. For detailed action descriptions and parameters, see the cozo-memory-guide steering file.`,
3805
+ Note: User profile observations (entity_id='global_user_profile') are automatically boosted in searches. For detailed action descriptions and parameters, see docs/USAGE-GUIDE.md.`,
3784
3806
  parameters: QueryMemoryParameters,
3785
3807
  execute: async (args) => {
3786
3808
  await this.initPromise;
@@ -4436,7 +4458,7 @@ Advanced: semantic_walk, infer_relations, bridge_discovery, hnsw_clusters, tempo
4436
4458
 
4437
4459
  Use 'explore' without end_entity for neighborhood, with end_entity for shortest path.
4438
4460
 
4439
- For detailed action descriptions and parameters, see the cozo-memory-guide steering file.`,
4461
+ For detailed action descriptions and parameters, see docs/USAGE-GUIDE.md.`,
4440
4462
  parameters: AnalyzeGraphParameters,
4441
4463
  execute: async (args) => {
4442
4464
  await this.initPromise;
@@ -4897,11 +4919,13 @@ Monitoring: health (status check), metrics (detailed stats)
4897
4919
  Data portability: export_memory (JSON/Markdown/Obsidian), import_memory (Mem0/MemGPT/Cozo)
4898
4920
  Backups: snapshot_create, snapshot_list, snapshot_diff
4899
4921
  Optimization: cleanup (LLM consolidation), defrag (merge duplicates), reflect (find contradictions)
4900
- Advanced: summarize_communities, compress_memory_levels, analyze_memory_distribution
4922
+ Advanced: summarize_communities, compress_memory_levels, analyze_memory_distribution, compact
4901
4923
 
4902
4924
  Important: Use confirm=false for dry-run before cleanup/defrag. clear_memory requires confirm=true.
4903
4925
 
4904
- For detailed action descriptions and parameters, see the cozo-memory-guide steering file.`,
4926
+ Note: For statistics (get_salience_stats, get_activation_stats, get_zettelkasten_stats), use query_memory tool instead.
4927
+
4928
+ For detailed action descriptions and parameters, see docs/USAGE-GUIDE.md.`,
4905
4929
  parameters: ManageSystemParameters,
4906
4930
  execute: async (args) => {
4907
4931
  await this.initPromise;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozo-memory",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "mcpName": "io.github.tobs-code/cozo-memory",
5
5
  "description": "Local-first persistent memory system for AI agents with hybrid search, graph reasoning, and MCP integration",
6
6
  "main": "dist/index.js",