@vainplex/openclaw-knowledge-engine 0.1.1 → 0.1.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/LICENSE +1 -1
- package/README.md +7 -7
- package/dist/index.d.ts +8 -4
- package/dist/index.js +31 -27
- package/dist/src/config-loader.d.ts +22 -0
- package/dist/src/config-loader.js +104 -0
- package/dist/src/config.d.ts +1 -1
- package/dist/src/config.js +3 -2
- package/openclaw.plugin.json +117 -113
- package/package.json +15 -5
- package/ARCHITECTURE.md +0 -374
- package/index.ts +0 -38
- package/src/config.ts +0 -180
- package/src/embeddings.ts +0 -82
- package/src/entity-extractor.ts +0 -137
- package/src/fact-store.ts +0 -260
- package/src/hooks.ts +0 -125
- package/src/http-client.ts +0 -74
- package/src/llm-enhancer.ts +0 -187
- package/src/maintenance.ts +0 -102
- package/src/patterns.ts +0 -90
- package/src/storage.ts +0 -122
- package/src/types.ts +0 -144
- package/test/config.test.ts +0 -152
- package/test/embeddings.test.ts +0 -118
- package/test/entity-extractor.test.ts +0 -121
- package/test/fact-store.test.ts +0 -266
- package/test/hooks.test.ts +0 -120
- package/test/http-client.test.ts +0 -68
- package/test/llm-enhancer.test.ts +0 -132
- package/test/maintenance.test.ts +0 -117
- package/test/patterns.test.ts +0 -123
- package/test/storage.test.ts +0 -86
- package/tsconfig.json +0 -26
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -14,11 +14,11 @@ Every message your OpenClaw agent processes flows through the Knowledge Engine:
|
|
|
14
14
|
6. **Background Maintenance** — Prunes low-relevance facts, compacts storage, runs cleanup
|
|
15
15
|
|
|
16
16
|
```
|
|
17
|
-
User: "We're meeting with
|
|
17
|
+
User: "We're meeting with Alex from Acme Corp next Tuesday"
|
|
18
18
|
│
|
|
19
|
-
├─ Regex → entities: [
|
|
20
|
-
└─ LLM → facts: [
|
|
21
|
-
[Meeting — scheduled-with —
|
|
19
|
+
├─ Regex → entities: [Alex (person), Acme Corp (organization)]
|
|
20
|
+
└─ LLM → facts: [Alex — works-at — Acme Corp]
|
|
21
|
+
[Meeting — scheduled-with — Acme Corp]
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## Quick Start
|
|
@@ -167,9 +167,9 @@ Facts are stored as structured triples:
|
|
|
167
167
|
```json
|
|
168
168
|
{
|
|
169
169
|
"id": "f-abc123",
|
|
170
|
-
"subject": "
|
|
170
|
+
"subject": "Alex",
|
|
171
171
|
"predicate": "works-at",
|
|
172
|
-
"object": "
|
|
172
|
+
"object": "Acme Corp",
|
|
173
173
|
"source": "extracted-llm",
|
|
174
174
|
"relevance": 0.95,
|
|
175
175
|
"createdAt": 1707123456789,
|
|
@@ -235,7 +235,7 @@ npm test
|
|
|
235
235
|
|
|
236
236
|
Tests cover: config validation, entity extraction, fact CRUD, decay, pruning, LLM batching, HTTP client, embeddings, storage atomicity, maintenance scheduling, hook orchestration.
|
|
237
237
|
|
|
238
|
-
## Part of the
|
|
238
|
+
## Part of the Vainplex Plugin Suite
|
|
239
239
|
|
|
240
240
|
| # | Plugin | Status | Description |
|
|
241
241
|
|---|--------|--------|-------------|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { OpenClawPluginApi } from './src/types.js';
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
declare const plugin: {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
version: string;
|
|
7
|
+
register(api: OpenClawPluginApi): void;
|
|
8
|
+
};
|
|
9
|
+
export default plugin;
|
package/dist/index.js
CHANGED
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
// index.ts
|
|
2
|
-
import {
|
|
1
|
+
// index.ts — OpenClaw Plugin Entry Point
|
|
2
|
+
import { loadConfig } from './src/config-loader.js';
|
|
3
3
|
import { HookManager } from './src/hooks.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
4
|
+
const plugin = {
|
|
5
|
+
id: 'openclaw-knowledge-engine',
|
|
6
|
+
name: 'OpenClaw Knowledge Engine',
|
|
7
|
+
description: 'Real-time knowledge extraction — entities, facts, and relationships from conversations',
|
|
8
|
+
version: '0.1.2',
|
|
9
|
+
register(api) {
|
|
10
|
+
const { pluginConfig, logger } = api;
|
|
11
|
+
// 1. Resolve and validate the configuration
|
|
12
|
+
const { config } = loadConfig(pluginConfig, logger);
|
|
13
|
+
if (!config) {
|
|
14
|
+
logger.error('Knowledge Engine: Invalid configuration — plugin disabled.');
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (!config.enabled) {
|
|
18
|
+
logger.info('[knowledge-engine] Disabled via config');
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
// 2. Initialize the Hook Manager and register hooks
|
|
22
|
+
try {
|
|
23
|
+
logger.info('[knowledge-engine] Registering hooks...');
|
|
24
|
+
const hookManager = new HookManager(api, config);
|
|
25
|
+
hookManager.registerHooks();
|
|
26
|
+
logger.info('[knowledge-engine] Ready');
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
logger.error('[knowledge-engine] Failed to initialize', err);
|
|
30
|
+
}
|
|
31
|
+
},
|
|
29
32
|
};
|
|
33
|
+
export default plugin;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { KnowledgeConfig, Logger } from "./types.js";
|
|
2
|
+
/** Minimal inline config that lives in openclaw.json */
|
|
3
|
+
export interface InlineConfig {
|
|
4
|
+
readonly enabled?: boolean;
|
|
5
|
+
/** Override path to external config file */
|
|
6
|
+
readonly configPath?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ConfigLoadResult {
|
|
9
|
+
readonly config: KnowledgeConfig | null;
|
|
10
|
+
readonly source: "inline" | "file" | "defaults";
|
|
11
|
+
readonly filePath?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Load knowledge-engine config with the following priority:
|
|
15
|
+
*
|
|
16
|
+
* 1. Legacy inline config (full config in openclaw.json) → use it directly
|
|
17
|
+
* 2. External file (configPath or default location) → read + resolve
|
|
18
|
+
* 3. Graceful defaults → everything enabled, fail-open
|
|
19
|
+
*
|
|
20
|
+
* NEVER throws. Worst case: returns defaults with a warning.
|
|
21
|
+
*/
|
|
22
|
+
export declare function loadConfig(pluginConfig: Record<string, unknown> | undefined, logger: Logger): ConfigLoadResult;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { readFileSync, existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { join, dirname } from "node:path";
|
|
3
|
+
import { resolveConfig, DEFAULT_CONFIG } from "./config.js";
|
|
4
|
+
const DEFAULT_CONFIG_DIR = join(process.env["HOME"] ?? "/tmp", ".openclaw", "plugins", "openclaw-knowledge-engine");
|
|
5
|
+
const DEFAULT_CONFIG_FILENAME = "config.json";
|
|
6
|
+
function isRecord(v) {
|
|
7
|
+
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Determine whether pluginConfig is a full (legacy) inline config
|
|
11
|
+
* or just the minimal inline pointer.
|
|
12
|
+
*
|
|
13
|
+
* Heuristic: if it has keys beyond `enabled` and `configPath`,
|
|
14
|
+
* treat it as legacy inline config.
|
|
15
|
+
*/
|
|
16
|
+
function isLegacyInlineConfig(raw) {
|
|
17
|
+
const inlineOnlyKeys = new Set(["enabled", "configPath"]);
|
|
18
|
+
return Object.keys(raw).some((k) => !inlineOnlyKeys.has(k));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Read and parse a JSON file. Returns null on any error.
|
|
22
|
+
*/
|
|
23
|
+
function readJsonFile(path, logger) {
|
|
24
|
+
try {
|
|
25
|
+
if (!existsSync(path))
|
|
26
|
+
return null;
|
|
27
|
+
const raw = readFileSync(path, "utf-8");
|
|
28
|
+
const parsed = JSON.parse(raw);
|
|
29
|
+
if (!isRecord(parsed)) {
|
|
30
|
+
logger.warn(`[knowledge-engine] Config file is not an object: ${path}`);
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
return parsed;
|
|
34
|
+
}
|
|
35
|
+
catch (e) {
|
|
36
|
+
logger.warn(`[knowledge-engine] Failed to read config file ${path}: ${e instanceof Error ? e.message : String(e)}`);
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Apply inline `enabled` override to a file-loaded config (immutably).
|
|
42
|
+
*/
|
|
43
|
+
function applyInlineOverrides(fileConfig, inline) {
|
|
44
|
+
if (typeof inline["enabled"] === "boolean") {
|
|
45
|
+
return { ...fileConfig, enabled: inline["enabled"] };
|
|
46
|
+
}
|
|
47
|
+
return fileConfig;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Bootstrap a default config file and return its contents.
|
|
51
|
+
* Returns null if writing or reading back fails.
|
|
52
|
+
*/
|
|
53
|
+
function bootstrapConfig(path, logger) {
|
|
54
|
+
try {
|
|
55
|
+
const dir = dirname(path);
|
|
56
|
+
if (!existsSync(dir))
|
|
57
|
+
mkdirSync(dir, { recursive: true });
|
|
58
|
+
writeFileSync(path, JSON.stringify(DEFAULT_CONFIG, null, 2) + "\n", "utf-8");
|
|
59
|
+
logger.info(`[knowledge-engine] Created default config at ${path}`);
|
|
60
|
+
return readJsonFile(path, logger);
|
|
61
|
+
}
|
|
62
|
+
catch (e) {
|
|
63
|
+
logger.warn(`[knowledge-engine] Failed to write default config: ${e instanceof Error ? e.message : String(e)}`);
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Load knowledge-engine config with the following priority:
|
|
69
|
+
*
|
|
70
|
+
* 1. Legacy inline config (full config in openclaw.json) → use it directly
|
|
71
|
+
* 2. External file (configPath or default location) → read + resolve
|
|
72
|
+
* 3. Graceful defaults → everything enabled, fail-open
|
|
73
|
+
*
|
|
74
|
+
* NEVER throws. Worst case: returns defaults with a warning.
|
|
75
|
+
*/
|
|
76
|
+
export function loadConfig(pluginConfig, logger) {
|
|
77
|
+
const raw = pluginConfig ?? {};
|
|
78
|
+
// Priority 1: Legacy inline config (backward compatible)
|
|
79
|
+
if (isLegacyInlineConfig(raw)) {
|
|
80
|
+
logger.info("[knowledge-engine] Using inline config from openclaw.json");
|
|
81
|
+
return { config: resolveConfig(raw, logger), source: "inline" };
|
|
82
|
+
}
|
|
83
|
+
// Priority 2: External config file
|
|
84
|
+
const configPath = typeof raw["configPath"] === "string"
|
|
85
|
+
? raw["configPath"]
|
|
86
|
+
: join(DEFAULT_CONFIG_DIR, DEFAULT_CONFIG_FILENAME);
|
|
87
|
+
const fileConfig = readJsonFile(configPath, logger);
|
|
88
|
+
if (fileConfig !== null) {
|
|
89
|
+
const merged = applyInlineOverrides(fileConfig, raw);
|
|
90
|
+
logger.info(`[knowledge-engine] Loaded config from ${configPath}`);
|
|
91
|
+
return { config: resolveConfig(merged, logger), source: "file", filePath: configPath };
|
|
92
|
+
}
|
|
93
|
+
// File missing → bootstrap with defaults
|
|
94
|
+
if (!existsSync(configPath)) {
|
|
95
|
+
const bootstrapped = bootstrapConfig(configPath, logger);
|
|
96
|
+
if (bootstrapped !== null) {
|
|
97
|
+
const merged = applyInlineOverrides(bootstrapped, raw);
|
|
98
|
+
return { config: resolveConfig(merged, logger), source: "file", filePath: configPath };
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// Priority 3: Graceful defaults (file broken or unwritable)
|
|
102
|
+
logger.warn("[knowledge-engine] Falling back to default config");
|
|
103
|
+
return { config: resolveConfig(undefined, logger), source: "defaults" };
|
|
104
|
+
}
|
package/dist/src/config.d.ts
CHANGED
|
@@ -12,4 +12,4 @@ export declare const DEFAULT_CONFIG: Omit<KnowledgeConfig, 'workspace'>;
|
|
|
12
12
|
* @param openClawWorkspace The root workspace directory provided by OpenClaw.
|
|
13
13
|
* @returns A fully resolved KnowledgeConfig, or null if validation fails.
|
|
14
14
|
*/
|
|
15
|
-
export declare function resolveConfig(userConfig: Record<string, unknown
|
|
15
|
+
export declare function resolveConfig(userConfig: Record<string, unknown> | undefined | null, logger: Logger, openClawWorkspace?: string): KnowledgeConfig | null;
|
package/dist/src/config.js
CHANGED
|
@@ -78,8 +78,9 @@ function resolveTilde(ws, logger, fallback) {
|
|
|
78
78
|
* @returns A fully resolved KnowledgeConfig, or null if validation fails.
|
|
79
79
|
*/
|
|
80
80
|
export function resolveConfig(userConfig, logger, openClawWorkspace) {
|
|
81
|
-
const
|
|
82
|
-
const
|
|
81
|
+
const ws = openClawWorkspace ?? process.cwd();
|
|
82
|
+
const config = mergeConfigDefaults(userConfig ?? {}, ws);
|
|
83
|
+
const fallbackWs = path.join(ws, 'knowledge-engine');
|
|
83
84
|
config.workspace = resolveTilde(config.workspace, logger, fallbackWs);
|
|
84
85
|
const errors = validateConfig(config);
|
|
85
86
|
if (errors.length > 0) {
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,123 +1,127 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
2
|
+
"id": "openclaw-knowledge-engine",
|
|
3
|
+
"configSchema": {
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": true,
|
|
6
|
+
"properties": {
|
|
7
|
+
"enabled": {
|
|
8
|
+
"type": "boolean",
|
|
9
|
+
"default": true,
|
|
10
|
+
"description": "Whether the knowledge engine plugin is enabled."
|
|
11
|
+
},
|
|
12
|
+
"workspace": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"default": "~/.clawd/plugins/knowledge-engine",
|
|
15
|
+
"description": "The directory to store knowledge files (entities.json, facts.json)."
|
|
16
|
+
},
|
|
17
|
+
"extraction": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"properties": {
|
|
20
|
+
"regex": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"properties": {
|
|
23
|
+
"enabled": {
|
|
24
|
+
"type": "boolean",
|
|
25
|
+
"default": true,
|
|
26
|
+
"description": "Enable or disable high-speed regex-based entity extraction."
|
|
27
|
+
}
|
|
24
28
|
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
29
|
+
},
|
|
30
|
+
"llm": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"properties": {
|
|
33
|
+
"enabled": {
|
|
34
|
+
"type": "boolean",
|
|
35
|
+
"default": true,
|
|
36
|
+
"description": "Enable or disable high-fidelity LLM-based entity and fact extraction."
|
|
37
|
+
},
|
|
38
|
+
"model": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"default": "mistral:7b",
|
|
41
|
+
"description": "The model name to use for the LLM API call (e.g., Ollama model)."
|
|
42
|
+
},
|
|
43
|
+
"endpoint": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"default": "http://localhost:11434/api/generate",
|
|
46
|
+
"description": "The HTTP endpoint for the LLM generation API."
|
|
47
|
+
},
|
|
48
|
+
"batchSize": {
|
|
49
|
+
"type": "number",
|
|
50
|
+
"default": 10,
|
|
51
|
+
"description": "Number of messages to batch together before sending to the LLM."
|
|
52
|
+
},
|
|
53
|
+
"cooldownMs": {
|
|
54
|
+
"type": "number",
|
|
55
|
+
"default": 30000,
|
|
56
|
+
"description": "Milliseconds to wait after the last message before sending a batch to the LLM."
|
|
57
|
+
}
|
|
54
58
|
}
|
|
55
59
|
}
|
|
56
60
|
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
61
|
+
},
|
|
62
|
+
"decay": {
|
|
63
|
+
"type": "object",
|
|
64
|
+
"properties": {
|
|
65
|
+
"enabled": {
|
|
66
|
+
"type": "boolean",
|
|
67
|
+
"default": true,
|
|
68
|
+
"description": "Enable or disable the periodic decay of fact relevance."
|
|
69
|
+
},
|
|
70
|
+
"intervalHours": {
|
|
71
|
+
"type": "number",
|
|
72
|
+
"default": 24,
|
|
73
|
+
"description": "How often (in hours) to run the decay process."
|
|
74
|
+
},
|
|
75
|
+
"rate": {
|
|
76
|
+
"type": "number",
|
|
77
|
+
"default": 0.02,
|
|
78
|
+
"description": "The percentage of relevance to decay in each interval (e.g., 0.02 is 2%)."
|
|
79
|
+
}
|
|
76
80
|
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
81
|
+
},
|
|
82
|
+
"embeddings": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"properties": {
|
|
85
|
+
"enabled": {
|
|
86
|
+
"type": "boolean",
|
|
87
|
+
"default": false,
|
|
88
|
+
"description": "Enable or disable syncing of facts to a vector database."
|
|
89
|
+
},
|
|
90
|
+
"endpoint": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"default": "http://localhost:8000/api/v1/collections/facts/add",
|
|
93
|
+
"description": "The HTTP endpoint for the vector database's add API (ChromaDB compatible)."
|
|
94
|
+
},
|
|
95
|
+
"collectionName": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"default": "openclaw-facts",
|
|
98
|
+
"description": "The name of the collection to use in the vector database."
|
|
99
|
+
},
|
|
100
|
+
"syncIntervalMinutes": {
|
|
101
|
+
"type": "number",
|
|
102
|
+
"default": 15,
|
|
103
|
+
"description": "How often (in minutes) to sync new facts to the vector database."
|
|
104
|
+
}
|
|
101
105
|
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
106
|
+
},
|
|
107
|
+
"storage": {
|
|
108
|
+
"type": "object",
|
|
109
|
+
"properties": {
|
|
110
|
+
"maxEntities": {
|
|
111
|
+
"type": "number",
|
|
112
|
+
"default": 5000,
|
|
113
|
+
"description": "The maximum number of entities to store before pruning."
|
|
114
|
+
},
|
|
115
|
+
"maxFacts": {
|
|
116
|
+
"type": "number",
|
|
117
|
+
"default": 10000,
|
|
118
|
+
"description": "The maximum number of facts to store before pruning."
|
|
119
|
+
},
|
|
120
|
+
"writeDebounceMs": {
|
|
121
|
+
"type": "number",
|
|
122
|
+
"default": 15000,
|
|
123
|
+
"description": "Milliseconds to wait after a change before writing data to disk."
|
|
124
|
+
}
|
|
121
125
|
}
|
|
122
126
|
}
|
|
123
127
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vainplex/openclaw-knowledge-engine",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "An OpenClaw plugin for real-time and batch knowledge extraction from conversational data.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -17,14 +17,18 @@
|
|
|
17
17
|
"nlp",
|
|
18
18
|
"entity-extraction"
|
|
19
19
|
],
|
|
20
|
-
"author": "
|
|
20
|
+
"author": "Albert Hild <a.hild@vainplex.de>",
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
|
24
|
-
"url": "https://github.com/alberthild/openclaw
|
|
24
|
+
"url": "https://github.com/alberthild/vainplex-openclaw.git",
|
|
25
|
+
"directory": "packages/openclaw-knowledge-engine"
|
|
25
26
|
},
|
|
26
27
|
"openclaw": {
|
|
27
|
-
"id": "
|
|
28
|
+
"id": "openclaw-knowledge-engine",
|
|
29
|
+
"extensions": [
|
|
30
|
+
"./dist/index.js"
|
|
31
|
+
]
|
|
28
32
|
},
|
|
29
33
|
"devDependencies": {
|
|
30
34
|
"@types/node": "^20.11.24",
|
|
@@ -32,5 +36,11 @@
|
|
|
32
36
|
"typescript": "^5.3.3",
|
|
33
37
|
"tsx": "^4.7.1"
|
|
34
38
|
},
|
|
35
|
-
"type": "module"
|
|
39
|
+
"type": "module",
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"openclaw.plugin.json",
|
|
43
|
+
"README.md",
|
|
44
|
+
"LICENSE"
|
|
45
|
+
]
|
|
36
46
|
}
|