nodebb-plugin-integration 0.3.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.
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sergey-ek
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies
10
+ of the Software, and to permit persons to whom the Software is furnished to do
11
+ so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,320 @@
1
+ # NodeBB Integration Layer
2
+
3
+ AI integration layer for NodeBB forums with MCP, semantic search, RAG pipeline and Qdrant vector storage.
4
+
5
+ ![Node.js](https://img.shields.io/badge/node-%3E%3D20-green)
6
+ ![Tests](https://github.com/Sergey-ek/nodebb-plugin-integration/actions/workflows/test.yml/badge.svg)
7
+ ![License](https://img.shields.io/badge/license-MIT-blue)
8
+
9
+ ## Features
10
+
11
+ * NodeBB integration adapter
12
+ * MCP (Model Context Protocol) server
13
+ * Semantic search
14
+ * RAG knowledge pipeline
15
+ * Qdrant vector database support
16
+ * OpenAI embeddings support
17
+ * Fake embeddings for local development
18
+ * Standalone development mode
19
+ * Automated tests with GitHub Actions
20
+
21
+ ## Architecture
22
+
23
+ ```
24
+ NodeBB
25
+
26
+ |
27
+ |
28
+
29
+ Integration Layer
30
+
31
+ |
32
+ +-------------+-------------+
33
+
34
+ | |
35
+
36
+ MCP AI
37
+
38
+ | |
39
+
40
+ Tools API Embeddings
41
+
42
+ |
43
+
44
+ Qdrant
45
+
46
+ |
47
+
48
+ Knowledge Base
49
+ ```
50
+
51
+ ## Requirements
52
+
53
+ * Node.js >= 20
54
+ * npm >= 10
55
+
56
+ Optional:
57
+
58
+ * NodeBB
59
+ * Redis
60
+ * Qdrant
61
+ * OpenAI API key
62
+
63
+ ## Installation
64
+
65
+ Clone repository:
66
+
67
+ ```bash
68
+ git clone https://github.com/Sergey-ek/nodebb-plugin-integration.git
69
+
70
+ cd nodebb-plugin-integration
71
+ ```
72
+
73
+ Install dependencies:
74
+
75
+ ```bash
76
+ npm install
77
+ ```
78
+
79
+ Create environment file:
80
+
81
+ ```bash
82
+ cp .env.example .env
83
+ ```
84
+
85
+ ## Development mode
86
+
87
+ By default the project uses fake embeddings:
88
+
89
+ ```
90
+ AI_PROVIDER=fake
91
+ ```
92
+
93
+ This allows running tests without:
94
+
95
+ * OpenAI
96
+ * Qdrant
97
+ * NodeBB
98
+
99
+ Run diagnostics:
100
+
101
+ ```bash
102
+ npm run diagnose
103
+ ```
104
+
105
+ Example:
106
+
107
+ ```
108
+ {
109
+ environment: "development",
110
+ embeddings: {
111
+ provider: "fake",
112
+ size: 1536
113
+ }
114
+ }
115
+ ```
116
+
117
+ ## Testing
118
+
119
+ Syntax check:
120
+
121
+ ```bash
122
+ npm run check
123
+ ```
124
+
125
+ Run tests:
126
+
127
+ ```bash
128
+ npm test
129
+ ```
130
+
131
+ Expected:
132
+
133
+ ```
134
+ 8 passing
135
+ ```
136
+
137
+ ## NodeBB Integration
138
+
139
+ Configure:
140
+
141
+ ```
142
+ NODEBB_URL=http://localhost:4567
143
+
144
+ NODEBB_API_KEY=your_token
145
+ ```
146
+
147
+ When running inside NodeBB, the plugin uses native NodeBB modules.
148
+
149
+ Standalone mode provides safe fallback adapters.
150
+
151
+ ## AI Pipeline
152
+
153
+ Flow:
154
+
155
+ ```
156
+ Forum post
157
+
158
+ |
159
+
160
+ Embedding generation
161
+
162
+ |
163
+
164
+ Vector storage
165
+
166
+ |
167
+
168
+ Qdrant similarity search
169
+
170
+ |
171
+
172
+ Knowledge retrieval
173
+
174
+ |
175
+
176
+ AI response
177
+ ```
178
+
179
+ Supported providers:
180
+
181
+ ### Fake
182
+
183
+ Development mode:
184
+
185
+ ```
186
+ AI_PROVIDER=fake
187
+ ```
188
+
189
+ ### OpenAI
190
+
191
+ Production mode:
192
+
193
+ ```
194
+ AI_PROVIDER=openai
195
+
196
+ OPENAI_API_KEY=your_key
197
+ ```
198
+
199
+ ## Qdrant
200
+
201
+ Configure:
202
+
203
+ ```
204
+ QDRANT_URL=http://localhost:6333
205
+
206
+ QDRANT_COLLECTION=nodebb_knowledge
207
+ ```
208
+
209
+ The system automatically:
210
+
211
+ * checks collection;
212
+ * creates collection;
213
+ * stores vectors;
214
+ * performs similarity search.
215
+
216
+ ## MCP Server
217
+
218
+ Start MCP:
219
+
220
+ ```bash
221
+ npm run mcp
222
+ ```
223
+
224
+ Available tools:
225
+
226
+ ```
227
+ get_forum_info
228
+
229
+ get_post
230
+
231
+ get_topic
232
+
233
+ get_user
234
+
235
+ search_knowledge
236
+ ```
237
+
238
+ Example:
239
+
240
+ ```
241
+ search_knowledge
242
+
243
+ {
244
+ "query": "installation guide",
245
+ "limit": 5
246
+ }
247
+ ```
248
+
249
+ ## Project Structure
250
+
251
+ ```
252
+ .
253
+ ├── library.js
254
+
255
+ ├── package.json
256
+
257
+ ├── plugin.json
258
+
259
+ ├── src
260
+
261
+ │ ├── ai
262
+
263
+ │ │ ├── embeddings.js
264
+
265
+ │ │ ├── openai.js
266
+
267
+ │ │ ├── qdrant.js
268
+
269
+ │ │ ├── indexer.js
270
+
271
+ │ │ └── search.js
272
+
273
+ │ │
274
+
275
+ │ ├── mcp
276
+
277
+ │ │ ├── server.js
278
+
279
+ │ │ └── tools.js
280
+
281
+ │ │
282
+
283
+ │ ├── nodebb
284
+
285
+ │ │ ├── meta.js
286
+
287
+ │ │ ├── posts.js
288
+
289
+ │ │ ├── topics.js
290
+
291
+ │ │ └── users.js
292
+
293
+ │ │
294
+
295
+ │ └── config
296
+
297
+ │ └── index.js
298
+
299
+ │
300
+
301
+ └── test
302
+
303
+ └── plugin.test.js
304
+ ```
305
+
306
+ ## Security
307
+
308
+ Never commit:
309
+
310
+ ```
311
+ .env
312
+
313
+ OPENAI_API_KEY
314
+
315
+ NODEBB_API_KEY
316
+ ```
317
+
318
+ ## License
319
+
320
+ MIT
package/README.ru.md ADDED
@@ -0,0 +1,347 @@
1
+ # NodeBB Integration Layer
2
+
3
+ AI-слой интеграции для форумов NodeBB с поддержкой MCP, семантического поиска, RAG pipeline и векторного хранилища Qdrant.
4
+
5
+ ## Возможности
6
+
7
+ * Интеграция с NodeBB
8
+ * MCP (Model Context Protocol) сервер
9
+ * Семантический поиск по содержимому форума
10
+ * RAG pipeline (Retrieval Augmented Generation)
11
+ * Поддержка Qdrant Vector Database
12
+ * Поддержка OpenAI Embeddings
13
+ * Локальный режим с fake embeddings
14
+ * Работа без NodeBB для разработки
15
+ * Автоматические тесты через GitHub Actions
16
+
17
+ # Архитектура
18
+
19
+ ```
20
+ NodeBB
21
+
22
+ |
23
+ |
24
+
25
+ Integration Layer
26
+
27
+ |
28
+
29
+ +------------+------------+
30
+
31
+ | |
32
+
33
+ MCP AI
34
+
35
+ | |
36
+
37
+ Tools API Embeddings
38
+
39
+ |
40
+
41
+ Qdrant
42
+
43
+ |
44
+
45
+ Knowledge Base
46
+ ```
47
+
48
+ # Требования
49
+
50
+ Минимально:
51
+
52
+ * Node.js >= 20
53
+ * npm >= 10
54
+
55
+ Опционально:
56
+
57
+ * NodeBB
58
+ * Redis
59
+ * Qdrant
60
+ * OpenAI API
61
+
62
+ # Установка
63
+
64
+ Клонирование:
65
+
66
+ ```bash
67
+ git clone https://github.com/Sergey-ek/nodebb-plugin-integration.git
68
+
69
+ cd nodebb-plugin-integration
70
+ ```
71
+
72
+ Установка зависимостей:
73
+
74
+ ```bash
75
+ npm install
76
+ ```
77
+
78
+ Создание конфигурации:
79
+
80
+ ```bash
81
+ cp .env.example .env
82
+ ```
83
+
84
+ # Режим разработки
85
+
86
+ По умолчанию используется локальный генератор векторов:
87
+
88
+ ```
89
+ AI_PROVIDER=fake
90
+ ```
91
+
92
+ Этот режим позволяет запускать проект без:
93
+
94
+ * OpenAI API
95
+ * Qdrant
96
+ * NodeBB
97
+
98
+ Проверка конфигурации:
99
+
100
+ ```bash
101
+ npm run diagnose
102
+ ```
103
+
104
+ Пример:
105
+
106
+ ```
107
+ {
108
+ environment: "development",
109
+
110
+ embeddings:
111
+ {
112
+ provider: "fake",
113
+ size: 1536
114
+ }
115
+ }
116
+ ```
117
+
118
+ # Тестирование
119
+
120
+ Проверка синтаксиса:
121
+
122
+ ```bash
123
+ npm run check
124
+ ```
125
+
126
+ Запуск тестов:
127
+
128
+ ```bash
129
+ npm test
130
+ ```
131
+
132
+ Ожидаемый результат:
133
+
134
+ ```
135
+ 8 passing
136
+ ```
137
+
138
+ # Интеграция с NodeBB
139
+
140
+ Настройка:
141
+
142
+ ```
143
+ NODEBB_URL=http://localhost:4567
144
+
145
+ NODEBB_API_KEY=your_token
146
+ ```
147
+
148
+ При работе внутри NodeBB используются оригинальные модули NodeBB.
149
+
150
+ В standalone режиме используются безопасные адаптеры:
151
+
152
+ ```
153
+ NodeBB отсутствует
154
+
155
+ |
156
+
157
+ Fallback adapter
158
+
159
+ |
160
+
161
+ Тесты продолжают работать
162
+ ```
163
+
164
+ # AI Pipeline
165
+
166
+ Полный поток:
167
+
168
+ ```
169
+ Сообщение форума
170
+
171
+ |
172
+
173
+ Создание embedding
174
+
175
+ |
176
+
177
+ Сохранение vector
178
+
179
+ |
180
+
181
+ Qdrant similarity search
182
+
183
+ |
184
+
185
+ Получение контекста
186
+
187
+ |
188
+
189
+ AI ответ
190
+ ```
191
+
192
+ # Embeddings
193
+
194
+ ## Fake режим
195
+
196
+ Для разработки:
197
+
198
+ ```
199
+ AI_PROVIDER=fake
200
+ ```
201
+
202
+ Плюсы:
203
+
204
+ * бесплатно;
205
+ * быстро;
206
+ * не требует сети;
207
+ * используется в тестах.
208
+
209
+ ## OpenAI режим
210
+
211
+ Настройка:
212
+
213
+ ```
214
+ AI_PROVIDER=openai
215
+
216
+ OPENAI_API_KEY=your_key
217
+ ```
218
+
219
+ # Qdrant
220
+
221
+ Конфигурация:
222
+
223
+ ```
224
+ QDRANT_URL=http://localhost:6333
225
+
226
+ QDRANT_COLLECTION=nodebb_knowledge
227
+ ```
228
+
229
+ Автоматически выполняется:
230
+
231
+ * проверка коллекции;
232
+ * создание коллекции;
233
+ * загрузка векторов;
234
+ * поиск похожих документов.
235
+
236
+ # MCP сервер
237
+
238
+ Запуск:
239
+
240
+ ```bash
241
+ npm run mcp
242
+ ```
243
+
244
+ Доступные инструменты:
245
+
246
+ ```
247
+ get_forum_info
248
+
249
+ get_post
250
+
251
+ get_topic
252
+
253
+ get_user
254
+
255
+ search_knowledge
256
+ ```
257
+
258
+ Пример поиска:
259
+
260
+ ```
261
+ search_knowledge
262
+
263
+ {
264
+ "query": "как установить NodeBB",
265
+ "limit": 5
266
+ }
267
+ ```
268
+
269
+ # Структура проекта
270
+
271
+ ```
272
+ .
273
+
274
+ ├── library.js
275
+
276
+ ├── package.json
277
+
278
+ ├── plugin.json
279
+
280
+
281
+ ├── src
282
+
283
+ │
284
+
285
+ ├── ai
286
+
287
+ │ ├── embeddings.js
288
+
289
+ │ ├── openai.js
290
+
291
+ │ ├── qdrant.js
292
+
293
+ │ ├── indexer.js
294
+
295
+ │ └── search.js
296
+
297
+
298
+ │
299
+
300
+ ├── mcp
301
+
302
+ │ ├── server.js
303
+
304
+ │ └── tools.js
305
+
306
+
307
+ │
308
+
309
+ ├── nodebb
310
+
311
+ │ ├── meta.js
312
+
313
+ │ ├── posts.js
314
+
315
+ │ ├── topics.js
316
+
317
+ │ └── users.js
318
+
319
+
320
+ │
321
+
322
+ └── config
323
+
324
+ └── index.js
325
+
326
+
327
+ └── test
328
+
329
+ └── plugin.test.js
330
+ ```
331
+
332
+ # Безопасность
333
+
334
+ Не добавлять в Git:
335
+
336
+ ```
337
+ .env
338
+
339
+ OPENAI_API_KEY
340
+
341
+ NODEBB_API_KEY
342
+
343
+ ```
344
+
345
+ # Лицензия
346
+
347
+ MIT