When OpenClaw Meets Hospital: Toward an Agentic Operating System for Dynamic Clinical Workflows

This paper proposes an architecture for an "Agentic Operating System for Hospital" that adapts the OpenClaw framework to safely deploy LLM agents in clinical environments by integrating a restricted execution environment, document-centric interactions, page-indexed long-term memory, and a curated medical skills library to ensure reliability, security, and auditability in dynamic workflows.

Wenxian Yang, Hanzheng Qiu, Bangqun Zhang, Chengquan Li, Zhiyong Huang, Xiaobin Feng, Rongshan Yu, Jiahong Dong

Published 2026-03-13
📖 5 min read🧠 Deep dive

Imagine a hospital as a bustling, high-stakes city. In this city, doctors, nurses, and patients are constantly exchanging information, but they are currently stuck using a very old, rigid map system.

The Problem: The "Scripted City"
Right now, hospital computer systems work like a train on a fixed track. They are great at doing the routine things: checking a patient in, ordering a standard blood test, or scheduling a follow-up. But what happens when a patient has a rare combination of illnesses, or a new drug interacts strangely with an old one? The train hits a wall. The system can't leave the tracks. It can't say, "Hey, let's look at this patient's history from three years ago and combine it with today's lab results to solve this unique puzzle."

Furthermore, trying to give a super-smart AI (a Large Language Model) full control over a hospital is like handing a toddler the keys to a nuclear power plant. If the AI gets confused or hallucinates, it could accidentally delete a patient's record or call the wrong emergency number. We can't trust the AI to "behave" on its own; we need to build a cage that makes it impossible for it to do anything dangerous.

The Solution: The "Agentic Operating System"
This paper proposes building a new kind of "Operating System" for hospitals, inspired by a project called OpenClaw. Think of this not as a new app, but as the foundation of the building itself.

Here is how it works, using simple analogies:

1. The "Restricted Apartment" (Safety First)

Imagine every doctor, nurse, and patient gets their own private apartment in a massive building.

  • The Rule: You can only touch the furniture inside your own apartment. You cannot walk into the neighbor's room, you cannot break the windows, and you cannot call anyone outside unless you use the specific, pre-approved phone in your kitchen.
  • In the Hospital: The AI agents (the digital helpers) are locked in these "apartments." They can only read and write specific files (documents) they are allowed to see. They cannot access the internet, run random code, or delete files they shouldn't. If the AI tries to do something bad, the "building manager" (the Linux operating system) physically stops it before it happens. It doesn't rely on the AI being "good"; it relies on the locks being unbreakable.

2. The "Skill Library" (The Toolbox)

Instead of letting the AI invent new ways to do things on the fly (which is risky), we give it a pre-approved toolbox.

  • The Analogy: Imagine a chef who can only use the knives and pans that have been inspected and approved by the health department. They can't just grab a random screwdriver from the garage to cook.
  • In the Hospital: The AI has a library of "skills" like "Check Blood Pressure," "Summarize Lab Results," or "Book an Appointment." These skills are pre-tested. The AI can mix and match them to solve new problems, but it can't invent a new, dangerous tool.

3. The "Paper Trail" (Communication)

In most computer systems, agents talk to each other by sending instant messages. In this new system, nobody talks directly.

  • The Analogy: Imagine a busy office where no one speaks. Instead, everyone leaves sticky notes on a shared bulletin board. If the Nurse needs to tell the Doctor something, she writes a note on the "Patient Chart" board. The Doctor sees the note, reads it, and writes a reply on the same board.
  • In the Hospital: All communication happens by writing to shared documents. This creates a perfect, unchangeable history of everything that happened. If you want to know who said what and when, you just look at the "sticky notes." It's impossible to hide a conversation or delete a message without leaving a trace.

4. The "Table of Contents" (Smart Memory)

Current AI systems try to remember everything by turning documents into math (vectors). This is like trying to find a specific sentence in a library by guessing which book it might be in based on a vague feeling. It often gets it wrong.

  • The Analogy: This new system is like a human librarian. Instead of guessing, the librarian looks at the Table of Contents (called a "Manifest").
    • Step 1: The AI asks, "I need to find a patient's heart history."
    • Step 2: It looks at the main Table of Contents and sees a folder called "2023-2024 Heart Records."
    • Step 3: It opens that folder and sees a sub-table of contents for "January."
    • Step 4: It keeps drilling down until it finds the exact page.
  • Why it's better: The AI uses its own reading skills to navigate the Table of Contents. It doesn't need complex math to find things; it just reads the descriptions, just like a human doctor flipping through a paper chart. This means the memory is always accurate, organized, and easy to understand.

The Big Picture: Why This Matters

This system allows the hospital to handle the "Long Tail" of medicine—the weird, rare, and complex cases that standard software can't handle.

  • Before: A doctor encounters a rare drug interaction. The computer says, "I don't have a protocol for this." The doctor has to do everything manually.
  • After: The doctor asks the AI Agent. The Agent looks at the "Table of Contents" of the patient's 10-year history, uses its "Skill Library" to check drug interactions, and composes a new, custom plan on the spot. It does this safely, without ever leaving its "apartment" or breaking any rules.

In short: This paper proposes a hospital computer system that is safe by design (locked down like a prison), organized like a library (using tables of contents instead of math), and flexible like a human (able to solve new problems by combining old tools). It turns the AI from a risky wildcard into a reliable, auditable assistant.