morpheus-cli 0.3.3 → 0.3.6
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/README.md +1010 -999
- package/bin/morpheus.js +48 -48
- package/dist/channels/telegram.js +34 -29
- package/dist/cli/commands/start.js +41 -3
- package/dist/runtime/lifecycle.js +13 -0
- package/dist/runtime/memory/backfill-embeddings.js +12 -12
- package/dist/runtime/memory/sati/index.js +5 -5
- package/dist/runtime/memory/sati/repository.js +186 -186
- package/dist/runtime/memory/sati/system-prompts.js +52 -52
- package/dist/runtime/memory/session-embedding-worker.js +32 -32
- package/dist/runtime/memory/sqlite.js +151 -151
- package/dist/runtime/oracle.js +116 -116
- package/dist/runtime/tools/analytics-tools.js +12 -12
- package/dist/ui/index.html +13 -2
- package/dist/ui/manifest.webmanifest +1 -0
- package/dist/ui/pwa-192x192.png +0 -0
- package/dist/ui/pwa-512x512.png +0 -0
- package/dist/ui/pwa-maskable-192x192.png +0 -0
- package/dist/ui/pwa-maskable-512x512.png +0 -0
- package/dist/ui/registerSW.js +1 -0
- package/dist/ui/sw.js +1 -0
- package/dist/ui/vite.svg +31 -31
- package/dist/ui/workbox-26f462e7.js +1 -0
- package/package.json +84 -84
- package/dist/http/__tests__/status_api.test.js +0 -55
- package/dist/http/__tests__/status_with_server_api.test.js +0 -60
- package/dist/runtime/__tests__/agent.test.js +0 -95
- package/dist/runtime/__tests__/agent_memory_limit.test.js +0 -61
- package/dist/runtime/__tests__/agent_persistence.test.js +0 -154
- package/dist/runtime/__tests__/manual_santi_verify.js +0 -55
- package/dist/runtime/agent.js +0 -172
- package/dist/runtime/audio-agent.js +0 -55
- package/dist/runtime/santi/contracts.js +0 -1
- package/dist/runtime/santi/middleware.js +0 -61
- package/dist/runtime/santi/santi.js +0 -109
- package/dist/runtime/santi/store.js +0 -158
- package/dist/runtime/tools/__tests__/factory.test.js +0 -42
package/README.md
CHANGED
|
@@ -1,999 +1,1010 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
<img src="./assets/logo.png" alt="Morpheus Logo" width="220" />
|
|
3
|
-
</div>
|
|
4
|
-
|
|
5
|
-
# Morpheus
|
|
6
|
-
|
|
7
|
-
> **Morpheus is a local-first AI operator that bridges developers and machines.**
|
|
8
|
-
|
|
9
|
-
Morpheus is a local AI agent for developers, running as a CLI daemon that connects to **LLMs**, **local tools**, and **MCPs**, enabling interaction via **Terminal, Telegram, and Discord**. Inspired by the character Morpheus from *The Matrix*, the project acts as an **intelligent orchestrator**, bridging the gap between the developer and complex systems.
|
|
10
|
-
|
|
11
|
-
## Installation
|
|
12
|
-
|
|
13
|
-
Install Morpheus globally via npm:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install -g morpheus-cli
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Quick Start
|
|
20
|
-
|
|
21
|
-
### 1. Initialize
|
|
22
|
-
|
|
23
|
-
Set up your configuration (API keys, preferences):
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
morpheus init
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
### 2. Start the Agent
|
|
30
|
-
|
|
31
|
-
Run the background daemon and Web UI:
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
morpheus start
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
This will:
|
|
38
|
-
- Start the agent process
|
|
39
|
-
- Launch the Web UI at http://localhost:3333
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
##
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
##
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
-
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
|
127
|
-
|
|
128
|
-
| `
|
|
129
|
-
| `
|
|
130
|
-
| `
|
|
131
|
-
| `
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
|
138
|
-
|
|
139
|
-
| `
|
|
140
|
-
| `
|
|
141
|
-
| `
|
|
142
|
-
| `
|
|
143
|
-
| `
|
|
144
|
-
| `
|
|
145
|
-
| `
|
|
146
|
-
| `
|
|
147
|
-
| `
|
|
148
|
-
| `
|
|
149
|
-
| `
|
|
150
|
-
| `
|
|
151
|
-
| `
|
|
152
|
-
| `
|
|
153
|
-
| `
|
|
154
|
-
| `
|
|
155
|
-
| `
|
|
156
|
-
| `
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
OPENAI_API_KEY
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
-
|
|
203
|
-
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
-
|
|
249
|
-
-
|
|
250
|
-
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
#
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
"
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
"
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
```
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
* **
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
"
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
"
|
|
445
|
-
"
|
|
446
|
-
"
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
"
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
"
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
"
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
"
|
|
491
|
-
"
|
|
492
|
-
"
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
"
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
"
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
"
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
"
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
* **Response:**
|
|
554
|
-
```json
|
|
555
|
-
{
|
|
556
|
-
"success": true
|
|
557
|
-
}
|
|
558
|
-
```
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
"
|
|
595
|
-
"
|
|
596
|
-
"
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
"
|
|
623
|
-
"
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
* **
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
"
|
|
649
|
-
}
|
|
650
|
-
```
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
"
|
|
687
|
-
"
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
* **
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
"
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
* **
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
* **
|
|
761
|
-
* **
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
```
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
-
|
|
923
|
-
|
|
924
|
-
-
|
|
925
|
-
|
|
926
|
-
#
|
|
927
|
-
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
-
|
|
935
|
-
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
```
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
```
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
```
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="./assets/logo.png" alt="Morpheus Logo" width="220" />
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
# Morpheus
|
|
6
|
+
|
|
7
|
+
> **Morpheus is a local-first AI operator that bridges developers and machines.**
|
|
8
|
+
|
|
9
|
+
Morpheus is a local AI agent for developers, running as a CLI daemon that connects to **LLMs**, **local tools**, and **MCPs**, enabling interaction via **Terminal, Telegram, and Discord**. Inspired by the character Morpheus from *The Matrix*, the project acts as an **intelligent orchestrator**, bridging the gap between the developer and complex systems.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
Install Morpheus globally via npm:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g morpheus-cli
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
### 1. Initialize
|
|
22
|
+
|
|
23
|
+
Set up your configuration (API keys, preferences):
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
morpheus init
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### 2. Start the Agent
|
|
30
|
+
|
|
31
|
+
Run the background daemon and Web UI:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
morpheus start
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
This will:
|
|
38
|
+
- Start the agent process
|
|
39
|
+
- Launch the Web UI at http://localhost:3333
|
|
40
|
+
- If an instance is already running, prompt whether to stop it and start a new one
|
|
41
|
+
|
|
42
|
+
#### Auto-approve restart
|
|
43
|
+
|
|
44
|
+
If you want to automatically stop any running instance and start a new one without prompting:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
morpheus start -y
|
|
48
|
+
# or
|
|
49
|
+
morpheus start --yes
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Other Commands
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Check if Morpheus is running
|
|
56
|
+
morpheus status
|
|
57
|
+
|
|
58
|
+
# Stop the agent
|
|
59
|
+
morpheus stop
|
|
60
|
+
|
|
61
|
+
# Restart the agent
|
|
62
|
+
morpheus restart
|
|
63
|
+
|
|
64
|
+
# Diagnose issues
|
|
65
|
+
morpheus doctor
|
|
66
|
+
|
|
67
|
+
# Manage sessions
|
|
68
|
+
morpheus session new # Archive current and start new
|
|
69
|
+
morpheus session status # Check current session info
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Troubleshooting
|
|
73
|
+
|
|
74
|
+
### Command not found
|
|
75
|
+
|
|
76
|
+
If you installed successfully but can't run the `morpheus` command:
|
|
77
|
+
|
|
78
|
+
1. **Check your PATH**: Ensure your global npm bin directory is in your system PATH.
|
|
79
|
+
- Run `npm bin -g` to see the folder.
|
|
80
|
+
- On Windows, this is usually `%APPDATA%\npm`.
|
|
81
|
+
- On Linux/Mac, verify `echo $PATH`.
|
|
82
|
+
2. **Restart Terminal**: New installations might not be visible until you restart your shell.
|
|
83
|
+
|
|
84
|
+
## Using NPX
|
|
85
|
+
You can run Morpheus without installing it globally using `npx`:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
|
|
89
|
+
npx morpheus-cli init
|
|
90
|
+
|
|
91
|
+
npx morpheus-cli start
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Technical Overview
|
|
96
|
+
|
|
97
|
+
Morpheus is built with **Node.js** and **TypeScript**, using **LangChain** as the orchestration engine. It runs as a background daemon process, managing connections to LLM providers (OpenAI, Anthropic, Ollama) and external channels (Telegram, Discord).
|
|
98
|
+
|
|
99
|
+
### Core Components
|
|
100
|
+
|
|
101
|
+
- **Runtime (`src/runtime/`)**: The heart of the application. Manages the Oracle (agent) lifecycle, provider instantiation, and command execution.
|
|
102
|
+
- **CLI (`src/cli/`)**: Built with `commander`, handles user interaction, configuration, and daemon control (`start`, `stop`, `status`).
|
|
103
|
+
- **Configuration (`src/config/`)**: Singleton-based configuration manager using `zod` for validation and `js-yaml` for persistence (`~/.morpheus/zaion.yaml`).
|
|
104
|
+
- **Channels (`src/channels/`)**: Adapters for external communication. Currently supports Telegram (`telegraf`) with strict user whitelisting.
|
|
105
|
+
|
|
106
|
+
## Features
|
|
107
|
+
|
|
108
|
+
### 🖥️ Web Dashboard
|
|
109
|
+
Local React-based UI to manage recordings, chat history, and system status across your agent instances.
|
|
110
|
+
|
|
111
|
+
**New: Interactive Web Chat**
|
|
112
|
+
- Full-featured chat interface accessible from the browser
|
|
113
|
+
- Session management: create, archive, delete, and rename sessions
|
|
114
|
+
- Cross-channel visibility: view and interact with sessions started on any channel (Telegram, Web, etc.)
|
|
115
|
+
- Real-time messaging with the Oracle agent
|
|
116
|
+
- Responsive design with collapsible sidebar
|
|
117
|
+
- Full support for Light and Dark (Matrix) themes
|
|
118
|
+
|
|
119
|
+
#### 🔒 UI Authentication
|
|
120
|
+
To protect your Web UI, use the `THE_ARCHITECT_PASS` environment variable. This ensures only authorized users can access the dashboard and API.
|
|
121
|
+
|
|
122
|
+
Additionally, you can use environment variables for API keys instead of storing them in the configuration file:
|
|
123
|
+
|
|
124
|
+
| Variable | Description | Required |
|
|
125
|
+
|----------|-------------|----------|
|
|
126
|
+
| `OPENAI_API_KEY` | OpenAI API key (if using GPT) | No |
|
|
127
|
+
| `ANTHROPIC_API_KEY` | Anthropic API key (if using Claude) | No |
|
|
128
|
+
| `GOOGLE_API_KEY` | Google AI key (for Gemini LLM/Audio) | No |
|
|
129
|
+
| `OPENROUTER_API_KEY` | OpenRouter API key (if using OpenRouter) | No |
|
|
130
|
+
| `THE_ARCHITECT_PASS` | Web Dashboard access password | Recommended |
|
|
131
|
+
| `TELEGRAM_BOT_TOKEN` | Telegram BotFather token | No |
|
|
132
|
+
|
|
133
|
+
If these environment variables are set, they will take precedence over values stored in the configuration file.
|
|
134
|
+
|
|
135
|
+
The system also supports generic environment variables that apply to all providers:
|
|
136
|
+
|
|
137
|
+
| Variable | Description | Applies To |
|
|
138
|
+
|----------|-------------|------------|
|
|
139
|
+
| `MORPHEUS_AGENT_NAME` | Name of the agent | agent.name |
|
|
140
|
+
| `MORPHEUS_AGENT_PERSONALITY` | Personality of the agent | agent.personality |
|
|
141
|
+
| `MORPHEUS_LLM_PROVIDER` | LLM provider to use | llm.provider |
|
|
142
|
+
| `MORPHEUS_LLM_MODEL` | Model name for LLM | llm.model |
|
|
143
|
+
| `MORPHEUS_LLM_TEMPERATURE` | Temperature setting for LLM | llm.temperature |
|
|
144
|
+
| `MORPHEUS_LLM_MAX_TOKENS` | Maximum tokens for LLM | llm.max_tokens |
|
|
145
|
+
| `MORPHEUS_LLM_CONTEXT_WINDOW` | Context window size for LLM | llm.context_window |
|
|
146
|
+
| `MORPHEUS_LLM_API_KEY` | Generic API key for LLM (lower precedence than provider-specific keys) | llm.api_key |
|
|
147
|
+
| `MORPHEUS_SATI_PROVIDER` | Sati provider to use | santi.provider |
|
|
148
|
+
| `MORPHEUS_SATI_MODEL` | Model name for Sati | santi.model |
|
|
149
|
+
| `MORPHEUS_SATI_TEMPERATURE` | Temperature setting for Sati | santi.temperature |
|
|
150
|
+
| `MORPHEUS_SATI_MAX_TOKENS` | Maximum tokens for Sati | santi.max_tokens |
|
|
151
|
+
| `MORPHEUS_SATI_CONTEXT_WINDOW` | Context window size for Sati | santi.context_window |
|
|
152
|
+
| `MORPHEUS_SATI_API_KEY` | Generic API key for Sati (lower precedence than provider-specific keys) | santi.api_key |
|
|
153
|
+
| `MORPHEUS_SATI_MEMORY_LIMIT` | Memory retrieval limit for Sati | santi.memory_limit |
|
|
154
|
+
| `MORPHEUS_SATI_MEMORY_LIMIT` | Memory retrieval limit for Sati | santi.memory_limit |
|
|
155
|
+
| `MORPHEUS_SATI_ENABLED_ARCHIVED_SESSIONS`| Enable/disable retrieval of archived sessions in Sati | santi.enableArchivedSessions |
|
|
156
|
+
| `MORPHEUS_AUDIO_MODEL` | Model name for audio processing | audio.model |
|
|
157
|
+
| `MORPHEUS_AUDIO_ENABLED` | Enable/disable audio processing | audio.enabled |
|
|
158
|
+
| `MORPHEUS_AUDIO_API_KEY` | Generic API key for audio (lower precedence than provider-specific keys) | audio.apiKey |
|
|
159
|
+
| `MORPHEUS_AUDIO_MAX_DURATION` | Max duration for audio processing | audio.maxDurationSeconds |
|
|
160
|
+
| `MORPHEUS_TELEGRAM_ENABLED` | Enable/disable Telegram channel | channels.telegram.enabled |
|
|
161
|
+
| `MORPHEUS_TELEGRAM_TOKEN` | Telegram bot token | channels.telegram.token |
|
|
162
|
+
| `MORPHEUS_TELEGRAM_ALLOWED_USERS` | Comma-separated list of allowed Telegram user IDs | channels.telegram.allowedUsers |
|
|
163
|
+
| `MORPHEUS_UI_ENABLED` | Enable/disable Web UI | ui.enabled |
|
|
164
|
+
| `MORPHEUS_UI_PORT` | Port for Web UI | ui.port |
|
|
165
|
+
| `MORPHEUS_LOGGING_ENABLED` | Enable/disable logging | logging.enabled |
|
|
166
|
+
| `MORPHEUS_LOGGING_LEVEL` | Logging level | logging.level |
|
|
167
|
+
| `MORPHEUS_LOGGING_RETENTION` | Log retention period | logging.retention |
|
|
168
|
+
|
|
169
|
+
**Precedence Order**: The system follows this order of precedence when resolving configuration values:
|
|
170
|
+
1. Provider-specific environment variable (e.g., `OPENAI_API_KEY`) - Highest priority
|
|
171
|
+
2. Generic environment variable (e.g., `MORPHEUS_LLM_API_KEY`) - Medium priority
|
|
172
|
+
3. Configuration file value (e.g., `config.llm.api_key`) - Lower priority
|
|
173
|
+
4. Default value - Lowest priority
|
|
174
|
+
|
|
175
|
+
> **Note**: If `THE_ARCHITECT_PASS` is not set, the system will use the default password `iamthearchitect`. This is less secure and it's recommended to set your own password in production environments.
|
|
176
|
+
|
|
177
|
+
**Option 1: Using a `.env` file**
|
|
178
|
+
Create a `.env` file in the root of your project:
|
|
179
|
+
|
|
180
|
+
```env
|
|
181
|
+
OPENAI_API_KEY="your-openai-api-key"
|
|
182
|
+
ANTHROPIC_API_KEY="your-anthropic-api-key"
|
|
183
|
+
GOOGLE_API_KEY="your-google-api-key"
|
|
184
|
+
THE_ARCHITECT_PASS="your-secure-password"
|
|
185
|
+
TELEGRAM_BOT_TOKEN="your-telegram-bot-token"
|
|
186
|
+
OPENROUTER_API_KEY="your-openrouter-api-key"
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Option 2: Using Shell export**
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
export OPENAI_API_KEY="your-openai-api-key"
|
|
193
|
+
export ANTHROPIC_API_KEY="your-anthropic-api-key"
|
|
194
|
+
export GOOGLE_API_KEY="your-google-api-key"
|
|
195
|
+
export OPENROUTER_API_KEY="your-openrouter-api-key"
|
|
196
|
+
export THE_ARCHITECT_PASS="your-secure-password"
|
|
197
|
+
export TELEGRAM_BOT_TOKEN="your-telegram-bot-token"
|
|
198
|
+
morpheus start
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
When enabled:
|
|
202
|
+
- The Web UI will redirect to a Login page.
|
|
203
|
+
- API requests require the `x-architect-pass` header.
|
|
204
|
+
- The session is persisted locally in your browser.
|
|
205
|
+
|
|
206
|
+
### 🧩 MCP Support (Model Context Protocol)
|
|
207
|
+
Full integration with [Model Context Protocol](https://modelcontextprotocol.io/), allowing Morpheus to use standardized tools from any MCP-compatible server.
|
|
208
|
+
|
|
209
|
+
### 🧠 Sati (Long-Term Memory)
|
|
210
|
+
Morpheus features a dedicated middleware system called **Sati** (Mindfulness) that provides long-term memory capabilities.
|
|
211
|
+
- **Automated Storage**: Automatically extracts and saves preferences, project details, and facts from conversations.
|
|
212
|
+
- **Contextual Retrieval**: Injects relevant memories into the context based on your current query.
|
|
213
|
+
- **Data Privacy**: Stored in a local, independent SQLite database (`santi-memory.db`), ensuring sensitive data is handled securely and reducing context window usage.
|
|
214
|
+
- **Memory Management**: View and manage your long-term memories through the Web UI or via API endpoints.
|
|
215
|
+
|
|
216
|
+
### 📊 Usage Analytics
|
|
217
|
+
Track your token usage across different providers and models directly from the Web UI. View detailed breakdowns of input/output tokens and message counts to monitor costs and activity.
|
|
218
|
+
|
|
219
|
+
### 🎙️ Audio Transcription (Telegram)
|
|
220
|
+
Send voice messages directly to the Telegram bot. Morpheus will:
|
|
221
|
+
1. Transcribe the audio using the configured provider.
|
|
222
|
+
2. Process the text as a standard prompt.
|
|
223
|
+
3. Reply with the answer.
|
|
224
|
+
|
|
225
|
+
Supported audio providers:
|
|
226
|
+
|
|
227
|
+
| Provider | Method | Model example |
|
|
228
|
+
|---|---|---|
|
|
229
|
+
| **Google Gemini** | Native audio file upload | `gemini-2.5-flash-lite` |
|
|
230
|
+
| **OpenAI** | Whisper API (`/audio/transcriptions`) | `whisper-1` |
|
|
231
|
+
| **OpenRouter** | `input_audio` via `@openrouter/sdk` (multimodal models) | `google/gemini-2.5-flash` |
|
|
232
|
+
| **Ollama** | Whisper local via OpenAI-compatible endpoint | `whisper` |
|
|
233
|
+
|
|
234
|
+
> Ollama requires a Whisper model loaded: `ollama pull whisper`
|
|
235
|
+
|
|
236
|
+
*Configure `audio.provider` and `audio.apiKey` in Settings or `config.yaml`.*
|
|
237
|
+
|
|
238
|
+
### 🤖 Telegram Commands
|
|
239
|
+
The Morpheus Telegram bot supports several commands for interacting with the agent:
|
|
240
|
+
|
|
241
|
+
- `/start` - Show welcome message and available commands
|
|
242
|
+
- `/status` - Check the status of the Morpheus agent
|
|
243
|
+
- `/doctor` - Diagnose environment and configuration issues
|
|
244
|
+
- `/stats` - Show token usage statistics
|
|
245
|
+
- `/help` - Show available commands
|
|
246
|
+
- `/zaion` - Show system configurations
|
|
247
|
+
- `/sati <qnt>` - Show specific memories
|
|
248
|
+
- `/newsession` - Archive current session and start fresh
|
|
249
|
+
- `/sessions` - List all sessions with options to switch, archive, or delete
|
|
250
|
+
- `/restart` - Restart the Morpheus agent
|
|
251
|
+
- `/mcp` or `/mcps` - List registered MCP servers
|
|
252
|
+
|
|
253
|
+
## Development Setup
|
|
254
|
+
|
|
255
|
+
This guide is for developers contributing to the Morpheus codebase.
|
|
256
|
+
|
|
257
|
+
### Prerequisites
|
|
258
|
+
|
|
259
|
+
- **Node.js**: >= 18.x
|
|
260
|
+
- **npm**: >= 9.x
|
|
261
|
+
- **TypeScript**: >= 5.x
|
|
262
|
+
|
|
263
|
+
### 1. Clone & Install
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
git clone https://github.com/your-org/morpheus.git
|
|
267
|
+
cd morpheus
|
|
268
|
+
npm install
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### 2. Build
|
|
272
|
+
|
|
273
|
+
Compile TypeScript source to `dist/` and build the Web UI.
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
npm run build
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### 3. Run the CLI
|
|
280
|
+
|
|
281
|
+
You can run the CLI directly from the source using `npm start`.
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
# Initialize configuration (creates ~/.morpheus)
|
|
285
|
+
npm start -- init
|
|
286
|
+
|
|
287
|
+
# Start the daemon
|
|
288
|
+
npm start -- start
|
|
289
|
+
|
|
290
|
+
# Check status
|
|
291
|
+
npm start -- status
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### 4. Configuration
|
|
295
|
+
|
|
296
|
+
The configuration file is located at `~/.morpheus/zaion.yaml`. You can edit it manually or use the `morpheus config` command.
|
|
297
|
+
|
|
298
|
+
```yaml
|
|
299
|
+
agent:
|
|
300
|
+
name: "Morpheus"
|
|
301
|
+
personality: "stoic, wise, and helpful"
|
|
302
|
+
llm:
|
|
303
|
+
provider: "openai" # options: openai, anthropic, ollama, gemini
|
|
304
|
+
model: "gpt-4-turbo"
|
|
305
|
+
temperature: 0.7
|
|
306
|
+
context_window: 100 # Number of messages to load into LLM context
|
|
307
|
+
api_key: "sk-..."
|
|
308
|
+
santi: # Optional: Sati (Long-Term Memory) specific settings
|
|
309
|
+
provider: "openai" # defaults to llm.provider
|
|
310
|
+
model: "gpt-4o"
|
|
311
|
+
memory_limit: 1000 # Number of messages/items to retrieve
|
|
312
|
+
channels:
|
|
313
|
+
telegram:
|
|
314
|
+
enabled: true
|
|
315
|
+
token: "YOUR_TELEGRAM_BOT_TOKEN"
|
|
316
|
+
allowedUsers: ["123456789"] # Your Telegram User ID
|
|
317
|
+
discord:
|
|
318
|
+
enabled: false # Coming soon
|
|
319
|
+
|
|
320
|
+
# Web UI Dashboard
|
|
321
|
+
ui:
|
|
322
|
+
enabled: true
|
|
323
|
+
port: 3333
|
|
324
|
+
|
|
325
|
+
# Audio Transcription Support
|
|
326
|
+
audio:
|
|
327
|
+
enabled: true
|
|
328
|
+
provider: "google" # google | openai | openrouter | anthropic | ollama
|
|
329
|
+
model: "gemini-2.5-flash-lite"
|
|
330
|
+
apiKey: "YOUR_API_KEY" # Optional if using same provider as LLM
|
|
331
|
+
base_url: "" # Required for openrouter/ollama
|
|
332
|
+
maxDurationSeconds: 300
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### 5. MCP Configuration
|
|
336
|
+
|
|
337
|
+
Morpheus supports external tools via **MCP (Model Context Protocol)**. Configure your MCP servers in `~/.morpheus/mcps.json`:
|
|
338
|
+
|
|
339
|
+
```json
|
|
340
|
+
{
|
|
341
|
+
"coolify": {
|
|
342
|
+
"transport": "stdio",
|
|
343
|
+
"command": "npx",
|
|
344
|
+
"args": ["-y", "@coolify/mcp-server"],
|
|
345
|
+
"env": {
|
|
346
|
+
"COOLIFY_URL": "https://app.coolify.io",
|
|
347
|
+
"COOLIFY_TOKEN": "your-token"
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
"coingecko": {
|
|
351
|
+
"transport": "http",
|
|
352
|
+
"url": "https://mcps.mnunes.xyz/coingecko/mcp"
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
## API Endpoints
|
|
358
|
+
|
|
359
|
+
Morpheus exposes several API endpoints for programmatic access to its features:
|
|
360
|
+
|
|
361
|
+
### Health Check Endpoints
|
|
362
|
+
|
|
363
|
+
#### GET `/health`
|
|
364
|
+
Public health check endpoint without authentication.
|
|
365
|
+
|
|
366
|
+
* **Response:**
|
|
367
|
+
```json
|
|
368
|
+
{
|
|
369
|
+
"status": "healthy",
|
|
370
|
+
"timestamp": "2026-02-05T21:30:00.000Z",
|
|
371
|
+
"uptime": 123.45
|
|
372
|
+
}
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
#### GET `/api/health`
|
|
376
|
+
Health check endpoint for the API (requires authentication).
|
|
377
|
+
|
|
378
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
379
|
+
* **Response:**
|
|
380
|
+
```json
|
|
381
|
+
{
|
|
382
|
+
"status": "healthy",
|
|
383
|
+
"timestamp": "2026-02-05T21:30:00.000Z",
|
|
384
|
+
"uptime": 123.45
|
|
385
|
+
}
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
### Status Endpoint
|
|
389
|
+
|
|
390
|
+
#### GET `/api/status`
|
|
391
|
+
Get the current status of the Morpheus agent.
|
|
392
|
+
|
|
393
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
394
|
+
* **Response:**
|
|
395
|
+
```json
|
|
396
|
+
{
|
|
397
|
+
"status": "online",
|
|
398
|
+
"uptimeSeconds": 1234.56,
|
|
399
|
+
"pid": 12345,
|
|
400
|
+
"projectVersion": "1.0.0",
|
|
401
|
+
"nodeVersion": "v18.17.0",
|
|
402
|
+
"agentName": "Morpheus",
|
|
403
|
+
"llmProvider": "openai",
|
|
404
|
+
"llmModel": "gpt-4-turbo"
|
|
405
|
+
}
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
### Session Endpoints
|
|
409
|
+
|
|
410
|
+
#### POST `/api/session/reset`
|
|
411
|
+
Archive the current session and start a new one.
|
|
412
|
+
|
|
413
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
414
|
+
* **Response:**
|
|
415
|
+
```json
|
|
416
|
+
{
|
|
417
|
+
"success": true,
|
|
418
|
+
"message": "New session started"
|
|
419
|
+
}
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
#### POST `/api/session/status`
|
|
423
|
+
Get the status of the current session.
|
|
424
|
+
|
|
425
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
426
|
+
* **Response:**
|
|
427
|
+
```json
|
|
428
|
+
{
|
|
429
|
+
"id": "uuid-...",
|
|
430
|
+
"messageCount": 42,
|
|
431
|
+
"embedding_status": "pending"
|
|
432
|
+
}
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### Configuration Endpoints
|
|
436
|
+
|
|
437
|
+
#### GET `/api/config`
|
|
438
|
+
Retrieve the current configuration.
|
|
439
|
+
|
|
440
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
441
|
+
* **Response:**
|
|
442
|
+
```json
|
|
443
|
+
{
|
|
444
|
+
"agent": {
|
|
445
|
+
"name": "Morpheus",
|
|
446
|
+
"personality": "stoic, wise, and helpful"
|
|
447
|
+
},
|
|
448
|
+
"llm": {
|
|
449
|
+
"provider": "openai",
|
|
450
|
+
"model": "gpt-4-turbo",
|
|
451
|
+
"temperature": 0.7,
|
|
452
|
+
"context_window": 100,
|
|
453
|
+
"api_key": "***"
|
|
454
|
+
},
|
|
455
|
+
"santi": {
|
|
456
|
+
"provider": "openai",
|
|
457
|
+
"model": "gpt-4o",
|
|
458
|
+
"memory_limit": 1000
|
|
459
|
+
},
|
|
460
|
+
"channels": {
|
|
461
|
+
"telegram": {
|
|
462
|
+
"enabled": true,
|
|
463
|
+
"token": "***",
|
|
464
|
+
"allowedUsers": ["123456789"]
|
|
465
|
+
},
|
|
466
|
+
"discord": {
|
|
467
|
+
"enabled": false
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
"ui": {
|
|
471
|
+
"enabled": true,
|
|
472
|
+
"port": 3333
|
|
473
|
+
},
|
|
474
|
+
"audio": {
|
|
475
|
+
"enabled": true,
|
|
476
|
+
"apiKey": "***",
|
|
477
|
+
"maxDurationSeconds": 300
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
#### POST `/api/config`
|
|
483
|
+
Update the configuration.
|
|
484
|
+
|
|
485
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
486
|
+
* **Body:** Complete configuration object (same structure as GET response).
|
|
487
|
+
* **Response:**
|
|
488
|
+
```json
|
|
489
|
+
{
|
|
490
|
+
"agent": {
|
|
491
|
+
"name": "Morpheus",
|
|
492
|
+
"personality": "stoic, wise, and helpful"
|
|
493
|
+
},
|
|
494
|
+
"llm": {
|
|
495
|
+
"provider": "openai",
|
|
496
|
+
"model": "gpt-4-turbo",
|
|
497
|
+
"temperature": 0.7,
|
|
498
|
+
"context_window": 100,
|
|
499
|
+
"api_key": "***"
|
|
500
|
+
},
|
|
501
|
+
"santi": {
|
|
502
|
+
"provider": "openai",
|
|
503
|
+
"model": "gpt-4o",
|
|
504
|
+
"memory_limit": 1000
|
|
505
|
+
},
|
|
506
|
+
"channels": {
|
|
507
|
+
"telegram": {
|
|
508
|
+
"enabled": true,
|
|
509
|
+
"token": "***",
|
|
510
|
+
"allowedUsers": ["123456789"]
|
|
511
|
+
},
|
|
512
|
+
"discord": {
|
|
513
|
+
"enabled": false
|
|
514
|
+
}
|
|
515
|
+
},
|
|
516
|
+
"ui": {
|
|
517
|
+
"enabled": true,
|
|
518
|
+
"port": 3333
|
|
519
|
+
},
|
|
520
|
+
"audio": {
|
|
521
|
+
"enabled": true,
|
|
522
|
+
"apiKey": "***",
|
|
523
|
+
"maxDurationSeconds": 300
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
#### GET `/api/config/sati`
|
|
529
|
+
Retrieve the Sati (long-term memory) configuration.
|
|
530
|
+
|
|
531
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
532
|
+
* **Response:**
|
|
533
|
+
```json
|
|
534
|
+
{
|
|
535
|
+
"provider": "openai",
|
|
536
|
+
"model": "gpt-4o",
|
|
537
|
+
"memory_limit": 1000
|
|
538
|
+
}
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
#### POST `/api/config/sati`
|
|
542
|
+
Update the Sati (long-term memory) configuration.
|
|
543
|
+
|
|
544
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
545
|
+
* **Body:**
|
|
546
|
+
```json
|
|
547
|
+
{
|
|
548
|
+
"provider": "openai",
|
|
549
|
+
"model": "gpt-4o",
|
|
550
|
+
"memory_limit": 1000
|
|
551
|
+
}
|
|
552
|
+
```
|
|
553
|
+
* **Response:**
|
|
554
|
+
```json
|
|
555
|
+
{
|
|
556
|
+
"success": true
|
|
557
|
+
}
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
#### DELETE `/api/config/sati`
|
|
561
|
+
Remove the Sati (long-term memory) configuration (falls back to Oracle config).
|
|
562
|
+
|
|
563
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
564
|
+
* **Response:**
|
|
565
|
+
```json
|
|
566
|
+
{
|
|
567
|
+
"success": true
|
|
568
|
+
}
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
### Statistics Endpoints
|
|
572
|
+
|
|
573
|
+
#### GET `/api/stats/usage`
|
|
574
|
+
Get global token usage statistics.
|
|
575
|
+
|
|
576
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
577
|
+
* **Response:**
|
|
578
|
+
```json
|
|
579
|
+
{
|
|
580
|
+
"totalInputTokens": 12345,
|
|
581
|
+
"totalOutputTokens": 6789,
|
|
582
|
+
"totalTokens": 19134
|
|
583
|
+
}
|
|
584
|
+
```
|
|
585
|
+
|
|
586
|
+
#### GET `/api/stats/usage/grouped`
|
|
587
|
+
Get token usage statistics grouped by provider and model.
|
|
588
|
+
|
|
589
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
590
|
+
* **Response:**
|
|
591
|
+
```json
|
|
592
|
+
[
|
|
593
|
+
{
|
|
594
|
+
"provider": "openai",
|
|
595
|
+
"model": "gpt-4-turbo",
|
|
596
|
+
"totalTokens": 12345,
|
|
597
|
+
"inputTokens": 10000,
|
|
598
|
+
"outputTokens": 2345,
|
|
599
|
+
"messageCount": 100
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
"provider": "anthropic",
|
|
603
|
+
"model": "claude-3-opus",
|
|
604
|
+
"totalTokens": 6789,
|
|
605
|
+
"inputTokens": 5000,
|
|
606
|
+
"outputTokens": 1789,
|
|
607
|
+
"messageCount": 50
|
|
608
|
+
}
|
|
609
|
+
]
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
### Sati Memories Endpoints
|
|
613
|
+
|
|
614
|
+
#### GET `/api/sati/memories`
|
|
615
|
+
Retrieve all memories stored by the Sati agent (long-term memory).
|
|
616
|
+
|
|
617
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
618
|
+
* **Response:**
|
|
619
|
+
```json
|
|
620
|
+
[
|
|
621
|
+
{
|
|
622
|
+
"id": "unique-id",
|
|
623
|
+
"category": "work",
|
|
624
|
+
"importance": "high",
|
|
625
|
+
"summary": "Memory summary",
|
|
626
|
+
"details": "Additional details of the memory",
|
|
627
|
+
"hash": "unique-hash",
|
|
628
|
+
"source": "source",
|
|
629
|
+
"created_at": "2023-01-01T00:00:00.000Z",
|
|
630
|
+
"updated_at": "2023-01-01T00:00:00.000Z",
|
|
631
|
+
"last_accessed_at": "2023-01-01T00:00:00.000Z",
|
|
632
|
+
"access_count": 5,
|
|
633
|
+
"version": 1,
|
|
634
|
+
"archived": false
|
|
635
|
+
}
|
|
636
|
+
]
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
#### DELETE `/api/sati/memories/:id`
|
|
640
|
+
Archive (soft delete) a specific memory from the Sati agent.
|
|
641
|
+
|
|
642
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
643
|
+
* **Parameters:** `id` - ID of the memory to archive.
|
|
644
|
+
* **Response:**
|
|
645
|
+
```json
|
|
646
|
+
{
|
|
647
|
+
"success": true,
|
|
648
|
+
"message": "Memory archived successfully"
|
|
649
|
+
}
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
#### POST `/api/sati/memories/bulk-delete`
|
|
653
|
+
Archive (soft delete) multiple memories from the Sati agent at once.
|
|
654
|
+
|
|
655
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
656
|
+
* **Body:**
|
|
657
|
+
```json
|
|
658
|
+
{
|
|
659
|
+
"ids": ["id1", "id2", "id3"]
|
|
660
|
+
}
|
|
661
|
+
```
|
|
662
|
+
* **Response:**
|
|
663
|
+
```json
|
|
664
|
+
{
|
|
665
|
+
"success": true,
|
|
666
|
+
"message": "X memories archived successfully",
|
|
667
|
+
"deletedCount": X
|
|
668
|
+
}
|
|
669
|
+
```
|
|
670
|
+
|
|
671
|
+
### MCP Server Endpoints
|
|
672
|
+
|
|
673
|
+
#### GET `/api/mcp/servers`
|
|
674
|
+
List all registered MCP servers.
|
|
675
|
+
|
|
676
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
677
|
+
* **Response:**
|
|
678
|
+
```json
|
|
679
|
+
{
|
|
680
|
+
"servers": [
|
|
681
|
+
{
|
|
682
|
+
"name": "coolify",
|
|
683
|
+
"config": {
|
|
684
|
+
"transport": "stdio",
|
|
685
|
+
"command": "npx",
|
|
686
|
+
"args": ["-y", "@coolify/mcp-server"],
|
|
687
|
+
"env": {
|
|
688
|
+
"COOLIFY_URL": "https://app.coolify.io",
|
|
689
|
+
"COOLIFY_TOKEN": "your-token"
|
|
690
|
+
}
|
|
691
|
+
},
|
|
692
|
+
"enabled": true
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
"name": "coingecko",
|
|
696
|
+
"config": {
|
|
697
|
+
"transport": "http",
|
|
698
|
+
"url": "https://mcps.mnunes.xyz/coingecko/mcp"
|
|
699
|
+
},
|
|
700
|
+
"enabled": false
|
|
701
|
+
}
|
|
702
|
+
]
|
|
703
|
+
}
|
|
704
|
+
```
|
|
705
|
+
|
|
706
|
+
#### POST `/api/mcp/servers`
|
|
707
|
+
Add a new MCP server.
|
|
708
|
+
|
|
709
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
710
|
+
* **Body:**
|
|
711
|
+
```json
|
|
712
|
+
{
|
|
713
|
+
"name": "new-server",
|
|
714
|
+
"config": {
|
|
715
|
+
"transport": "stdio",
|
|
716
|
+
"command": "npx",
|
|
717
|
+
"args": ["-y", "@new-mcp-server"],
|
|
718
|
+
"env": {
|
|
719
|
+
"NEW_SERVER_URL": "https://example.com",
|
|
720
|
+
"NEW_SERVER_TOKEN": "your-token"
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
```
|
|
725
|
+
* **Response:**
|
|
726
|
+
```json
|
|
727
|
+
{
|
|
728
|
+
"ok": true
|
|
729
|
+
}
|
|
730
|
+
```
|
|
731
|
+
|
|
732
|
+
#### PUT `/api/mcp/servers/:name`
|
|
733
|
+
Update an existing MCP server.
|
|
734
|
+
|
|
735
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
736
|
+
* **Parameters:** `name` - Name of the server to update.
|
|
737
|
+
* **Body:**
|
|
738
|
+
```json
|
|
739
|
+
{
|
|
740
|
+
"transport": "stdio",
|
|
741
|
+
"command": "npx",
|
|
742
|
+
"args": ["-y", "@updated-mcp-server"],
|
|
743
|
+
"env": {
|
|
744
|
+
"UPDATED_SERVER_URL": "https://example.com",
|
|
745
|
+
"UPDATED_SERVER_TOKEN": "your-updated-token"
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
```
|
|
749
|
+
* **Response:**
|
|
750
|
+
```json
|
|
751
|
+
{
|
|
752
|
+
"ok": true
|
|
753
|
+
}
|
|
754
|
+
```
|
|
755
|
+
|
|
756
|
+
#### DELETE `/api/mcp/servers/:name`
|
|
757
|
+
Delete an MCP server.
|
|
758
|
+
|
|
759
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
760
|
+
* **Parameters:** `name` - Name of the server to delete.
|
|
761
|
+
* **Response:**
|
|
762
|
+
```json
|
|
763
|
+
{
|
|
764
|
+
"ok": true
|
|
765
|
+
}
|
|
766
|
+
```
|
|
767
|
+
|
|
768
|
+
#### PATCH `/api/mcp/servers/:name/toggle`
|
|
769
|
+
Enable or disable an MCP server.
|
|
770
|
+
|
|
771
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
772
|
+
* **Parameters:** `name` - Name of the server to toggle.
|
|
773
|
+
* **Body:**
|
|
774
|
+
```json
|
|
775
|
+
{
|
|
776
|
+
"enabled": true
|
|
777
|
+
}
|
|
778
|
+
```
|
|
779
|
+
* **Response:**
|
|
780
|
+
```json
|
|
781
|
+
{
|
|
782
|
+
"ok": true
|
|
783
|
+
}
|
|
784
|
+
```
|
|
785
|
+
|
|
786
|
+
### Logging Endpoints
|
|
787
|
+
|
|
788
|
+
#### GET `/api/logs`
|
|
789
|
+
List all log files.
|
|
790
|
+
|
|
791
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
792
|
+
* **Response:**
|
|
793
|
+
```json
|
|
794
|
+
[
|
|
795
|
+
{
|
|
796
|
+
"name": "morpheus.log",
|
|
797
|
+
"size": 10240,
|
|
798
|
+
"modified": "2026-02-05T21:30:00.000Z"
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
"name": "morpheus-2026-02-04.log",
|
|
802
|
+
"size": 20480,
|
|
803
|
+
"modified": "2026-02-04T21:30:00.000Z"
|
|
804
|
+
}
|
|
805
|
+
]
|
|
806
|
+
```
|
|
807
|
+
|
|
808
|
+
#### GET `/api/logs/:filename`
|
|
809
|
+
Get the last lines of a specific log file.
|
|
810
|
+
|
|
811
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
812
|
+
* **Parameters:** `filename` - Name of the log file to read.
|
|
813
|
+
* **Query Parameters:** `limit` - Number of lines to return (default: 50).
|
|
814
|
+
* **Response:**
|
|
815
|
+
```json
|
|
816
|
+
{
|
|
817
|
+
"lines": [
|
|
818
|
+
"2026-02-05T21:30:00.000Z INFO: Starting Morpheus agent...",
|
|
819
|
+
"2026-02-05T21:30:01.000Z DEBUG: Connected to OpenAI API",
|
|
820
|
+
"2026-02-05T21:30:02.000Z INFO: Telegram bot initialized"
|
|
821
|
+
]
|
|
822
|
+
}
|
|
823
|
+
```
|
|
824
|
+
|
|
825
|
+
### Control Endpoints
|
|
826
|
+
|
|
827
|
+
#### POST `/api/restart`
|
|
828
|
+
Restart the Morpheus agent.
|
|
829
|
+
|
|
830
|
+
* **Authentication:** Requires `Authorization` header with the password set in `THE_ARCHITECT_PASS`.
|
|
831
|
+
* **Response:**
|
|
832
|
+
```json
|
|
833
|
+
{
|
|
834
|
+
"success": true,
|
|
835
|
+
"message": "Restart initiated. Process will shut down and restart shortly."
|
|
836
|
+
}
|
|
837
|
+
```
|
|
838
|
+
|
|
839
|
+
## Testing
|
|
840
|
+
|
|
841
|
+
We use **Vitest** for testing.
|
|
842
|
+
|
|
843
|
+
```bash
|
|
844
|
+
# Run unit tests
|
|
845
|
+
npm test
|
|
846
|
+
|
|
847
|
+
# Run tests in watch mode
|
|
848
|
+
npm run test:watch
|
|
849
|
+
```
|
|
850
|
+
|
|
851
|
+
## Project Structure
|
|
852
|
+
|
|
853
|
+
```text
|
|
854
|
+
.
|
|
855
|
+
├── assets/ # Static assets
|
|
856
|
+
├── bin/ # CLI entry point (morpheus.js)
|
|
857
|
+
├── specs/ # Technical specifications & documentation
|
|
858
|
+
├── src/
|
|
859
|
+
│ ├── channels/ # Communication adapters (Telegram, etc.)
|
|
860
|
+
│ ├── cli/ # CLI commands and logic
|
|
861
|
+
│ ├── config/ # Configuration management
|
|
862
|
+
│ ├── runtime/ # Core agent logic, lifecycle, and providers
|
|
863
|
+
│ ├── types/ # Shared TypeScript definitions
|
|
864
|
+
│ └── ui/ # React Web UI Dashboard
|
|
865
|
+
└── package.json
|
|
866
|
+
```
|
|
867
|
+
|
|
868
|
+
## Roadmap
|
|
869
|
+
|
|
870
|
+
- [x] **Web Dashboard**: Local UI for management and logs.
|
|
871
|
+
- [x] **MCP Support**: Full integration with Model Context Protocol.
|
|
872
|
+
- [ ] **Discord Adapter**: Support for Discord interactions.
|
|
873
|
+
- [ ] **Plugin System**: Extend functionality via external modules.
|
|
874
|
+
|
|
875
|
+
## 🕵️ Privacy Protection
|
|
876
|
+
|
|
877
|
+
The Web UI includes privacy protection headers to prevent indexing by search engines:
|
|
878
|
+
- HTML meta tags: `<meta name="robots" content="noindex, nofollow">`
|
|
879
|
+
- HTTP header: `X-Robots-Tag: noindex, nofollow`
|
|
880
|
+
|
|
881
|
+
This ensures that your private agent dashboard remains private and is not discoverable by search engines.
|
|
882
|
+
|
|
883
|
+
## 🐳 Running with Docker
|
|
884
|
+
|
|
885
|
+
Morpheus can be easily deployed using Docker and Docker Compose. The container supports all environment variables for configuration.
|
|
886
|
+
The Docker image is publicly available at [Docker Hub](https://hub.docker.com/r/marcosnunesmbs/morpheus).
|
|
887
|
+
|
|
888
|
+
### Prerequisites
|
|
889
|
+
|
|
890
|
+
- Docker Engine
|
|
891
|
+
- Docker Compose
|
|
892
|
+
|
|
893
|
+
### Quick Start
|
|
894
|
+
|
|
895
|
+
1. Create a `.env` file with your configuration:
|
|
896
|
+
|
|
897
|
+
```bash
|
|
898
|
+
cp .env.example .env
|
|
899
|
+
# Edit .env with your actual API keys and settings
|
|
900
|
+
```
|
|
901
|
+
|
|
902
|
+
2. Build and start the container:
|
|
903
|
+
|
|
904
|
+
```bash
|
|
905
|
+
docker-compose up -d
|
|
906
|
+
```
|
|
907
|
+
|
|
908
|
+
3. Access the Web UI at `http://localhost:3333`
|
|
909
|
+
|
|
910
|
+
### Docker Compose Example
|
|
911
|
+
|
|
912
|
+
Here's a complete example of how to run Morpheus using Docker Compose:
|
|
913
|
+
|
|
914
|
+
```yaml
|
|
915
|
+
version: '3.8'
|
|
916
|
+
|
|
917
|
+
services:
|
|
918
|
+
morpheus:
|
|
919
|
+
image: marcosnunesmbs/morpheus:latest
|
|
920
|
+
container_name: morpheus-agent
|
|
921
|
+
ports:
|
|
922
|
+
- "3333:3333"
|
|
923
|
+
volumes:
|
|
924
|
+
- morpheus_data:/root/.morpheus
|
|
925
|
+
environment:
|
|
926
|
+
# LLM Configuration
|
|
927
|
+
- MORPHEUS_LLM_PROVIDER=openai
|
|
928
|
+
- MORPHEUS_LLM_MODEL=gpt-4o
|
|
929
|
+
- MORPHEUS_LLM_TEMPERATURE=0.7
|
|
930
|
+
|
|
931
|
+
# API Keys
|
|
932
|
+
- OPENAI_API_KEY=your-openai-api-key
|
|
933
|
+
- ANTHROPIC_API_KEY=your-anthropic-api-key
|
|
934
|
+
- GOOGLE_API_KEY=your-google-api-key
|
|
935
|
+
- OPENROUTER_API_KEY=your-openrouter-api-key
|
|
936
|
+
|
|
937
|
+
# Security
|
|
938
|
+
- THE_ARCHITECT_PASS=your-secure-password
|
|
939
|
+
|
|
940
|
+
# Agent Configuration
|
|
941
|
+
- MORPHEUS_AGENT_NAME=morpheus
|
|
942
|
+
- MORPHEUS_AGENT_PERSONALITY=helpful_dev
|
|
943
|
+
|
|
944
|
+
# UI Configuration
|
|
945
|
+
- MORPHEUS_UI_ENABLED=true
|
|
946
|
+
- MORPHEUS_UI_PORT=3333
|
|
947
|
+
restart: unless-stopped
|
|
948
|
+
```
|
|
949
|
+
|
|
950
|
+
### Using Docker Directly
|
|
951
|
+
|
|
952
|
+
```bash
|
|
953
|
+
# Build the image
|
|
954
|
+
docker build -t morpheus .
|
|
955
|
+
|
|
956
|
+
# Run with environment variables
|
|
957
|
+
docker run -d \
|
|
958
|
+
--name morpheus-agent \
|
|
959
|
+
-p 3333:3333 \
|
|
960
|
+
-v morpheus_data:/root/.morpheus \
|
|
961
|
+
-e MORPHEUS_LLM_PROVIDER=openai \
|
|
962
|
+
-e OPENAI_API_KEY=your-api-key-here \
|
|
963
|
+
-e THE_ARCHITECT_PASS=your-password \
|
|
964
|
+
morpheus
|
|
965
|
+
```
|
|
966
|
+
|
|
967
|
+
### Environment Variables in Docker
|
|
968
|
+
|
|
969
|
+
All environment variables described above work in Docker. The precedence order remains the same:
|
|
970
|
+
1. Container environment variables
|
|
971
|
+
2. Configuration file values
|
|
972
|
+
3. Default values
|
|
973
|
+
|
|
974
|
+
### Persistent Data
|
|
975
|
+
|
|
976
|
+
The container stores configuration and data in `/root/.morpheus`. Mount a volume to persist data between container restarts:
|
|
977
|
+
|
|
978
|
+
```yaml
|
|
979
|
+
volumes:
|
|
980
|
+
- morpheus_data:/root/.morpheus # Recommended for persistence
|
|
981
|
+
```
|
|
982
|
+
|
|
983
|
+
### Health Check
|
|
984
|
+
|
|
985
|
+
The container includes a health check that verifies the health endpoint is accessible. The application exposes a public `/health` endpoint that doesn't require authentication:
|
|
986
|
+
|
|
987
|
+
```bash
|
|
988
|
+
curl http://localhost:3333/health
|
|
989
|
+
```
|
|
990
|
+
|
|
991
|
+
Response:
|
|
992
|
+
```json
|
|
993
|
+
{
|
|
994
|
+
"status": "healthy",
|
|
995
|
+
"timestamp": "2026-02-05T21:30:00.000Z",
|
|
996
|
+
"uptime": 123.45
|
|
997
|
+
}
|
|
998
|
+
```
|
|
999
|
+
|
|
1000
|
+
## Contributing
|
|
1001
|
+
|
|
1002
|
+
1. Fork the repository.
|
|
1003
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`).
|
|
1004
|
+
3. Commit your changes (`git commit -m 'feat: Add amazing feature'`).
|
|
1005
|
+
4. Push to the branch (`git push origin feature/amazing-feature`).
|
|
1006
|
+
5. Open a Pull Request.
|
|
1007
|
+
|
|
1008
|
+
## License
|
|
1009
|
+
|
|
1010
|
+
MIT
|