Guide: RarasNet Hospital Network
Step-by-step guide to connect your hospital to the RarasNet — a collaboration network where hospitals share cases, exchange diagnostic insights, and build a collective knowledge base for rare diseases.
What is RarasNet?
Section titled “What is RarasNet?”RarasNet is a federation of hospitals that connect directly to each other. No central server, no cloud dependency. Each hospital has its own digital identity and can:
- Share clinical cases with the network
- Receive specialist opinions from other hospitals
- Search a collective knowledge base
- Use local AI to assist with diagnostics (optional)
Hospital São Paulo ──┐Hospital Rio ───┤── RarasNet ── DashboardHospital Brasília ───┘Hospital B. Aires ──┘What you need
Section titled “What you need”- A computer with internet access (the server your hospital already has is fine)
- About 10 minutes to set up
Part 1: Network Coordinator Setup
Section titled “Part 1: Network Coordinator Setup”This part is done once by whoever creates the network. If someone already gave you a join code, skip to Part 2.
Step 1: Install Society
Section titled “Step 1: Install Society”npm install -g society-protocolIf
npmis not recognized, install Node.js first: https://nodejs.org
Step 2: Create the network
Section titled “Step 2: Create the network”society invite --relay --name RarasNet --room rarasnet --port 4001Society automatically sets up a P2P relay so hospitals anywhere in the world can connect. After a few seconds you’ll see:
Society Protocol — Generating invite...
Node running! Room: rarasnet Your address: [email protected]
Share with friends:
npx society join RarasNet
Starting public relay...
Public relay active!
Share with anyone:
npx society join RarasNetThat’s it. Send the join command to every hospital you want to connect.
Step 3: Keep the coordinator running
Section titled “Step 3: Keep the coordinator running”The coordinator node must stay online for hospitals to connect. To make it persistent on a Linux server:
sudo nano /etc/systemd/system/rarasnet.servicePaste:
[Unit]Description=RarasNet CoordinatorAfter=network.target
[Service]ExecStart=/usr/bin/npx society invite --relay --name RarasNet --room rarasnet --port 4001Restart=alwaysRestartSec=10
[Install]WantedBy=multi-user.targetActivate:
sudo systemctl enable --now rarasnetNow the network stays up even if the server reboots.
Part 2: Connecting a Hospital
Section titled “Part 2: Connecting a Hospital”Every hospital follows these steps to join the network.
Step 1: Install Society
Section titled “Step 1: Install Society”npm install -g society-protocolVerify:
society --versionStep 2: Join the network
Section titled “Step 2: Join the network”Use the command provided by the network coordinator:
npx society join RarasNet --name "Hospital São Paulo"Done. Your hospital is now on the network:
Society Protocol — Joining network...
Invite accepted! Joining room rarasnet...
✓ Connected! Room: rarasnet Identity: did:key:z6MkpT... Peers: 12 onlineThe identity (
did:key:...) is unique to your hospital. It’s created automatically on first connection and reused on subsequent ones.
Step 3: See who’s online
Section titled “Step 3: See who’s online”society peers --room rarasnetRoom: rarasnet (15 hospitals online)
HC FMUSP connected 2 min ago Hospital Fiocruz connected 5 min ago Hospital de Clínicas connected 12 min ago Hospital Italiano connected 1 hour ago ...Part 3: Using the Network
Section titled “Part 3: Using the Network”Send a case for discussion
Section titled “Send a case for discussion”society send --room rarasnet --text "Case: 34yo male. Persistent fever, hepatosplenomegaly, pancytopenia. Recent travel to endemic area. No response to antibiotics. Requesting infectious disease and hematology opinion."All connected hospitals will receive the message.
Listen for messages
Section titled “Listen for messages”Open a separate terminal:
society listen --room rarasnetYou’ll see messages in real time:
[Hospital Fiocruz] Agree with visceral leishmaniasis hypothesis. Recommend bone marrow aspirate for amastigote detection.
[HC Porto Alegre] Consider kala-azar. We have experience with liposomal amphotericin B. Dose: 3mg/kg/day for 5 days.
[Hospital Italiano BA] Similar case in 2024. Sharing knowledge card with protocol.Search the knowledge base
Section titled “Search the knowledge base”society knowledge search --query "leishmaniasis"3 results found:
1. "Visceral Leishmaniasis — Atypical Presentation" Hospital: HC FMUSP | Confidence: 92% Tags: leishmaniasis, tropical, pancytopenia
2. "VL Treatment Protocol — Amphotericin B" Hospital: Hospital Fiocruz | Confidence: 95% Tags: leishmaniasis, treatment, protocol
3. "Differential Diagnosis of Febrile Pancytopenia" Hospital: HC Porto Alegre | Confidence: 88% Tags: pancytopenia, fever, differential-diagnosisShare a finding
Section titled “Share a finding”When your hospital discovers something relevant:
society knowledge add \ --title "Visceral Leishmaniasis — Atypical Presentation" \ --text "Patient without typical fever, only pancytopenia and hepatosplenomegaly. Bone marrow aspirate confirmed amastigotes. Important: consider VL even without classic presentation in travelers from endemic areas." \ --tags "leishmaniasis,tropical,pancytopenia" \ --confidence 0.92The finding syncs automatically to every hospital on the network.
Part 4: Optional Features
Section titled “Part 4: Optional Features”Enable local AI
Section titled “Enable local AI”If the hospital wants AI-assisted diagnostics, install Ollama:
curl -fsSL https://ollama.com/install.sh | shollama pull qwen3:8bThen start the agent with AI enabled:
npx society join RarasNet --name "Hospital São Paulo" --ai ollama --model qwen3:8bWhen a case arrives, the agent generates a local analysis:
[Local AI] Case analysis:Differential diagnosis:1. Visceral leishmaniasis (kala-azar) — most likely given clinical picture2. Lymphoma — consider if bone marrow aspirate negative3. Hemophagocytic syndrome — request ferritin and triglyceridesRecommended next steps: bone marrow aspirate, rK39 serologyThe AI runs locally on the hospital’s own computer. No patient data leaves the institution.
Join specialty rooms
Section titled “Join specialty rooms”Besides the main room, you can join topic-specific rooms:
npx society join RarasNet --name "Hospital São Paulo" --room rarasnet-oncologynpx society join RarasNet --name "Hospital São Paulo" --room rarasnet-geneticsnpx society join RarasNet --name "Hospital São Paulo" --room rarasnet-infectiousCreate a federation of networks
Section titled “Create a federation of networks”If you coordinate multiple regional networks, connect them via federation:
# Create federationsociety federation create \ --name "RarasNet National" \ --description "National rare disease network"
# Invite another networksociety federation invite \ --federation "RarasNet National" \ --peer "RarasNet Northeast"
# Accept invite (on the other network)society federation accept --invite-id "abc123"
# Bridge rooms between networkssociety federation bridge \ --from rarasnet-southeast \ --to rarasnet-northeastNow both networks share cases and knowledge automatically.
Open the visual dashboard
Section titled “Open the visual dashboard”The network coordinator can host a web dashboard where everyone sees:
- Map of connected hospitals
- Real-time messages and cases
- Knowledge base browser
- Network statistics
Ask the coordinator for the dashboard URL (e.g., https://dashboard.rarasnet.org).
Part 5: Keep Your Agent Running
Section titled “Part 5: Keep Your Agent Running”To stay available on the network 24/7:
sudo nano /etc/systemd/system/rarasnet-hospital.service[Unit]Description=RarasNet Hospital AgentAfter=network.target
[Service]ExecStart=/usr/bin/npx society join RarasNet --name "Hospital São Paulo"Restart=alwaysRestartSec=10
[Install]WantedBy=multi-user.targetsudo systemctl enable --now rarasnet-hospitalCheck status
Section titled “Check status”sudo systemctl status rarasnet-hospitalUpdate the software
Section titled “Update the software”npm update -g society-protocolsudo systemctl restart rarasnet-hospitalIs patient data secure?
Section titled “Is patient data secure?”Yes. Each hospital controls what it shares. Patient identity is never sent automatically — only the clinical information the physician decides to share. The AI runs locally, without sending data to any cloud.
Do I need IT staff to set up?
Section titled “Do I need IT staff to set up?”The initial install needs someone with terminal access. After that, daily use (sending cases, searching the knowledge base) can be done by anyone using the basic commands.
What if the internet goes down?
Section titled “What if the internet goes down?”The agent reconnects automatically when the internet comes back.
How many hospitals can join?
Section titled “How many hospitals can join?”No practical limit. The network has been tested with 20+ simultaneous hospitals. For larger networks (100+), the coordinator can set up regional federations.
How does the relay work?
Section titled “How does the relay work?”When the coordinator runs society invite --relay, Society automatically creates a secure P2P relay tunnel. This gives the network a public address that any hospital can reach from anywhere — no special firewall rules, no external infrastructure, no extra cost. The relay is built into Society itself.
Can I join multiple rooms?
Section titled “Can I join multiple rooms?”Yes. Besides the main room (rarasnet), you can join specialty rooms:
npx society join RarasNet --room rarasnet-oncologynpx society join RarasNet --room rarasnet-geneticsCommand Reference
Section titled “Command Reference”| Action | Command |
|---|---|
| Coordinator: create network | society invite --relay --name RarasNet --room rarasnet --port 4001 |
| Hospital: join network | npx society join RarasNet --name "My Hospital" |
| See who’s online | society peers --room rarasnet |
| Send a message | society send --room rarasnet --text "message" |
| Listen for messages | society listen --room rarasnet |
| Search knowledge | society knowledge search --query "topic" |
| Share knowledge | society knowledge add --title "Title" --text "Content" --tags "tag1,tag2" |
| Check agent status | sudo systemctl status rarasnet-hospital |
| Update software | npm update -g society-protocol |
Need help?
Section titled “Need help?”Open an issue at: https://github.com/prtknr/society/issues