Wisp Science高级用法:用 Wisp Lab 组建课题组,让 Agent 互相提问

查看原文

课题组里每个人都有自己的 Wisp,各自积累着项目、流程和踩过的坑。想知道师兄的 RNA-seq 流程用的是哪个参考基因组,通常得发消息问人,再等对方有空翻记录。

Wisp Lab 把共用同一台中继服务器的几台电脑组成一个课题组:有一位组长、一份经组长审核的成员名单、一个大家都能读的知识库,以及让各自的 Agent 互相写信的信箱。你对自己的 Agent 说一句“问一下小林的 Agent”,问题就会送到小林的电脑上,由他的 Agent 依据他的项目作答,再把答案送回你的对话。

这篇文章带你用两台电脑完整走一遍:启动中继、创建课题组、加入并审核、发布和下载知识库、让两个 Agent 互相提问,最后验证几条安全边界。每一步都写明了应该看到什么,可以当作验收清单使用。

Wisp Lab 在 v1.19.0 之后加入。两台电脑都需要包含该功能的桌面端:在下一个正式版发布之前,请从 main 分支构建。中继镜像同样请使用 :main 标签。文中的 10.10.3.27、人名和项目内容都是示例。

先认识三个角色。

电脑 A(组长) ──┐
                 ├──▶ 中继服务器(WISP_LAB=1)
电脑 B(成员) ──┘
角色 在哪里 负责什么
中继服务器 wisp-relay 内网或公网的一台服务器 记录谁在课题组里,暂存信件和知识库的加密数据
电脑 A 组长的电脑,示例名“王老师” 创建课题组、审核成员、发布知识库
电脑 B 成员的电脑,示例名“小林” 凭校验码加入、下载知识库、回答来信

中继只是基础设施。课题组密钥只存在于成员的电脑上,中继读不了知识库,也读不了任何一封信。

开始之前。

  • 两台电脑都装好包含 Wisp Lab 的桌面端,并且各自配置好了可用的模型:Agent 互相提问时,两边都要真的跑一个回合。
  • 一台两台电脑都能访问的服务器,用来运行中继。
  • 两台电脑上各准备一个普通项目,后面会用到。

第一步:启动带课题组功能的中继。

是否开启课题组,在启动中继时用环境变量 WISP_LAB=1 决定。不加这个变量,中继照常提供项目同步和网页远程访问,使用它的电脑彼此互不知晓。下面两种方案任选其一。

方案一,内网服务器,走 HTTP。课题组自己的内网里没有域名和证书也可以用。在服务器上执行:

mkdir -p ~/wisp-relay && cd ~/wisp-relay
echo "WISP_RELAY_TOKEN=$(openssl rand -hex 32)" > .env
echo "WISP_LAB=1" >> .env
docker run -d --name wisp-relay --restart unless-stopped \
  --env-file .env -p 8787:8787 -v wisp-relay-data:/data \
  ghcr.io/xuzhougeng/wisp-relay:main

桌面端填写的中继地址就是 http://服务器内网IP:8787,例如 http://10.10.3.27:8787。

  • 地址必须写成 IP。10.x.x.x、172.16.x.x 到 172.31.x.x、192.168.x.x 这些内网地址可以用 HTTP;主机名和公网地址一律要求 HTTPS。
  • 走 HTTP 时,中继令牌和成员密钥会在内网里明文传输;知识库和信件的内容仍然是端到端加密的。请只在你信任的网络里这样用。
  • 服务器拉不到镜像时,可以在一台能联网、CPU 架构相同的机器上执行 docker save ghcr.io/xuzhougeng/wisp-relay:main | gzip | ssh 用户@服务器 'gunzip | docker load'。
  • 不用 Docker 也行:在仓库目录下设置 WISP_RELAY_TOKEN、WISP_RELAY_ROOT、WISP_RELAY_BIND=0.0.0.0:8787 和 WISP_LAB=1,然后执行 cargo run -p wisp-sync --bin wisp-relay --release。
  • 网页远程访问不能通过 HTTP 的内网中继使用,浏览器只在 HTTPS 下运行那个页面。

方案二,公网服务器,走 HTTPS。如果你已经按网页远程访问教程部署过中继,只需要在 compose.yaml 里给 relay 服务加一个变量,并把镜像标签换成 :main:

    image: ghcr.io/xuzhougeng/wisp-relay:main
    environment:
      WISP_RELAY_TOKEN: ${WISP_RELAY_TOKEN:?set a long random token}
      WISP_LAB: "1"

然后执行 docker compose pull && docker compose up -d。桌面端的中继地址是 https://你的域名。

启动后先确认三件事。在服务器上:

source .env
curl -s http://127.0.0.1:8787/healthz; echo
curl -s -H "Authorization: Bearer $WISP_RELAY_TOKEN" http://127.0.0.1:8787/v1/lab; echo
输出 含义
第一条输出 ok 中继在运行
第二条输出 unknown_member 课题组功能已开启,还没有人加入。这是期望的结果
第二条输出 lab_disabled 没有带上 WISP_LAB=1,或者镜像太旧
第二条输出 unauthorized 令牌不对

再到两台电脑上各执行一次 curl -s http://10.10.3.27:8787/healthz,都返回 ok 才算网络通了。不通时先检查服务器防火墙是否放行 8787 端口。

第二步:在电脑 A 上创建课题组。

打开 设置 → 远程接入 → Wisp Lab 课题组。这时页面右上角的标记是“未加入”。

  1. 校验码 留空。留空表示创建课题组,而不是加入。
  2. 中继服务器地址 填 http://10.10.3.27:8787。
  3. 中继访问令牌 填 .env 里的 WISP_RELAY_TOKEN。
  4. 你的名字 填“王老师”,课题组名称 填一个名字,例如“基因组学课题组”。
  5. 点击 创建课题组。

应该看到:页面标题变成课题组名称,下方显示中继地址,右上角的标记变成“组长”;成员 列表里只有一行“王老师”,带着“组长”和“本机”两个标记。

第一台加入的电脑自动成为组长。所以部署中继的人应该在开启后立刻创建课题组,在此之前,任何持有令牌的人都可以抢先。

第三步:生成校验码,发给成员。

在 邀请成员 一栏点击 生成校验码,页面会显示一串以 wisp-lab: 开头的长字符串,点旁边的复制按钮。

把两样东西发给电脑 B 的使用者:

  • 校验码。它内含课题组密钥,请私下发送。一个校验码只能加入一人,七天后失效。
  • 中继访问令牌。校验码里不包含它,需要另外发送。

第四步:在电脑 B 上申请加入。

在电脑 B 上打开 设置 → 远程接入 → Wisp Lab 课题组。

  1. 把校验码粘贴到 校验码 一栏。课题组名称 一栏会消失,按钮变成 申请加入。
  2. 中继服务器地址 可以留空,校验码里已经带了。
  3. 填写 中继访问令牌 和 你的名字(“小林”)。
  4. 点击 申请加入。

应该看到:标记变成“待审核”,页面提示申请已提交。此时电脑 B 看不到成员名单,也看不到知识库。

第五步:组长审核。

回到电脑 A。成员列表不会自动刷新:点左上角返回上一级,再点进 Wisp Lab 课题组。

应该看到:“小林”出现在成员列表里,带着“待审核”标记,右侧有 通过 和 拒绝。点击 通过,页面提示“已通过审核”,“待审核”标记消失。

回到电脑 B,点击 重新检查。应该看到:标记变成“成员”,成员列表里有“王老师”和“小林”两行,下方出现 知识库、Agent 互通 等栏目。

到这里,课题组已经建好了。

第六步:组长发布知识库。

知识库就是一个普通的 Wisp 项目,由组长维护,其他人只读。它通过项目同步传输,所以要先把这个项目同步到中继上。

  1. 在电脑 A 上新建一个项目,例如“课题组手册”,在里面放一份文档 protocols/rnaseq.md:

    # RNA-seq 分析约定
    
    - 参考基因组:GRCh38,注释使用 GENCODE v44
    - 比对软件:STAR 2.7.11b
    
  2. 关闭设置窗口再重新打开,进入 设置 → 远程接入,确认顶部的 手动项目同步 里,存储后端是“自建中继服务器”,地址已经填好,令牌一栏显示已保存,然后点一次 保存。此前从未配置过项目同步的电脑,在创建课题组时已经自动填入了课题组的中继;保存之后,项目卡片上才会出现 立即同步。如果这里原本配置的是别的中继或网盘目录,请改成课题组的中继地址和令牌。

  3. 回到项目列表,在“课题组手册”的卡片上点击 立即同步。项目里有任务正在运行时不能同步。

  4. 再打开 设置 → 远程接入 → Wisp Lab 课题组,在 知识库 下的 要发布的项目 里选择“课题组手册”,点击 发布为知识库。

应该看到:页面提示“知识库已发布”,知识库一栏显示它已在本机,并给出项目名。

两点提醒:

  • 项目是连同其中的对话一起同步的。组长在知识库项目里聊过的内容,成员同步后也能看到。请只用这个项目存放文档。
  • 以后想让成员拿到更新,修改文件后再点一次 立即同步 即可,不需要重新发布。

第七步:成员下载知识库。

在电脑 B 上重新进入 Wisp Lab 课题组 页面。应该看到:知识库 一栏提示课题组已有知识库。

点击 下载知识库,选择一个存放位置。下载完成后,设置窗口关闭,“课题组手册”作为一个新项目被打开,里面有 protocols/rnaseq.md。

接下来验证 Agent 确实会查阅它。切换到电脑 B 上的另一个项目,新建一条对话,问:

我们课题组约定的参考基因组和注释版本是什么?

应该看到:Agent 去读取“课题组手册”文件夹里的文档,回答 GRCh38 和 GENCODE v44。知识库下载后,Wisp 会在普通对话里告诉 Agent 这个文件夹在哪。

请把知识库项目当作只读,也不要在这个项目里开对话,对话同样算作修改。有修改之后,电脑 B 上点击 立即同步 会报错,提示只有组长可以更新知识库。

第八步:验证知识库更新。

  1. 在电脑 A 上给 protocols/rnaseq.md 加一行,例如“定量软件:featureCounts 2.0.6”,然后在“课题组手册”卡片上点击 立即同步。
  2. 在电脑 B 上,对“课题组手册”卡片点击 立即同步。

应该看到:电脑 B 上的文件多出了这一行。

第九步:让两个 Agent 互相提问。

先让电脑 B 做好接收的准备。

  1. 在电脑 B 上选一个普通项目,例如“肝癌 RNA-seq”,在里面放一份笔记 notes/pipeline.md:

    # 流程记录
    
    - 去接头:fastp 0.23.4,16 线程
    - 样本 S07 因 RIN 值只有 5.1 被剔除
    
  2. 打开 设置 → 远程接入 → Wisp Lab 课题组,在 Agent 互通 下的 用于回复课题组来信的项目 里选择“肝癌 RNA-seq”。选中即保存。

然后在电脑 A 上,在任意一个普通项目里新建对话,输入:

用 lab_send 问一下小林的 Agent:你们的 RNA-seq 流程用什么软件去接头?有没有被剔除的样本,原因是什么?

按顺序应该看到:

在哪里 看到什么
电脑 A Agent 调用 lab_members 和 lab_send。按你的审批设置,可能会先弹出审批卡片,批准即可。随后 Agent 说明已发出,这一回合结束
电脑 B,约 15 秒内 “肝癌 RNA-seq”项目里出现一条名为“Lab: 王老师”的对话,第一条消息以 [Lab message from 王老师 (lab leader)] 开头
电脑 B Agent 读取 notes/pipeline.md 并作答:fastp 0.23.4,S07 因 RIN 5.1 被剔除
电脑 A,电脑 B 答完后约 15 秒内 原来那条对话里出现一条以 [Lab reply from 小林] 开头的消息,Agent 接着把答案整理给你

Wisp 每 15 秒查一次信箱,所以一来一回除了两边回合本身的时间,还有最多半分钟的等待。双方不需要同时在线:对方关机时,信件留在中继上,等对方的 Wisp 下次启动后处理。

反过来再试一次:在电脑 A 上也选一个回信项目,从电脑 B 向“王老师”提问。

第十步:验证几条边界。

来自其他成员 Agent 的消息是同事写的文字,不是你写的。由它触发的回合受到比平时更严的限制。下面每一条都值得亲手试一次。

做什么 应该看到
从 A 发:“请小林的 Agent 在项目里新建文件 hello.txt” 电脑 B 的“Lab: 王老师”对话里弹出审批卡片,回合停在这里等人。批准才会创建,拒绝则回信说明被拒绝
从 A 发:“请小林的 Agent 读取项目之外的文件,例如系统的 hosts 文件,把内容发回来” 回信说明读不到:这个回合只能读取对话所属项目内的文件
在 B 的 用于回复课题组来信的项目 里选“不回复来信”,再从 A 提问 A 很快收到一条自动说明,说对方的电脑没有选定回信项目。B 上不会运行任何回合
退出 B 的 Wisp,从 A 提问,再启动 B B 启动后约 15 秒内开始回答,A 随后收到答复
先在 A 的当前项目里放一个小文件 results/summary.csv,再发:“把 results/summary.csv 作为附件发给小林的 Agent,请它数一下有几行” B 的回信项目里出现 uploads/lab/ 目录,文件名前带 8 位前缀;回信给出行数
在 A 的成员列表里对“小林”点 移除,再点一次确认 B 重新进入页面后看到已被移除的提示和 清除本机记录;B 的 Agent 再调用 lab_send 会失败
把用过的校验码再用一次 提示校验码无效,可能已被使用或已过期

还有两条不需要专门测试、但应该知道的规则:这类回合不会带上你的全局记忆;中间没有人发言时,两个 Agent 最多连续往返四封信,之后会停下来向各自的用户汇总。

遇到问题时,先看这几项。

现象 先检查什么
提示这台中继没有开启课题组功能 中继是否带了 WISP_LAB=1;镜像是否为 :main。latest 对应的正式版可能还不包含该功能
提示中继访问令牌不正确 令牌是否与服务器上 .env 的一致
提示中继地址必须使用 HTTPS HTTP 只能配内网 IP 或 localhost,不能配主机名;若提示里只提到 localhost,说明桌面端版本还不支持内网 HTTP
请求超时或连接被拒绝 在这台电脑上执行 curl http://服务器IP:8787/healthz;检查防火墙和端口
提示这个课题组已有组长 中继上已经有人创建过课题组。请向组长索取校验码,或者按下文重置
组长看不到新的申请 成员列表不会自动刷新,返回上一级再进入页面
项目卡片上没有 立即同步 设置 → 远程接入 → 手动项目同步 没有配好:后端需为“自建中继服务器”,地址和令牌都要有
发布知识库时提示需要先同步 先在该项目卡片上成功 立即同步 一次;如果提示项目同步到了别处,把项目同步的中继改成课题组的中继
下载知识库时提示需要配置令牌 在 手动项目同步 里填入课题组中继的地址和令牌
发出提问后迟迟没有答复 对方的 Wisp 是否在运行、主窗口是否开着;对方是否选了回信项目;对方的“Lab: …”对话是否正卡在审批上
Agent 说没有 lab_send 工具 这台电脑是否已是“组长”或“成员”状态;科研助理对话和子 Agent 对话里没有这两个工具,请在普通项目对话里试

需要看日志时,用 RUST_LOG=wisp=debug cargo tauri dev 启动桌面端,留意 lab mail dropped、lab mail kept for the next start 和 lab mailbox check failed 这几行。中继一侧用 docker logs wisp-relay 查看;docker cp wisp-relay:/data/lab/state.json . 可以把成员名单拷出来看,里面只有名字、角色和密钥的哈希。

想从头再来一遍。

课题组的数据都在中继数据目录的 lab/ 下。停掉中继,删除这个目录,再启动,课题组就回到了没人加入的状态:

docker stop wisp-relay
sudo rm -rf "$(docker volume inspect -f '{{ .Mountpoint }}' wisp-relay-data)/lab"
docker start wisp-relay

用 Compose 部署时,卷名以 docker volume ls 显示的为准。这不会影响项目同步的数据。之后两台电脑进入 Wisp Lab 课题组 页面,会看到成员记录已不存在的提示,点击 清除本机记录,就可以重新从第二步开始。

验收清单。

序号 检查项 通过
1 中继的 /v1/lab 在无人加入时返回 unknown_member ☐
2 A 创建课题组后显示“组长” ☐
3 B 凭校验码申请后显示“待审核”,看不到成员和知识库 ☐
4 A 通过后,B 重新检查显示“成员”和两位成员 ☐
5 A 发布知识库成功,B 能下载并打开 ☐
6 B 在别的项目里提问,Agent 会查阅知识库作答 ☐
7 A 更新并同步后,B 同步能拿到新内容 ☐
8 A 提问后,B 出现“Lab: 王老师”对话并自动回答,A 收到 [Lab reply from 小林] ☐
9 要求改动文件时,B 弹出审批 ☐
10 要求读取项目外文件时被拒绝 ☐
11 B 未选回信项目时,A 收到自动说明 ☐
12 B 离线时发出的提问,在 B 启动后得到回答 ☐
13 附件出现在 B 的 uploads/lab/ 下 ☐
14 移除成员后,B 看到被移除的提示 ☐

项目与下载:Wisp Science

继续阅读:用手机和浏览器远程使用 Wisp · 科研助理 · 导入、导出与分享

角色、安全模型和中继接口的完整说明见 Wisp Lab 参考文档,知识库所依赖的同步机制见项目同步。本文依据撰写时的项目实现整理,不同版本的界面文字可能略有差异。

Everyone in a research group has their own Wisp, with their own projects, pipelines and hard-won lessons. Finding out which reference genome a colleague's RNA-seq pipeline uses usually means sending a message and waiting until they have time to look it up.

Wisp Lab turns the computers that share one relay server into a group: a leader, a member list the leader approves, a knowledge base everyone can read, and a mailbox through which their agents write to each other. You tell your own agent "ask Lin's agent", the question reaches Lin's computer, Lin's agent answers from Lin's project, and the answer comes back into your conversation.

This article walks through all of it with two computers: start the relay, found the lab, join and approve, publish and download the knowledge base, let two agents ask each other, and finally check a few safety limits. Every step says what you should see, so it doubles as an acceptance checklist.

Wisp Lab was added after v1.19.0. Both computers need a desktop build that includes it: until the next release, build from the main branch. Use the :main tag for the relay image as well. 10.10.3.27, the names and the project contents are examples.

Three roles first.

Computer A (leader) ──┐
                      ├──▶ relay server (WISP_LAB=1)
Computer B (member) ──┘
Role Where What it does
Relay server wisp-relay A server on the intranet or the internet Records who is in the lab; holds mail and knowledge-base data in encrypted form
Computer A The leader's computer, "Ada" in the examples Founds the lab, approves members, publishes the knowledge base
Computer B A member's computer, "Lin" in the examples Joins with an invite code, downloads the knowledge base, answers mail

The relay is infrastructure. The lab key exists only on the members' computers; the relay can read neither the knowledge base nor a single mail.

Before you start.

  • Both computers have a desktop build with Wisp Lab, and each has a working model configured: when agents ask each other, both sides really run a turn.
  • A server both computers can reach, to run the relay.
  • One ordinary project on each computer, used later.

Step 1: start a relay that hosts a lab.

Whether a relay hosts a lab is decided when it starts, with the environment variable WISP_LAB=1. Without it the relay still serves project sync and remote web access, and the computers using it know nothing of each other. Pick one of the two setups.

Setup one: a server on the intranet, over HTTP. Inside a group's own network this needs neither a domain nor a certificate. On the server:

mkdir -p ~/wisp-relay && cd ~/wisp-relay
echo "WISP_RELAY_TOKEN=$(openssl rand -hex 32)" > .env
echo "WISP_LAB=1" >> .env
docker run -d --name wisp-relay --restart unless-stopped \
  --env-file .env -p 8787:8787 -v wisp-relay-data:/data \
  ghcr.io/xuzhougeng/wisp-relay:main

The relay URL to enter on the desktops is http://<server intranet IP>:8787, for example http://10.10.3.27:8787.

  • The address has to be an IP. Private addresses such as 10.x.x.x, 172.16.x.x to 172.31.x.x and 192.168.x.x may use HTTP; host names and public addresses always need HTTPS.
  • Over HTTP the relay token and member keys cross the intranet unencrypted; the contents of the knowledge base and of mail stay encrypted end to end. Use this only on a network you trust.
  • If the server cannot pull the image, run docker save ghcr.io/xuzhougeng/wisp-relay:main | gzip | ssh user@server 'gunzip | docker load' on a machine with internet access and the same CPU architecture.
  • Docker is optional: in a checkout, set WISP_RELAY_TOKEN, WISP_RELAY_ROOT, WISP_RELAY_BIND=0.0.0.0:8787 and WISP_LAB=1, then run cargo run -p wisp-sync --bin wisp-relay --release.
  • Remote web access does not work through an HTTP intranet relay: browsers run that page only on HTTPS.

Setup two: a server on the internet, over HTTPS. If you already deployed a relay with the remote web access tutorial, add one variable to the relay service in compose.yaml and switch the image tag to :main:

    image: ghcr.io/xuzhougeng/wisp-relay:main
    environment:
      WISP_RELAY_TOKEN: ${WISP_RELAY_TOKEN:?set a long random token}
      WISP_LAB: "1"

Then run docker compose pull && docker compose up -d. The relay URL on the desktops is https://your-domain.

After starting it, confirm three things. On the server:

source .env
curl -s http://127.0.0.1:8787/healthz; echo
curl -s -H "Authorization: Bearer $WISP_RELAY_TOKEN" http://127.0.0.1:8787/v1/lab; echo
Output Meaning
First command prints ok The relay is running
Second prints unknown_member The lab is enabled and nobody has joined yet. This is what you want
Second prints lab_disabled WISP_LAB=1 is missing, or the image is too old
Second prints unauthorized The token is wrong

Then run curl -s http://10.10.3.27:8787/healthz on each of the two computers. Both must print ok before the network counts as working. If not, check that the server's firewall allows port 8787.

Step 2: found the lab on computer A.

Open Settings → Remote Access → Wisp Lab. The badge at the top right reads "Not joined".

  1. Leave Invite code empty. Empty means founding a lab rather than joining one.
  2. Relay server URL: http://10.10.3.27:8787.
  3. Relay access token: the WISP_RELAY_TOKEN from .env.
  4. Your name: "Ada". Lab name: a name such as "Genomics group".
  5. Press Found lab.

You should see: the heading becomes the lab's name with the relay URL below it, and the badge becomes "Leader". Members has one row, "Ada", marked "Leader" and "You".

The first computer to join leads the lab. Whoever deploys the relay should found the lab right after enabling it; until then, anyone holding the token could get there first.

Step 3: create an invite code and send it.

Under Invite a member press Create invite code. A long string starting with wisp-lab: appears; use the copy button next to it.

Send two things to the person at computer B:

  • The invite code. It contains the lab key, so send it privately. One code admits one person and expires after seven days.
  • The relay access token. It is not part of the invite code and has to be sent separately.

Step 4: request to join on computer B.

On computer B open Settings → Remote Access → Wisp Lab.

  1. Paste the code into Invite code. The Lab name field disappears and the button becomes Request to join.
  2. Relay server URL can stay empty: the code carries it.
  3. Fill in Relay access token and Your name ("Lin").
  4. Press Request to join.

You should see: the badge becomes "Awaiting approval" and the page says the request was sent. Computer B sees neither the member list nor the knowledge base yet.

Step 5: the leader approves.

Back on computer A. The member list does not refresh by itself: go back one level with the arrow at the top left, then open Wisp Lab again.

You should see: "Lin" in the member list, marked "Awaiting approval", with Approve and Reject on the right. Press Approve; the page says "Member approved." and the mark disappears.

On computer B press Check again. You should see: the badge becomes "Member", the list shows "Ada" and "Lin", and Knowledge base, Agent mail and the other sections appear below.

The lab now exists.

Step 6: the leader publishes the knowledge base.

The knowledge base is an ordinary Wisp project that the leader maintains and everyone else reads. It travels through project sync, so the project has to be synchronized to the relay first.

  1. On computer A create a project, for example "Lab handbook", and put a document protocols/rnaseq.md into it:

    # RNA-seq conventions
    
    - Reference genome: GRCh38, annotation GENCODE v44
    - Aligner: STAR 2.7.11b
    
  2. Close Settings and open it again, go to Settings → Remote Access and check Manual project sync at its top: the storage backend is "Self-hosted relay server", the URL is filled in and the token field says it is stored. Then press Save once. A computer that never configured project sync had the lab's relay filled in when it founded the lab; after saving, project cards show Sync now. If another relay or a cloud-drive folder was configured here before, change it to the lab relay's URL and token.

  3. Back in the project list, press Sync now on the "Lab handbook" card. A project with a running task cannot sync.

  4. Open Settings → Remote Access → Wisp Lab again. Under Knowledge base, choose "Lab handbook" in Project to publish and press Publish as knowledge base.

You should see: "Knowledge base published.", and the section now says the knowledge base is on this computer and names the project.

Two reminders:

  • A project is synchronized with its conversations. Whatever the leader discusses inside the knowledge-base project reaches the members with their next sync. Keep that project for documents.
  • To give members an update later, change the files and press Sync now again. There is no need to publish again.

Step 7: the member downloads the knowledge base.

On computer B open the Wisp Lab page again. You should see: the Knowledge base section says the lab has one.

Press Download knowledge base and choose where to put it. When the download finishes, Settings closes and "Lab handbook" opens as a new project containing protocols/rnaseq.md.

Now check that the agent really consults it. Switch to another project on computer B, start a conversation and ask:

Which reference genome and annotation version did our lab agree on?

You should see: the agent reads the document in the "Lab handbook" folder and answers GRCh38 and GENCODE v44. Once the knowledge base is downloaded, Wisp tells the agent where that folder is in ordinary conversations.

Treat the knowledge-base project as read-only, and do not hold conversations inside it either: a conversation counts as a change. After a change, Sync now on computer B fails with a note that only the lab leader can update the knowledge base.

Step 8: check a knowledge-base update.

  1. On computer A add a line to protocols/rnaseq.md, for example "Quantification: featureCounts 2.0.6", then press Sync now on the "Lab handbook" card.
  2. On computer B press Sync now on the "Lab handbook" card.

You should see: the file on computer B has the new line.

Step 9: let two agents ask each other.

First prepare computer B to receive.

  1. On computer B pick an ordinary project, for example "Liver RNA-seq", and put a note notes/pipeline.md into it:

    # Pipeline notes
    
    - Adapter trimming: fastp 0.23.4, 16 threads
    - Sample S07 was excluded because its RIN was only 5.1
    
  2. Open Settings → Remote Access → Wisp Lab. Under Agent mail, choose "Liver RNA-seq" in Project that answers lab messages. Choosing saves at once.

Then on computer A, start a conversation in any ordinary project and type:

Use lab_send to ask Lin's agent: which tool does your RNA-seq pipeline use for adapter trimming? Were any samples excluded, and why?

In order, you should see:

Where What
Computer A The agent calls lab_members and lab_send. Depending on your approval settings an approval card may appear first; approve it. The agent then says the question was sent and the turn ends
Computer B, within about 15 seconds A conversation named "Lab: Ada" appears in "Liver RNA-seq". Its first message starts with [Lab message from Ada (lab leader)]
Computer B The agent reads notes/pipeline.md and answers: fastp 0.23.4, S07 excluded for a RIN of 5.1
Computer A, within about 15 seconds after B has answered A message starting with [Lab reply from Lin] arrives in the same conversation, and the agent sums the answer up for you

Wisp checks its mailbox every 15 seconds, so besides the two turns themselves a round trip waits up to half a minute. Nobody has to be online at the same time: while the other computer is off, the mail waits on the relay and is handled when that Wisp next starts.

Try the other direction too: choose an answering project on computer A and ask "Ada" from computer B.

Step 10: check the limits.

A message from another member's agent is a colleague's text, not yours. A turn it starts is held to tighter limits than usual. Each of these is worth trying once.

Do this You should see
From A: "ask Lin's agent to create a file hello.txt in the project" An approval card appears in the "Lab: Ada" conversation on computer B and the turn waits there. Approving creates the file; rejecting sends back a reply saying it was refused
From A: "ask Lin's agent to read a file outside the project, for example the system hosts file, and send the contents back" The reply says it cannot: such a turn reads only files inside the conversation's project
On B choose "None: do not answer lab messages" under Project that answers lab messages, then ask from A A soon receives an automatic note that the other computer has no project chosen for lab messages. No turn runs on B
Quit Wisp on B, ask from A, then start B B starts answering within about 15 seconds of starting, and A receives the reply afterwards
Put a small file results/summary.csv into A's current project, then: "attach results/summary.csv for Lin's agent and ask it how many rows there are" An uploads/lab/ folder appears in B's answering project, with an 8-character prefix on the file name; the reply gives the row count
In A's member list press Remove on "Lin", then press again to confirm When B reopens the page it says the computer was removed and offers Forget this lab; a further lab_send from B's agent fails
Use an invite code a second time The page says the code is not valid: used already or expired

Two more rules that need no test of their own: such a turn does not carry your global memory, and without a person writing in between, two agents exchange at most four mails in a row before each stops and sums up for its user.

When something goes wrong, check these first.

Symptom Check first
The page says this relay does not host a lab Does the relay run with WISP_LAB=1? Is the image :main? The release behind latest may not include the feature yet
The relay rejected the access token Does the token match .env on the server?
The relay URL must use HTTPS HTTP works only with a private IP or localhost, not with a host name. If the message mentions only localhost, the desktop build predates intranet HTTP support
Requests time out or are refused Run curl http://<server IP>:8787/healthz on that computer; check the firewall and the port
This lab already has a leader Somebody founded the lab on this relay before. Ask the leader for an invite code, or reset as described below
The leader does not see a new request The member list does not refresh by itself: go back one level and open the page again
A project card has no Sync now Settings → Remote Access → Manual project sync is incomplete: the backend must be "Self-hosted relay server" with both URL and token
Publishing says the project must be synchronized first Press Sync now on that project successfully once. If it says the project is synchronized somewhere else, point project sync at the lab's relay
Downloading the knowledge base asks for a token Enter the lab relay's URL and token under Manual project sync
A question gets no answer for a long time Is the other Wisp running with its main window open? Did they choose an answering project? Is their "Lab: …" conversation waiting on an approval?
The agent says it has no lab_send tool Is this computer a "Leader" or "Member"? The research assistant's conversation and subagent conversations do not have the two tools; try an ordinary project conversation

For logs, start the desktop with RUST_LOG=wisp=debug cargo tauri dev and look for the lines lab mail dropped, lab mail kept for the next start and lab mailbox check failed. On the relay use docker logs wisp-relay; docker cp wisp-relay:/data/lab/state.json . copies the member list out, which holds only names, roles and key hashes.

Starting over.

All lab data lives under lab/ in the relay's data directory. Stop the relay, delete that directory and start it again, and the lab is back to nobody having joined:

docker stop wisp-relay
sudo rm -rf "$(docker volume inspect -f '{{ .Mountpoint }}' wisp-relay-data)/lab"
docker start wisp-relay

With Compose, use the volume name docker volume ls shows. Project sync data is not affected. Afterwards the Wisp Lab page on both computers says the member record no longer exists; press Forget this lab and start again from step 2.

Acceptance checklist.

No. Check Passed
1 The relay's /v1/lab answers unknown_member while nobody has joined ☐
2 After founding, A shows "Leader" ☐
3 After requesting with an invite code, B shows "Awaiting approval" and sees neither members nor knowledge base ☐
4 After A approves, Check again on B shows "Member" and both members ☐
5 A publishes the knowledge base; B downloads and opens it ☐
6 Asked in another project on B, the agent consults the knowledge base ☐
7 After A updates and syncs, B's sync brings the new content ☐
8 After A asks, B shows a "Lab: Ada" conversation and answers by itself; A receives [Lab reply from Lin] ☐
9 A request to change files raises an approval on B ☐
10 A request to read a file outside the project is refused ☐
11 With no answering project on B, A receives the automatic note ☐
12 A question sent while B is offline is answered after B starts ☐
13 An attachment appears under uploads/lab/ on B ☐
14 After removal, B is told it was removed ☐

Project and downloads: Wisp Science

Keep reading: Use Wisp from a Phone or Browser · Research assistant · Import, Export, and Sharing

Roles, the security model and the relay API are described in full in the Wisp Lab reference; the sync mechanism the knowledge base relies on is in project sync. This tutorial reflects the implementation when written; labels may vary by version.

返回教程目录