cozo-memory 1.0.7 → 1.0.8

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.
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ const hybrid_search_1 = require("./hybrid-search");
37
+ const db_service_1 = require("./db-service");
38
+ const path = __importStar(require("path"));
39
+ async function testAgenticSearch() {
40
+ console.log("Starting agentic_search direct test...");
41
+ // Create a minimal environment to test HybridSearch
42
+ const dbPath = path.resolve(process.cwd(), 'memory.db');
43
+ console.log(`Using database at: ${dbPath}`);
44
+ const dbService = new db_service_1.CozoDbService(dbPath, 'sqlite');
45
+ await dbService.init();
46
+ const hybridSearch = new hybrid_search_1.HybridSearch(dbService);
47
+ await hybridSearch.init();
48
+ const query = "Was ist der Status der Frontend und Backend Projekte?";
49
+ console.log(`Querying: "${query}"`);
50
+ try {
51
+ const results = await hybridSearch.agenticRetrieve({
52
+ query,
53
+ limit: 5
54
+ });
55
+ console.log("Agentic Search Results:", JSON.stringify(results, null, 2));
56
+ }
57
+ catch (error) {
58
+ console.error("Error during agentic search:", error);
59
+ }
60
+ finally {
61
+ await dbService.close();
62
+ }
63
+ }
64
+ testAgenticSearch();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozo-memory",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
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",
@@ -37,6 +37,7 @@
37
37
  "rebuild": "npm run clean && npm run build",
38
38
  "test": "echo \"Error: no test specified\" && exit 1",
39
39
  "benchmark": "ts-node src/benchmark.ts",
40
+ "eval": "ts-node src/eval-suite.ts",
40
41
  "download-model": "ts-node src/download-model.ts"
41
42
  },
42
43
  "keywords": [
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const index_1 = require("./index");
4
- async function testMCPSearch() {
5
- console.log('Initializing MemoryServer...');
6
- const server = new index_1.MemoryServer();
7
- await server.initPromise;
8
- console.log('\n=== Test 1: Create Entity via MCP mutate_memory ===');
9
- const createResult = await server.mutateMemory({
10
- action: 'create_entity',
11
- name: 'Test Search Entity',
12
- type: 'test',
13
- metadata: { purpose: 'search_test' }
14
- });
15
- console.log('Created:', createResult);
16
- const entityId = createResult.id;
17
- console.log('\n=== Test 2: Add Observation via MCP mutate_memory ===');
18
- const obsResult = await server.mutateMemory({
19
- action: 'add_observation',
20
- entity_id: entityId,
21
- text: 'This is a test observation for searching with keywords like authentication and OAuth',
22
- metadata: { test: true }
23
- });
24
- console.log('Added observation:', obsResult);
25
- console.log('\n=== Test 3: Search via MCP query_memory ===');
26
- const searchResult = await server.queryMemory({
27
- action: 'search',
28
- query: 'authentication',
29
- limit: 5
30
- });
31
- console.log('Search result:', JSON.stringify(searchResult, null, 2));
32
- console.log('\n=== Test 4: Search for "Alice" ===');
33
- const aliceResult = await server.queryMemory({
34
- action: 'search',
35
- query: 'Alice',
36
- limit: 5
37
- });
38
- console.log('Alice search result:', JSON.stringify(aliceResult, null, 2));
39
- console.log('\n=== Test 5: Search for "TypeScript" ===');
40
- const tsResult = await server.queryMemory({
41
- action: 'search',
42
- query: 'TypeScript',
43
- limit: 5
44
- });
45
- console.log('TypeScript search result:', JSON.stringify(tsResult, null, 2));
46
- }
47
- testMCPSearch().catch(console.error);