@lacneu/openclaw-knowledge 3.1.0

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,149 @@
1
+ {
2
+ "id": "openclaw-knowledge",
3
+ "name": "Knowledge Base",
4
+ "description": "Multi-source knowledge search (pgvector + LightRAG) — injects relevant documents and knowledge graph context before each turn via the before_prompt_build hook",
5
+ "version": "3.1.0",
6
+ "configSchema": {
7
+ "type": "object",
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "enabled": {
11
+ "type": "boolean",
12
+ "default": true,
13
+ "description": "Master switch — disables all knowledge injection when false"
14
+ },
15
+ "geminiApiKey": {
16
+ "type": "string",
17
+ "description": "Gemini API key used to embed user queries for pgvector search. Supports ${ENV_VAR} substitution."
18
+ },
19
+ "postgresUrl": {
20
+ "type": "string",
21
+ "description": "PostgreSQL connection string for the knowledge database (pgvector). Supports ${ENV_VAR} substitution."
22
+ },
23
+ "collections": {
24
+ "type": "array",
25
+ "items": { "type": "string" },
26
+ "default": ["knowledge_default"],
27
+ "description": "Collection names to search in the knowledge_vectors table"
28
+ },
29
+ "topK": {
30
+ "type": "number",
31
+ "minimum": 1,
32
+ "maximum": 100,
33
+ "default": 5,
34
+ "description": "Maximum number of results returned per collection"
35
+ },
36
+ "scoreThreshold": {
37
+ "type": "number",
38
+ "minimum": 0,
39
+ "maximum": 1,
40
+ "default": 0.3,
41
+ "description": "Minimum cosine similarity score (0–1) to include a result"
42
+ },
43
+ "maxInjectChars": {
44
+ "type": "number",
45
+ "minimum": 0,
46
+ "default": 4000,
47
+ "description": "Character budget for pgvector results injected into the prompt"
48
+ },
49
+ "pgvectorEnabled": {
50
+ "type": "boolean",
51
+ "description": "Disable pgvector search while keeping LightRAG. Defaults to true when geminiApiKey is set."
52
+ },
53
+ "lightragUrl": {
54
+ "type": "string",
55
+ "description": "LightRAG server base URL (e.g. http://openclaw-lightrag:9621). Supports ${ENV_VAR} substitution."
56
+ },
57
+ "lightragApiKey": {
58
+ "type": "string",
59
+ "description": "LightRAG API key sent as X-API-Key header. Supports ${ENV_VAR} substitution."
60
+ },
61
+ "lightragQueryMode": {
62
+ "type": "string",
63
+ "enum": ["naive", "local", "global", "hybrid"],
64
+ "default": "hybrid",
65
+ "description": "LightRAG query mode: naive (vector), local (entity), global (community), hybrid (recommended)"
66
+ },
67
+ "lightragMaxChars": {
68
+ "type": "number",
69
+ "minimum": 0,
70
+ "default": 4000,
71
+ "description": "Character budget for LightRAG context injected into the prompt"
72
+ },
73
+ "lightragEnabled": {
74
+ "type": "boolean",
75
+ "description": "Disable LightRAG search while keeping pgvector. Defaults to true when lightragUrl is set."
76
+ }
77
+ },
78
+ "required": []
79
+ },
80
+ "uiHints": {
81
+ "enabled": {
82
+ "label": "Auto-inject knowledge",
83
+ "help": "Automatically search and inject relevant documents before each agent turn"
84
+ },
85
+ "geminiApiKey": {
86
+ "label": "Gemini API Key",
87
+ "placeholder": "${GEMINI_API_KEY}",
88
+ "sensitive": true,
89
+ "help": "Required for pgvector search. Use ${GEMINI_API_KEY} for env var substitution."
90
+ },
91
+ "postgresUrl": {
92
+ "label": "PostgreSQL URL",
93
+ "placeholder": "postgresql://openclaw:${POSTGRES_PASSWORD}@postgresql:5432/knowledge",
94
+ "sensitive": true,
95
+ "help": "Connection string for the knowledge database. Supports ${ENV_VAR} substitution."
96
+ },
97
+ "collections": {
98
+ "label": "Collections to search",
99
+ "placeholder": "knowledge_default",
100
+ "help": "Collection names in the knowledge_vectors table (e.g. knowledge_olivier, knowledge_shared)"
101
+ },
102
+ "topK": {
103
+ "label": "Top-K per collection",
104
+ "advanced": true,
105
+ "help": "Maximum number of results returned per collection (default: 5)"
106
+ },
107
+ "scoreThreshold": {
108
+ "label": "Score threshold",
109
+ "advanced": true,
110
+ "help": "Minimum cosine similarity 0–1 to include a result (default: 0.3)"
111
+ },
112
+ "maxInjectChars": {
113
+ "label": "Max pgvector chars",
114
+ "advanced": true,
115
+ "help": "Character budget for pgvector results (default: 4000)"
116
+ },
117
+ "pgvectorEnabled": {
118
+ "label": "Enable pgvector source",
119
+ "advanced": true,
120
+ "help": "Disable pgvector while keeping LightRAG. Defaults to true when geminiApiKey is set."
121
+ },
122
+ "lightragUrl": {
123
+ "label": "LightRAG URL",
124
+ "placeholder": "http://openclaw-lightrag:9621",
125
+ "help": "LightRAG server base URL"
126
+ },
127
+ "lightragApiKey": {
128
+ "label": "LightRAG API Key",
129
+ "placeholder": "${LIGHTRAG_API_KEY}",
130
+ "sensitive": true,
131
+ "help": "Sent as X-API-Key header. Use ${LIGHTRAG_API_KEY} for env var substitution."
132
+ },
133
+ "lightragQueryMode": {
134
+ "label": "LightRAG Query Mode",
135
+ "advanced": true,
136
+ "help": "naive (vector), local (entity), global (community), hybrid (recommended)"
137
+ },
138
+ "lightragMaxChars": {
139
+ "label": "Max LightRAG chars",
140
+ "advanced": true,
141
+ "help": "Character budget for LightRAG context (default: 4000)"
142
+ },
143
+ "lightragEnabled": {
144
+ "label": "Enable LightRAG source",
145
+ "advanced": true,
146
+ "help": "Disable LightRAG while keeping pgvector. Defaults to true when lightragUrl is set."
147
+ }
148
+ }
149
+ }
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "@lacneu/openclaw-knowledge",
3
+ "version": "3.1.0",
4
+ "type": "module",
5
+ "description": "Multi-source knowledge plugin for OpenClaw — pgvector + LightRAG injection via before_prompt_build hook",
6
+ "license": "MIT",
7
+ "author": "Olivier Neu",
8
+ "homepage": "https://github.com/OlivierNeu/openclaw-knowledge-plugin#readme",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/OlivierNeu/openclaw-knowledge-plugin.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/OlivierNeu/openclaw-knowledge-plugin/issues"
15
+ },
16
+ "keywords": [
17
+ "openclaw",
18
+ "openclaw-plugin",
19
+ "rag",
20
+ "pgvector",
21
+ "lightrag",
22
+ "knowledge-graph",
23
+ "gemini",
24
+ "embeddings"
25
+ ],
26
+ "main": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
+ "files": [
29
+ "dist",
30
+ "openclaw.plugin.json",
31
+ "README.md",
32
+ "CHANGELOG.md",
33
+ "LICENSE"
34
+ ],
35
+ "publishConfig": {
36
+ "access": "public"
37
+ },
38
+ "scripts": {
39
+ "build": "tsc -p tsconfig.json",
40
+ "build:test": "tsc -p tsconfig.test-build.json",
41
+ "clean": "rm -rf dist dist-test",
42
+ "typecheck": "tsc -p tsconfig.test.json",
43
+ "test": "npm run build:test && node --test dist-test/test/*.test.js",
44
+ "prepublishOnly": "npm run clean && npm run build"
45
+ },
46
+ "openclaw": {
47
+ "extensions": ["./dist/index.js"],
48
+ "compat": {
49
+ "pluginApi": ">=2026.3.7",
50
+ "minGatewayVersion": "2026.3.7"
51
+ }
52
+ },
53
+ "dependencies": {
54
+ "pg": "^8.13.0"
55
+ },
56
+ "devDependencies": {
57
+ "@types/node": "^22.0.0",
58
+ "@types/pg": "^8.11.0",
59
+ "openclaw": ">=2026.3.7",
60
+ "typescript": "^5.6.0"
61
+ },
62
+ "peerDependencies": {
63
+ "openclaw": ">=2026.3.7"
64
+ },
65
+ "peerDependenciesMeta": {
66
+ "openclaw": {
67
+ "optional": true
68
+ }
69
+ }
70
+ }