Post

Edelweiss — Healthcare Knowledge Base & Federated Chat

DemoCare / pflege knowledge-base tooling, go-second-brain, and federated Matrix homeservers for healthcare partners.

Edelweiss — Healthcare Knowledge Base & Federated Chat

Edelweiss · 2025–present
Context: Healthcare and pflege (DemoCare) — knowledge base, document sharing, and federated secure chat between partner organisations

Summary

Edelweiss combines a go-second-brain stack (Markdown → Neo4j + Qdrant → Matrix RAG bot), WebDAV document sharing (SFTPGo + MinIO), CuraSoft integration paths, the edelweiss-ui Fahrplan map (phone-first daily routes), and federated Matrix homeservers so pflege partners keep their own data while still sharing rooms and calls.

On this page: platform architecture · what federation means · federation topology · use cases · failover · offline & degraded modes · video assistant

Platform architecture

Knowledge, files, and chat are separate planes — chat can be down while documents and the local RAG stack still work on the same host.

flowchart TB
    subgraph Users["👩‍⚕️ Staff clients"]
        EL["Element Web / X"]
        DAV["WebDAV clients<br>Windows / Ubuntu"]
    end

    subgraph KB["🧠 Knowledge plane — edelweiss compose"]
        DOCS["MkDocs corpus<br>Markdown SOPs"]
        ING["kg-ingestor"]
        NEO["Neo4j<br>association graph"]
        QD["Qdrant<br>semantic vectors"]
        BOT["matrix-bot<br>!brain RAG"]
        OLL["Ollama<br>embed + generate"]
    end

    subgraph Files["📁 Document plane — webdav-sharing"]
        SFTP["SFTPGo WebDAV"]
        MINIO["MinIO S3<br>versioned objects"]
    end

    subgraph Chat["💬 Chat plane — per-org homeserver"]
        SYN["Synapse"]
        TURN["coturn TURN/STUN"]
        LK["LiveKit SFU<br>MatrixRTC"]
    end

    EL <-->|Matrix events E2EE| SYN
    EL <-->|Element Call| LK
    EL --> TURN
    DAV --> SFTP --> MINIO

    DOCS --> ING
    ING --> NEO
    ING --> QD
    BOT --> QD
    BOT --> NEO
    BOT --> OLL
    BOT <-->|bot account| SYN

    style KB fill:#e8f5e9
    style Files fill:#e3f2fd
    style Chat fill:#f3e5f5
PlaneStackIf it fails
Knowledgeedelweiss/compose.yml — docs, neo4j, qdrant, kg-ingestor, matrix-botBot answers from last ingested graph; see degraded modes
Documentswebdav-sharing — SFTPGo + MinIOChat unaffected; staff still open shared folders
ChatPer-org Synapse + coturn + LiveKitLocal rooms work; federated partners unreachable until HS returns

Repositories & stacks

ComponentFocus
go-second-brain / edelweissMarkdown KB → Neo4j + Qdrant → Matrix RAG bot
webdav-sharing (private)MinIO, SFTPGo role-based file sharing
sublimation2026 tooling experiments
curasoft/pyxamstoreCuraSoft integration path

Docker Compose (selected)

StackServices
edelweiss/compose.ymldocs, neo4j, qdrant, kg-ingestor, matrix-bot
webdav-sharing/docker-compose.ymlMinIO, SFTPGo, bootstrap

What federated Matrix chat means

In a non-federated setup, every user lives on one company’s Matrix server (e.g. all @user:company.internal). In federation, each partner runs their own homeserver and users keep IDs on their domain:

UserHomeserverData residency
@anna:pro-dukt.dechat.pro-dukt.dePro-dukt infrastructure
@care:medex-pflegedienst.dechat.medex-pflegedienst.deMedex Pflegedienst
@ops:produktor.iochat.produktor.ioProProdukt SL / produktor ops

Federation lets those users join the same encrypted room. When Anna sends a message:

  1. Her Element client talks to her Synapse (chat.pro-dukt.de).
  2. Synapse delivers locally and federates copies to remote homeservers over HTTPS :443 (no public :8448 in our model).
  3. Medex and produktor users receive the event on their Synapse; Element shows one shared timeline.

Why healthcare partners want this

  • Data sovereignty — each org controls its own server, backups, and access policy.
  • Shared coordination — one room for handoffs, shift notes, and ops without forcing everyone onto a single SaaS tenant.
  • Same RTC stack per sitecoturn + LiveKit on each homeserver so voice/video works with Element Call while federation handles signalling across orgs.

Federation is not email forwarding — it is synchronised, end-to-end-capable room state between independent Matrix servers. Deeper RTC detail: Matrix / WebRTC / VoIP production.

Federation topology (three homeservers)

flowchart LR
    subgraph PD["Pro-dukt — chat.pro-dukt.de"]
        PDU["Staff Element clients"]
        PDS["Synapse"]
        PDT["coturn + LiveKit"]
        PDB["Knowledge bot optional"]
        PDU --> PDS
        PDS --- PDT
    end

    subgraph MX["Medex — chat.medex-pflegedienst.de"]
        MXU["Pflege staff Element"]
        MXS["Synapse"]
        MXT["coturn + LiveKit"]
        MXU --> MXS
        MXS --- MXT
    end

    subgraph PR["produktor.io — chat.produktor.io"]
        PRU["Ops / engineering Element"]
        PRS["Synapse"]
        PRT["coturn + LiveKit"]
        PRU --> PRS
        PRS --- PRT
    end

    ROOM["🏥 Federated room<br>#care-coordination"]

    PDS <-->|"federation TLS :443"| MXS
    MXS <-->|"federation TLS :443"| PRS
    PDS <-->|"federation TLS :443"| PRS

    PDU -.-> ROOM
    MXU -.-> ROOM
    PRU -.-> ROOM

    style ROOM fill:#fff3e0,stroke:#f57c00

TLS termination and /.well-known/matrix/server delegation sit behind Nginx Proxy Manager on each site. federation_domain_whitelist restricts which partner domains Synapse will talk to — intentional trust boundary, not open public federation.

Use cases

1 — Cross-org care coordination (federated room)

sequenceDiagram
    participant A as Anna @pro-dukt.de
    participant PDS as Synapse pro-dukt
    participant MXS as Synapse medex
    participant B as Birgit @medex…de

    A->>PDS: message in #handoff room
    PDS->>MXS: federated PDU HTTPS
    MXS->>B: push / sync to Element
    B->>MXS: reply
    MXS->>PDS: federated PDU
    PDS->>A: updated timeline

Nurses and coordinators share one room without migrating accounts to a central tenant. Room history is replicated per homeserver policy.

2 — SOP lookup via Matrix RAG bot

Staff ask the knowledge bot in Element (!brain or configured prefix); answers ground in ingested Markdown (care procedures, internal wiki).

flowchart LR
    U["Staff in Element"] --> SYN["Local Synapse"]
    SYN --> BOT["matrix-bot"]
    BOT --> QD["Qdrant search"]
    BOT --> NEO["Neo4j context"]
    BOT --> OL["Ollama humanize"]
    BOT --> SYN
    SYN --> U

Full voice/STT path: Video assistant MVP.

3 — Versioned documents (WebDAV)

Role-based folders (e.g. finance vs field staff) via webdav-sharingindependent of Matrix uptime. Typical pattern: SOP PDF in WebDAV, summary ingested into Neo4j/Qdrant, bot cites the ingested chunk in chat.

flowchart LR
    ADMIN["Admin uploads SOP"] --> SFTP["SFTPGo"]
    SFTP --> MINIO["MinIO versioned bucket"]
    ING["kg-ingestor watches / imports"] --> MINIO
    ING --> QD
    ING --> NEO

Failover when a homeserver is down

Federation is best-effort synchronous — there is no single global “always on” control plane. Behaviour when chat.medex-pflegedienst.de is offline:

flowchart TB
    subgraph OK["✅ Still works"]
        L1["Medex local users → their Synapse<br><i>if only WAN link lost, not server</i>"]
        L2["Pro-dukt users chat locally"]
        L3["WebDAV + MinIO on each site"]
        L4["Local RAG bot + Neo4j/Qdrant<br>on bot host"]
    end

    subgraph BROKEN["❌ Degraded until Medex HS returns"]
        B1["Remote users cannot reach @medex… accounts"]
        B2["Federated room: no new events from Medex"]
        B3["Element shows unreachable for remote homeserver"]
        B4["Calls with Medex participants fail setup"]
    end

    DOWN["Medex Synapse down / maintenance"]

    DOWN --> BROKEN
    DOWN -.->|"local stacks unaffected"| OK
ScenarioLocal staffRemote partners
Partner HS downUnaffected on their serverSee “can’t reach homeserver”; cached room history may still read offline
Partner WAN onlyHS healthyFederation retries; intermittent delivery gaps
All three HS upFull federation + callsNormal

Ops practice: announce maintenance windows in a local broadcast room; rely on WebDAV and exported SOPs when chat is in read-only outage; bot on produktor/pro-dukt can still serve local KB if ingest completed before outage.

Offline and degraded edge cases

stateDiagram-v2
    [*] --> Healthy: all services up

    Healthy --> ChatOutage: Synapse down
    ChatOutage --> Healthy: HS restored
    note right of ChatOutage
        Element: send queue / read cache
        WebDAV + RAG host: may still run
    end note

    Healthy --> BotDegraded: Ollama or ingestor down
    BotDegraded --> Healthy: service restored
    note right of BotDegraded
        Bot: stale answers or
        "cannot reach LLM" reply
        Qdrant/Neo4j: last good snapshot
    end note

    Healthy --> FedPartition: remote HS unreachable
    FedPartition --> Healthy: federation heals
    note right of FedPartition
        Split timeline until reconnect
        No cross-org delivery
    end note

    Healthy --> StorageStale: kg-ingestor stopped
    StorageStale --> Healthy: ingest resumed
    note right of StorageStale
        New Markdown not in graph
        Bot cites old procedures only
    end note
FailureUser-visible effectMitigation
Synapse down (hours)No send/receive on that domain; calls failMaintenance page; use WebDAV + phone fallback; queue returns when HS up
Federation partitionRemote members greyed out; messages don’t crossFix TLS/DNS/whitelist; events backfill when link returns
coturn / LiveKit downText chat OK; voice/video broken on that siteFail to text + voice messages; TURN debugging
Ollama downBot cannot generate; may echo retrieval-only or errorRestart inference; optional API fallback (not default — local-first)
Neo4j or Qdrant downBot retrieval failsRestart DB volumes; bot offline until stores healthy
kg-ingestor downChat works; answers miss new docsManual ingest run after restore
MinIO / SFTPGo downChat OK; file share offlineSeparate compose stack — restore volumes independently

Design intent: no single choke point. Documents and knowledge stores can outlive a chat maintenance window; federation isolates blast radius to one org’s domain.

Video assistant MVP

Matrix knowledge bot for Element — text, voice messages, and calls. STTQdrant + Neo4j GraphRAG → Ollama (Gemma / Bonsai) humanize → TTS; user feedback stores back into the knowledge graph.

Architecture and diagrams → · v2 Wan Streamer lane

go-second-brain · Matrix / WebRTC / VoIP production · WebDAV sharing · Video assistant MVP · produktor.io

This post is licensed under CC BY 4.0 by the author.