{"id":51002566,"url":"https://github.com/chenhaodev/med-agent-inner-all","last_synced_at":"2026-06-20T16:32:37.362Z","repository":{"id":363055849,"uuid":"1261714154","full_name":"chenhaodev/med-agent-inner-all","owner":"chenhaodev","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-07T09:06:20.000Z","size":465,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-07T09:11:55.330Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chenhaodev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-07T03:58:16.000Z","updated_at":"2026-06-07T09:06:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/chenhaodev/med-agent-inner-all","commit_stats":null,"previous_names":["chenhaodev/med-agent-inner-all"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/chenhaodev/med-agent-inner-all","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenhaodev%2Fmed-agent-inner-all","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenhaodev%2Fmed-agent-inner-all/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenhaodev%2Fmed-agent-inner-all/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenhaodev%2Fmed-agent-inner-all/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chenhaodev","download_url":"https://codeload.github.com/chenhaodev/med-agent-inner-all/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenhaodev%2Fmed-agent-inner-all/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34578089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-20T16:32:36.483Z","updated_at":"2026-06-20T16:32:37.352Z","avatar_url":"https://github.com/chenhaodev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 西氏内科学精要 问答 Agent\n\n基于《西氏内科学精要》（Cecil Essentials of Medicine）的内科常见病问答系统，覆盖 17 专科，支持患者家属与临床医生两种模式。\n\n无需 RAG / 向量库，结构化知识注入 + 确定性路由，知识来源可回溯至原书页码。\n\n---\n\n## 我是谁？\n\n| 你是… | 用途 | 文档 |\n|-------|------|------|\n| **患者 / 家属** | 了解病情、日常护理、何时就医 | [docs/patient.md](docs/patient.md) |\n| **临床医生** | 循证管理摘要、证据等级参考 | [docs/doctor.md](docs/doctor.md) |\n| **Agent / 开发者** | CLI 调用接口、pipeline 集成 | [docs/agent-os.md](docs/agent-os.md) |\n\n---\n\n## 快速开始\n\n```bash\ncp .env.example .env                            # 填入 DEEPSEEK_API_KEY\n./bin/ask.sh \"我爸有高血压，平时饮食要注意什么？\"\n./bin/ask.sh --mode doctor \"高血压血压控制目标？\"\n./bin/ask.sh --accurate \"肺栓塞抗凝怎么做？\"     # 精确模式：核验+自纠\n./bin/ask.sh --stream \"高血压饮食建议？\"        # 流式输出（--stream 默认关）\n```\n\n重复提问走缓存（`.cache/deepseek/`），响应从 ~1.9s 降至 0.02s。\n清理缓存：`rm -rf .cache/`\n\n---\n\n## 两种执行模式（速度 ↔ 质量）\n\n受众模式（`--mode patient|doctor`）之外，另有一条正交的「执行模式」轴，在速度与质量间取舍：\n\n| 模式 | 开关 | 行为 | 适用 |\n|------|------|------|------|\n| **Fast** | 默认 / `--fast` | 单次生成，最低延迟 | 日常交互、快速查询 |\n| **Accurate** | `--accurate`（别名 `--deep`） | 原子声明 grep 核验 + 有不符则回炉自纠，~2-3 倍调用 | 临床/高风险问题、降幻觉 |\n\n批量 eval 同理两档：`./bin/eval.sh`（Fast，裸生成，度量基线）与 `./bin/eval_deep.sh`（Accurate，verify+reroll，度量质量上限）。两条批量路径均已并发化（`--concurrency`，默认 8）。\n\n---\n\n## 性能指标（v3.4，2026-06-08 重跑）\n\n| 模式 | 题数 | 平均分 / 40 | 通过率（≥34） | 溯源性 | OOB 拦截 |\n|------|------|------------|--------------|--------|---------|\n| patient | 112 | 38.6 | 95.5% | 10.0 | 100% |\n| doctor  | 109 | 38.4 | 97.2% | 9.8  | 100% |\n\ngold.yaml 150 题，覆盖 Tier1/2/3 全部病种（98 个 YAML）。  \neval 耗时：~13 min（并发 8，原串行 ~30–50 min）。\n\n\u003e v3.4 质量收口：双模式双破 95%。doctor 反编造护栏消除 PPI 时机外推幻觉（DIGE_HP_01 acc 6→10）、\n\u003e 修正黄疸 ALP 事实错（acc 5→8）；按「书本忠实」契约对覆盖失败 triage——B3-doctor 放宽书外\n\u003e 患教警告（GERI_POLY split），B3-patient 落入隔离的层3 安全底线（HIV 家庭防护，仅 patient 注入、\n\u003e 无 source_page）；证据等级汇总表计数加静态校验 + 带数字自检示例。\n\n---\n\n## 项目结构\n\n```\nbin/        ask.sh 主入口 · eval · ingest · audit\nknowledge/  97 个病种 YAML（17 专科 · Tier1/2/3）+ 指南叠加层\nprompts/    system · output schema · 专科指引\neval/       gold.yaml 147 题 · judge_prompt\ndocs/       分受众文档（见上表）\n```\n\n---\n\n## 参考\n\n- [CHANGELOG.md](CHANGELOG.md) — 版本记录\n- [docs/roadmap.md](docs/roadmap.md) — 下步计划与已知问题\n- [docs/quality-method.md](docs/quality-method.md) — 质量方法论（分析+研究驱动的主动缺陷发现）\n- [docs/knowledge.md](docs/knowledge.md) — 知识库维护、路由表、eval 方法、目录结构详解\n- 依赖：`bash ≥3.2` / `python3 ≥3.8` / `curl` / `pyyaml` / `pymupdf` / DeepSeek API key\n- Eval 并发：`EVAL_CONCURRENCY=8`（默认）；`./bin/eval.sh --concurrency 16 --mode both` 可调\n- Eval 缓存：生成默认 `--no-cache`（保证新鲜度）；`--cache` 开启；`NO_CACHE=1` 全局绕过\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenhaodev%2Fmed-agent-inner-all","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchenhaodev%2Fmed-agent-inner-all","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenhaodev%2Fmed-agent-inner-all/lists"}