Shroomy Architecture

Mac mini · Remote production 74.208.95.219 · K3s · OpenClaw · Relay · Observability
Snapshot: 2026-04-09 · connecting…
/portal canonical Gateway :18789 Session API :18890 Neo4j 443 nodes Discord + Telegram
Operational Live and functioning
Needs Wiring Built, needs integration
In Progress Actively building
Updated Wired this session (Mar 20)
Missing Absent or broken
Local Mac mini (dev/control)
Remote eager-curran (74.208.95.219)
Shared Spans both planes
Cloud External service

System Planes

LOCAL · MAC MINI

Operational
ComponentDetailStatus
PentAGI StackDocker Compose · 21 containers at ~/clawd/pentagi/New
Grafana:3000 · Full observability dashboardOK
Prometheus:9090 · Metrics TSDBOK
Neo4j:7474/:7687/:2004 · Enterprise w/ metricsOK
Kafkacp-kafka:7.8.0 · :9092OK
PentAGI:8443 · AI agent orchestratorOK
pgvector:5433 · Vector similarity searchOK
ClickHouse:8123/9000 · Analytics OLAPOK

REMOTE · EAGER-CURRAN

74.208.95.219 · Ubuntu 24.04 · K3s v1.34.5
ServiceManagerPortRoleStatus
nginxsystemd:80/:443TLS ingress · 5 sites (chat-app, civicswipe, dutystation, dutystation.ai, relay-gateway)OK
OpenClaw Gatewaysystemd:18789Realtime chat for /portal · OK
discussion-apiPM2:18804/discussion · 6 AI bots · Brave Search · SSH exec · M7/M9/M10 cognitiveOK
portal-apiPM2:18803/portal backend · model switching · 34 modelsOK
Shroomy Session APIsystemd:18890Session CRUD + Graphiti + distillationOK
Ingestion Preprocessorsystemd:18793Dedup, sanitize, extractOK
Neo4jDocker:7475→7474 :7689→7687Primary graph · Community 2026.02.2 (443 nodes)OK
OllamaDocker:11434Local LLM inferenceOK
PostgreSQLsystemd:5432v16.13 · Relay + discussion + hosted appsOK
Grafanasystemd:3100v12.4.1 · Prometheus + Loki + Alertmanager datasourcesNew
ChromaDBDocker:8000Auxiliary vector storeOK

RELAY BOT

Operational
ComponentDetailStatus
relay-discord-botPM2 · tsx · Discord.js · PrismaOK
Discord ingresslib/discord/bot.tsOK
WhatsApp ingresslib/whatsapp/client.tsOK
AI pipelinelocal | openai | anthropic | customOK
Loop guardshouldProcessMessage depth checkOK
PersistencePrisma → PostgreSQL :5432OK

Public Routes Remote

/portal Remote

Operational
Canonical web chat UI
Static app behind nginx/Plesk
Single public destination
Legacy paths redirect here

/gw/ Remote

Operational
→ Gateway :18789
Realtime WebSocket chat
Transport for /portal

/session-api/ Remote

Operational
→ Session API :18890
Session CRUD · Graphiti
Distillation endpoints

/discussion Remote

Operational
Native discussion workspace
Categories + channels + attachments
Discord import + AI in-thread actions

/api/dashboard Remote

Operational
JSON source for dashboard
Fed by live exporters
Mac mini + remote collectors

Integration Hub · Session API :18890 Remote

Session Persistence Remote

Operational
Token-scoped sessions
Neo4j: WebchatSession + WebchatMessage
Entity references + edges

Graph / Memory Bridge Remote

Operational
Transcript → add_memory
Status/search passthrough
Graphiti MCP :3010 bridge

Distillation Hub Remote

Operational
POST /consult · GET /consult/:id
GET /learned-patterns
GET /distillation/status
POST /distillation/flush-digest

Knowledge Distillation Remote

teacher-client.mjs Remote

Operational
Wraps standalone Copilot CLI
Execution/planning prompts
execFile(copilot -p ...)

distillation-pipeline.js Remote

Operational
Normalize → classify → score
Deduplicate → enrich → store
LearnedPattern + TeacherConsultation

discord-digest.js Remote

Wired
Batched digest summaries
Posts to #status-reports
DISCORD_BOT_TOKEN wired verified
via systemd service env

Pattern Storage Remote

Operational
TeacherConsultation →PRODUCED→
LearnedPattern →REFERENCES→
Entity + indexes

Neo4j Graph · 1405 Nodes Remote

Node Labels Remote

WebchatMessage 1122 · WebchatSession 70
Episodic 22 · Entity 26
WebchatUser 6 · LearnedPattern 77
TeacherConsultation 77 · SynProgram 2 · PainPoint 1

Relationships Remote

OWNS · HAS_MESSAGE · RELATES_TO
MENTIONS · NEXT_EPISODE
PRODUCED · REFERENCES

Data Flows Shared

Browser → /portal Chat Remote

Operational
Browsernginx :443/gw/ WSGateway :18789Ollama + GraphitiResponse

Session Persistence Remote

Operational
/session-api/:18890Preprocessor :18793Neo4j graph + Graphiti add_memory

Discussion Workspace Remote

Operational
Browser/discussiondiscussion-api :18804Prisma/PostgreSQLattachments on disk

Knowledge Distillation Remote

Operational
POST /consultteacher-clientCopilot CLIpipelineNeo4j (LearnedPattern)Discord digest

Relay Bot Remote

Operational
Discord / WhatsApprelay-botloop guardAI providersPrisma/PGreply

Local Shroomy Local

Operational
Telegrammain.pyMemgraph :7687heartbeatagent-bridge :18790

Dashboard Collectors Shared

Operational
Mac mini collectorsigned payload/api/dashboardsnapshot refresh | Remote probePM2/systemd healthUI badges

PM2 Runtime Remote

discussion-api Remote

online · :18804
6 AI bots + Brave Search
M3 RLM · M7/M9/M10 cognitive

portal-api Remote

online · :18803
34 models via OpenClaw 2026.4.8
WebSocket chat transport

relay-bot Remote

online
Discord + WhatsApp relay
tsx · Prisma · AI pipeline

relay-web Remote

online
Web relay interface

dashboard-health Remote

online · :18802
Health API for this dashboard
Port probes + PM2 stats

shroomy-platform Remote

online · :18900
Platform services

hybrid-search Remote

online · :18895
pgvector + Neo4j + BM25
Three-tier RRF cascade

shroomy-runner Remote

online
Task execution agent

shroomgpt-grants Remote

online
Grants research pipeline

embed-pipeline Remote

stopped
Neo4j → Ollama → pgvector
624 vectors seeded

Observability Stack new

LOCAL · PENTAGI Local

21 Containers
ServiceImagePortStatus
Grafanagrafana:11.4.0:3000OK
Prometheusprom/prometheus:v2.48.1:9090OK
Alertmanagerprom/alertmanager:v0.28.1:9093OK
Lokigrafana/loki:3.3.2:3100OK
Promtailgrafana/promtail:3.3.2:9080OK
VictoriaMetricsvictoria-metrics:v1.108.1:8428OK
VMAlertvmalert:v1.108.1:8880OK
Jaegerjaeger-all-in-one:1.56.0:16686OK
OTel Collectorotel-contrib:0.116.1:4318OK
cAdvisorcadvisor:v0.51.0:8080OK
Node Exporternode-exporter:v1.8.2:9100OK
Kafka Exporterkafka-exporter:latest:9308OK
PG Exporterpostgres-exporter:v0.16.0:9187OK

REMOTE · K3S MONITORING Remote

Deployed Mar 20
ServiceHelm ChartAccessStatus
Prometheuskube-prometheus-stack v82.12.0:30090New
Alertmanagerkube-prometheus-stack:30093New
Lokiloki-stack-2.10.3:30100New
Promtailloki-stack (DaemonSet)all nodesNew
Node Exporterkube-prom-stack (DaemonSet)host netNew
Kube State Metricskube-prom-stackClusterIPNew
Kafka Exporterprometheus-kafka-exporter-3.0.1hostNet :9308New
Grafanasystemd (apt):3100New
13/13 Prometheus targets UP 3 Grafana datasources Prometheus + Loki + Alertmanager

OBSERVABILITY PARITY

Local vs Remote
ComponentLocalRemote
Grafana:3000:3100
Prometheus:9090:30090
Alertmanager:9093:30093
Loki + Promtail:3100:30100
Node Exporter:9100DaemonSet
Kafka Exporter:9308hostNet
VictoriaMetrics:8428
Jaeger:16686
OTel Collector:4318
cAdvisor:8080
PG Exporter:9187
Neo4j Metrics:2004Enterprise only

Messaging & CDC

LOCAL · KAFKA Local

Operational
ServiceImagePort
Kafkacp-kafka:7.8.0:9092
Kafka Exporterkafka-exporter:latest:9308

REMOTE · KAFKA + DEBEZIUM Remote

Operational
ServiceImagePort
Kafkacp-kafka:7.5.0127.0.0.1:29092
Zookeepercp-zookeeper:7.5.0127.0.0.1:2181
Debezium Connectdebezium/connect:2.5127.0.0.1:8083
Connector: shroomy-audit-connector PostgreSQL CDC Kafka topics

Discussion AI Bots new Remote

@ShroomyMac

Apple & design expert
SwiftUI, Xcode, macOS
Model: gemma4:31b · thinking: medium
Label: Mac

@ShroomyLinux

Linux & DevOps sysadmin
Servers, networking, shell
Model: deepseek-v3.2 · thinking: medium
Label: Linux

@ShroomyPolitics

Geopolitics & policy
Brave web search enabled
Model: kimi-k2.5 · thinking: off
Label: Politics

@ShroomyRunner

Task execution agent
Multi-pass autopilot
Model: deepseek-v3.2 · thinking: medium
Label: Runner

@ShroomyCafe

Rolled gelato, coffee, boba
Recipe dev + food cost
Model: qwen3.5 · thinking: medium
Label: Cafe

@ShroomyKPI

Cloud infra & SRE expert
SSH exec · RLM · auto_discover · emotion_state
Model: deepseek-v3.2 · thinking: medium
5 tool categories · Label: KPI

@ShroomyCopilot new

Code & dev assistant
Full-stack · architecture · review
Model: qwen3-coder-next · thinking: high
Label: Copilot

AI & Memory Services

Ollama (Remote) Remote

Operational
llama3.2-vision:11b chat + vision
nomic-embed-text 768d embed
systemd · :11434

Ollama Cloud Cloud

Operational
minimax-m2.5 frontier chat
kimi-k2.5 geopolitics/research
deepseek-v3.2 code + infra
gemma4:31b Apple/design
qwen3.5 cafe/creative
qwen3-coder-next dev copilot
qwen3-vl:235b vision

Graphiti MCP :3010 Remote

Operational
add_memory · search_nodes
search_memory_facts
MCP-over-HTTP tool surface

GraphRAG — Community Reasoning new Remote

Community Detection

Active
Louvain algorithm · pure TypeScript
80 communities × 3 levels = 240
Modularity 0.58 · 1,368 Neo4j nodes
graphrag-daemon PM2 · 30min check

Community Summaries

Active
LLM summarization via gemma3:27b
240/240 communities summarized
Hash-based incremental re-summarization
Embeddings: nomic-embed-text 768d

Semantic Retrieval

Active
pgvector cosine similarity ≥ 0.55
ILIKE text fallback
local / global / hybrid classifier
Auto-injected into bot system prompts

Operations & Maintenance

Scheduled Jobs verified Remote

Operational
openclaw-compaction daily 01:00 · systemd timer
openclaw-backup daily 03:30 · systemd timer
discussion-backup daily 04:00 · systemd timer
failopen-recovery every 10min

Always-On Remote

Operational
failopen-recovery every 10min
memory-watcher always on
Pushes files → Graphiti episodes

Self-Healing Remote

Operational
openclaw-layer6 PM2
graphrag-daemon PM2 · 30min interval
Reconnect + fix-pattern
monitoring-dashboard :3011

Port Map Shared

Public Remote

:80/:443 nginx
:18789 Gateway (/gw/)
:18890 Session API (/session-api/)
:18803 portal-api · :18804 discussion-api

Observability Remote

:3100 Grafana
:30090 Prometheus (K3s)
:30093 Alertmanager (K3s)
:30100 Loki (K3s)

Data Stores Remote

:7475→7474 / :7689→7687 Neo4j
:5432 PostgreSQL · :6379 Redis
:8000 ChromaDB · :11434 Ollama
:29092 Kafka (localhost)

Local Plane Local

PentAGI Stack (21 containers):
:3000 Grafana · :9090 Prometheus
:8443 PentAGI · :9092 Kafka
:7474 Neo4j · :5433 pgvector

⚡ Session Update · Apr 9, 2026

8 improvements shipped this session:
· OpenClaw CLI 2026.4.8 — Updated local (2026.3.8→2026.4.8) and remote (2026.3.12→2026.4.8); doctor run on both, gateway service entrypoint fixed to dist/entry.js
· ShroomyCopilot Agent — NEW code & dev assistant (@ShroomyCopilot) on /discussion; model: qwen3-coder-next, thinking: high
· GraphRAG — Community Reasoning — 80 communities × 3 levels (240 total), Louvain detection, gemma3:27b summarization, pgvector 768d semantic retrieval; injected into all bot system prompts
· Discussion Backup Automation — daily timestamped archives (UI, API, attachments, SQL dump); server-side systemd timer + local Mac LaunchAgent mirror to ~/Backups/
· Inline Attachment Rendering — images attached to discussion posts now render inline in the thread view
· Mobile UI Hardening — fixed 2px collapsed comment boxes, channel click crash loop, scroll stability; all mobile threads now readable
· Agent Streaming Hardening — empty bot saves eliminated; proper SSE error propagation; retry next model on empty stream; default model corrected to gemma4:31b
· Bot Model Assignments — stable overrides in discussion-bots.json: ShroomyMac→gemma4:31b, ShroomyLinux→deepseek-v3.2, ShroomyPolitics→kimi-k2.5, ShroomyRunner→deepseek-v3.2, ShroomyCafe→qwen3.5, ShroomyKPI→deepseek-v3.2

⚡ Session Update · Mar 20, 2026

16 components wired this session:
· M3 RLM Engine — NEW Recursive Language Model wired into discussion-api: rlm_analyze tool for KPI + POST /rlm/analyze endpoint. 4-step recursive decomposition (arXiv:2512.24601v2)
· M7 Emotional Embed — NEW 5D emotional state (curiosity/frustration/confidence/fatigue/satisfaction), file persistence, prompt injection into all bots, GET /cognitive/emotion API
· M9 Context Continuity — NEW cognitive context (goals, topics, valence), boot restoration, prompt injection, GET /cognitive/context API
· M10 Auto-Discovery — NEW dependency correlation engine, auto_discover KPI tool, POST /cognitive/discover API
· Observability Stack (Remote) — Prometheus, Alertmanager, Loki, Promtail deployed via Helm on K3s (kube-prometheus-stack + loki-stack)
· Kafka Exporter (Remote) — hostNetwork patched to reach localhost-bound Kafka on :29092
· Node Exporter + Kube State Metrics — DaemonSet, all 13 Prometheus targets UP
· Grafana Datasources — Prometheus :30090, Loki :30100, Alertmanager :30093 configured
· ShroomyKPI Agent — NEW cloud infra/K8s expert bot on /discussion with SSH exec + RLM + auto_discover + emotion_state tools
· ShroomyCafe Agent — NEW rolled gelato/coffee/boba recipe specialist
· Model Sync — 34 models sorted alphabetically, parity verified /discussion ↔ /portal
· Typing Indicators — All 6 bots now show "is thinking…" / "is working…" / "is still working…"
· Helm v3.20.1 — Installed on remote with prometheus-community + grafana repos
· Neo4j Recreated — Migrated from systemd to Docker container, data volume preserved
· K3s Cluster — 3 namespaces: default, shroomy (app pods), monitoring (observability)
· DutyStation Stack — 5-container compose stack discovered (API, Postgres, Redis, Meili, Memgraph)

10-Model Cognitive Integration · Sentient Upgrade Directive Shared

SENTIENT UPGRADE DIRECTIVE Shared

SOUL.md Property 17 · MEMORY.md
M1 · Vector Search updated
nomic-embed-text
pgvector VECTOR(768) · HNSW index
Wired
M2 · Embed Pipeline updated
embed-pipeline.mjs
Neo4j → Ollama → pgvector · 624 vectors
Wired
M3 · RLM Engine new
Recursive decomp · 4-step analysis
rlm_analyze tool + POST /rlm/analyze
arXiv:2512.24601v2 · depth 3
Wired
M4 · Graph DB
Neo4j :7687
1405 nodes active
OK
M5 · Hybrid Search new
pgvector + Neo4j + BM25
Three-tier RRF cascade · :18895
Wired
M6 · Dream Migration new
dream-cycle.mjs
PM2 cron daily 02:00 · 10 dreams
Wired
M7 · Emotional Embed new
5D state: curiosity·frustration·confidence·fatigue·satisfaction
File persist · prompt injection · GET /cognitive/emotion
Wired
M8 · Reflection Pipeline updated
Weekly reflection
dream-cycle.mjs · consolidation + association
Wired
M9 · Context Continuity new
Goals · topics · valence scoring
Boot restore · prompt injection · GET /cognitive/context
Wired
M10 · Auto-Discovery new
LLM dependency correlation
auto_discover KPI tool · POST /cognitive/discover
Wired

System Vitals Remote

Server Uptime
loading…
Disk Usage
Memory
K3s Pods

M7 Cognitive State Remote

Live
Curiosity
Frustration
Confidence
Fatigue
Satisfaction

Infrastructure Hardening Remote

Active
🛡️
Security Headers
Enabled
Rate Limiting
Enabled
📦
Gzip L6
Enabled
💾
Asset Cache
7d TTL
🔄
Log Rotate
10M/30d
robots.txt · manifest.json · daily config backup at 03:00 UTC

PM2 Services Remote

Architectural Takeaways

/portal = canonical UI Remote

Browser users enter via /portal.
Realtime via /gw/.
Persistence via /session-api/.

Session API = hub Remote

Session persistence, Graphiti bridge,
distillation endpoints, digest hooks.

:18790 ≠ :18890 Remote

agent-bridge = :18790
session-api = :18890
Critical port split.

Relay = sibling ingress Remote

Not the portal. Discord/WhatsApp
with own AI pipeline + Prisma.

Discussion = native workspace Remote

Categories, channels, users,
attachments, imported Discord history,
now backed by Prisma/PostgreSQL.

Local = control node Local

Telegram, heartbeats, local graph.
Not the public web runtime.

Distillation = production Remote

Teacher consult, pattern storage,
Discord digests on remote host.