-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpaperpilot_agent_flow.html
More file actions
1105 lines (1010 loc) · 36.4 KB
/
Copy pathpaperpilot_agent_flow.html
File metadata and controls
1105 lines (1010 loc) · 36.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PaperPilot v1.5 Agent 流程图</title>
<style>
:root {
color-scheme: light;
--ink: #152033;
--muted: #637083;
--line: #d7dee9;
--panel: #ffffff;
--panel-soft: #f8fafc;
--bg: #f3f6fb;
--tool: #2563eb;
--llm: #7c3aed;
--data: #0f766e;
--gate: #c2410c;
--quality: #047857;
--warn: #b42318;
--shadow: 0 18px 45px rgba(21, 32, 51, 0.08);
--shadow-soft: 0 8px 22px rgba(21, 32, 51, 0.06);
--radius: 14px;
}
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
color: var(--ink);
background:
radial-gradient(circle at top left, rgba(37, 99, 235, 0.09), transparent 340px),
radial-gradient(circle at 80% 0%, rgba(124, 58, 237, 0.08), transparent 320px),
linear-gradient(#f7f9fd 0 0),
var(--bg);
line-height: 1.45;
}
body::before {
content: "";
position: fixed;
inset: 0;
pointer-events: none;
background-image:
linear-gradient(rgba(99, 112, 131, 0.08) 1px, transparent 1px),
linear-gradient(90deg, rgba(99, 112, 131, 0.08) 1px, transparent 1px);
background-size: 28px 28px;
mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 70%);
}
.page {
position: relative;
max-width: 1480px;
margin: 0 auto;
padding: 30px 22px 48px;
}
header {
position: relative;
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
gap: 22px;
align-items: center;
padding: 26px;
border: 1px solid rgba(215, 222, 233, 0.92);
border-radius: 20px;
background: rgba(255, 255, 255, 0.86);
box-shadow: var(--shadow);
overflow: hidden;
}
header::after {
content: "";
position: absolute;
right: -120px;
top: -120px;
width: 340px;
height: 340px;
border-radius: 50%;
background: radial-gradient(circle, rgba(15, 118, 110, 0.13), transparent 62%);
}
h1 {
position: relative;
margin: 0;
font-size: 36px;
line-height: 1.16;
letter-spacing: 0;
}
.subtitle {
position: relative;
margin: 10px 0 0;
color: var(--muted);
font-size: 16px;
max-width: 940px;
}
.version {
position: relative;
margin-top: 16px;
display: flex;
flex-wrap: wrap;
gap: 8px;
color: var(--muted);
font-size: 12px;
}
.metrics {
margin-top: 18px;
display: grid;
grid-template-columns: repeat(4, minmax(120px, 1fr));
gap: 10px;
max-width: 760px;
}
.metric {
padding: 10px 12px;
border: 1px solid var(--line);
border-radius: 12px;
background: rgba(248, 250, 252, 0.86);
}
.metric strong {
display: block;
color: var(--ink);
font-size: 18px;
line-height: 1.1;
}
.metric span {
display: block;
margin-top: 4px;
color: var(--muted);
font-size: 11.5px;
}
.pill,
.chip {
display: inline-flex;
align-items: center;
min-height: 28px;
padding: 6px 10px;
border: 1px solid var(--line);
border-radius: 999px;
background: rgba(248, 250, 252, 0.92);
white-space: nowrap;
}
.legend {
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
gap: 8px;
max-width: 470px;
position: relative;
z-index: 1;
}
.chip {
gap: 7px;
font-size: 12px;
color: var(--muted);
}
.dot {
width: 9px;
height: 9px;
border-radius: 50%;
background: var(--tool);
}
.dot.llm { background: var(--llm); }
.dot.data { background: var(--data); }
.dot.gate { background: var(--gate); }
.dot.quality { background: var(--quality); }
.dot.warn { background: var(--warn); }
.flow-wrap {
margin-top: 22px;
overflow-x: auto;
padding: 10px 8px 26px;
}
.flow {
min-width: 1820px;
display: grid;
grid-template-columns: repeat(9, minmax(185px, 1fr));
gap: 22px;
align-items: stretch;
}
.stage {
display: grid;
grid-template-rows: 34px 1fr;
gap: 10px;
min-width: 0;
}
.stage-title {
display: flex;
align-items: center;
font-size: 12px;
font-weight: 800;
letter-spacing: 0.04em;
text-transform: uppercase;
color: var(--muted);
padding-left: 4px;
}
.node {
position: relative;
min-height: 278px;
padding: 17px 16px 16px;
border: 1px solid rgba(215, 222, 233, 0.95);
border-top: 5px solid var(--tool);
border-radius: var(--radius);
background: rgba(255, 255, 255, 0.94);
box-shadow: var(--shadow-soft);
transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.node:hover,
.flow-card:hover,
.panel:hover {
transform: translateY(-2px);
box-shadow: var(--shadow);
}
.node::after {
content: "";
position: absolute;
top: 50%;
right: -22px;
width: 22px;
border-top: 2px solid var(--line);
}
.node::before {
content: "";
position: absolute;
top: calc(50% - 5px);
right: -25px;
width: 0;
height: 0;
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
border-left: 8px solid var(--line);
}
.stage:last-child .node::before,
.stage:last-child .node::after {
display: none;
}
.node.llm { border-top-color: var(--llm); }
.node.data { border-top-color: var(--data); }
.node.gate { border-top-color: var(--gate); }
.node.quality { border-top-color: var(--quality); }
.node.warn { border-top-color: var(--warn); }
.node h2 {
margin: 0 0 10px;
font-size: 16px;
line-height: 1.25;
letter-spacing: 0;
}
.node p {
margin: 0;
font-size: 13px;
line-height: 1.5;
color: var(--muted);
}
.node ul {
margin: 12px 0 0;
padding-left: 18px;
color: var(--muted);
font-size: 12.2px;
line-height: 1.45;
}
.node li + li {
margin-top: 5px;
}
code,
.file,
.code {
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.layers {
margin-top: 18px;
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 14px;
}
.panel {
border: 1px solid var(--line);
border-radius: var(--radius);
background: rgba(255, 255, 255, 0.94);
box-shadow: var(--shadow-soft);
padding: 16px;
transition: transform .18s ease, box-shadow .18s ease;
}
.panel h2 {
margin: 0 0 10px;
font-size: 17px;
line-height: 1.25;
letter-spacing: 0;
}
.panel p,
.panel li {
color: var(--muted);
font-size: 13px;
}
.panel ul {
margin: 0;
padding-left: 18px;
}
.code {
margin: 9px 0 0;
padding: 9px 10px;
border: 1px solid #d9dee8;
border-radius: 10px;
background: var(--panel-soft);
color: #1f2937;
font-size: 12px;
overflow-x: auto;
white-space: nowrap;
}
.outputs {
display: grid;
grid-template-columns: repeat(5, minmax(0, 1fr));
gap: 8px;
margin-top: 10px;
}
.file {
min-height: 32px;
display: flex;
align-items: center;
padding: 8px 9px;
border: 1px solid #d9dee8;
border-radius: 10px;
background: #f8fafc;
color: #1f2937;
font-size: 11.5px;
overflow-wrap: anywhere;
}
.matrix {
margin-top: 18px;
border: 1px solid var(--line);
border-radius: var(--radius);
background: rgba(255, 255, 255, 0.94);
box-shadow: var(--shadow-soft);
overflow: hidden;
}
.matrix h2 {
margin: 0;
padding: 15px 16px 10px;
font-size: 17px;
}
.agent-map {
margin-top: 18px;
border: 1px solid var(--line);
border-radius: var(--radius);
background: rgba(255, 255, 255, 0.94);
box-shadow: var(--shadow-soft);
padding: 18px;
overflow-x: auto;
}
.agent-map h2 {
margin: 0 0 6px;
font-size: 17px;
line-height: 1.25;
}
.agent-map > p {
margin: 0 0 14px;
color: var(--muted);
font-size: 13px;
}
.dataflow {
min-width: 1180px;
display: grid;
grid-template-columns: 170px 1fr 170px;
gap: 16px;
align-items: stretch;
}
.flow-column {
display: grid;
gap: 10px;
align-content: start;
}
.lane {
display: grid;
grid-template-columns: repeat(4, minmax(170px, 1fr));
gap: 12px;
}
.flow-card {
position: relative;
min-height: 94px;
padding: 11px 12px;
border: 1px solid var(--line);
border-top: 4px solid var(--tool);
border-radius: 12px;
background: #ffffff;
box-shadow: 0 8px 18px rgba(21, 32, 51, 0.04);
transition: transform .18s ease, box-shadow .18s ease;
}
.flow-card.llm { border-top-color: var(--llm); }
.flow-card.data { border-top-color: var(--data); }
.flow-card.gate { border-top-color: var(--gate); }
.flow-card.quality { border-top-color: var(--quality); }
.flow-card.warn { border-top-color: var(--warn); }
.flow-card h3 {
margin: 0 0 5px;
font-size: 13px;
line-height: 1.25;
letter-spacing: 0;
}
.flow-card p {
margin: 0;
color: var(--muted);
font-size: 11.5px;
}
.flow-card ul {
margin: 6px 0 0;
padding-left: 16px;
color: var(--muted);
font-size: 11px;
}
.flow-card.arrow-right::after {
content: "";
position: absolute;
right: -14px;
top: 44px;
width: 14px;
border-top: 2px solid var(--line);
}
.flow-card.arrow-right::before {
content: "";
position: absolute;
right: -18px;
top: 39px;
width: 0;
height: 0;
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
border-left: 8px solid var(--line);
}
.flow-stack-title {
color: var(--muted);
font-size: 11px;
font-weight: 800;
letter-spacing: 0.04em;
text-transform: uppercase;
}
.flow-band {
margin-top: 12px;
display: grid;
grid-template-columns: repeat(5, minmax(170px, 1fr));
gap: 12px;
}
.dataflow-note {
margin-top: 12px;
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 10px;
}
.note-card {
padding: 10px 11px;
border: 1px solid var(--line);
border-radius: 12px;
background: #f8fafc;
color: var(--muted);
font-size: 12px;
}
table {
width: 100%;
border-collapse: collapse;
font-size: 12.5px;
}
th,
td {
padding: 9px 10px;
border-top: 1px solid var(--line);
text-align: left;
vertical-align: top;
}
th {
color: var(--ink);
background: #f1f5f9;
font-weight: 800;
}
td {
color: var(--muted);
}
@media (max-width: 980px) {
header,
.layers {
grid-template-columns: 1fr;
}
.legend {
justify-content: flex-start;
}
.outputs {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
h1 {
font-size: 28px;
}
.dataflow-note {
grid-template-columns: 1fr;
}
.metrics {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.page {
padding: 22px 14px 34px;
}
}
</style>
</head>
<body>
<main class="page">
<header>
<div>
<h1>PaperPilot v1.5 Agent 流程图</h1>
<p class="subtitle">从自然语言调研需求到研究协议、分层 Source Registry、可审计语料、证据验证、质量门、中英文 APA 风格报告和 Obsidian Wiki。v1.5 默认最多纳入 100 篇文献,不再强制最低 30 篇,并支持 Papers.cool、DeepXiv / Agentic Data、Rich 彩色终端、/doctor 自检和可追踪 Wiki 输出。</p>
<div class="version">
<span class="pill">v1.5 architecture</span>
<span class="pill">State-machine workflow</span>
<span class="pill">Canonical bilingual report</span>
<span class="pill">100-paper default cap</span>
<span class="pill">Obsidian Wiki</span>
<span class="pill">Citation-numbered reports</span>
<span class="pill">Prompt / Tool / Capability registry</span>
</div>
<div class="metrics" aria-label="架构摘要">
<div class="metric">
<strong>9</strong>
<span>workflow stages</span>
</div>
<div class="metric">
<strong>7</strong>
<span>versioned prompts</span>
</div>
<div class="metric">
<strong>19</strong>
<span>paper sources</span>
</div>
<div class="metric">
<strong>7</strong>
<span>report + wiki outputs</span>
</div>
</div>
</div>
<div class="legend" aria-label="模块图例">
<span class="chip"><span class="dot llm"></span>LLM Agent</span>
<span class="chip"><span class="dot"></span>确定性工具</span>
<span class="chip"><span class="dot data"></span>语料 / 数据</span>
<span class="chip"><span class="dot gate"></span>配置 / 入口</span>
<span class="chip"><span class="dot quality"></span>质量门</span>
<span class="chip"><span class="dot warn"></span>人工关注</span>
</div>
</header>
<section class="flow-wrap" aria-label="PaperPilot v1.5 主流程">
<div class="flow">
<div class="stage">
<div class="stage-title">Intake</div>
<article class="node gate">
<h2>CLI / 交互入口</h2>
<p>用户输入 <strong>PaperPilot</strong> 或命令式 topic,系统创建唯一 run folder,并写入可观察事件流。</p>
<ul>
<li>显示 active model</li>
<li><code>/model</code> 管理模型</li>
<li><code>/sources</code> 查看来源/API 状态</li>
<li>Rich 面板确认解析后的研究需求</li>
<li><code>state.json</code> 记录阶段</li>
<li><code>events.jsonl</code> 记录事件流</li>
<li><code>PaperPilot inspect</code> 查看任务</li>
</ul>
</article>
</div>
<div class="stage">
<div class="stage-title">Config</div>
<article class="node gate">
<h2>LLM 配置门禁</h2>
<p>未检测到可用 LLM 时,先引导配置并测试连通性,通过后才进入系统。</p>
<ul>
<li>手动输入 API Key</li>
<li>导入本地 <code>api.json</code></li>
<li>缓存到 <code>~/.paperpilot/config.json</code></li>
<li>原文件删除后不影响使用</li>
</ul>
</article>
</div>
<div class="stage">
<div class="stage-title">Protocol</div>
<article class="node llm">
<h2>Prompted Protocol</h2>
<p>通过版本化 Prompt Registry 驱动需求解析、检索计划和研究协议生成。</p>
<ul>
<li><code>query_understanding.md</code></li>
<li><code>plan.json</code></li>
<li><code>protocol.json</code></li>
<li><code>prompt_manifest.json</code> 记录角色与版本</li>
<li>负面关键词约束偏题结果</li>
</ul>
</article>
</div>
<div class="stage">
<div class="stage-title">Search</div>
<article class="node">
<h2>Source Registry Search</h2>
<p>并发调用分层论文来源;默认启用免 key 来源,配置 API key 后自动启用高覆盖 optional sources。</p>
<ul>
<li>arXiv / Semantic Scholar / OpenAlex</li>
<li>Crossref / OpenReview / DBLP / ACL</li>
<li>PubMed / Europe PMC / bioRxiv / medRxiv / Papers.cool</li>
<li>DeepXiv / CORE / Lens / IEEE / Springer / Elsevier / Dimensions</li>
<li><code>source_diagnostics.json</code></li>
<li><code>registries.json</code></li>
<li><code>user_corpus_log.json</code></li>
</ul>
</article>
</div>
<div class="stage">
<div class="stage-title">Corpus</div>
<article class="node data">
<h2>Normalize + Corpus</h2>
<p>标准化论文模型,增强去重,并统一代码资源字段。</p>
<ul>
<li>DOI / arXiv / PMID / PMCID / OpenReview / DBLP</li>
<li>标题相似度合并预印本和发表版</li>
<li><code>CodeArtifact</code> 置信度</li>
<li><code>corpus.json</code></li>
</ul>
</article>
</div>
<div class="stage">
<div class="stage-title">Screening</div>
<article class="node llm">
<h2>Relevance Screening</h2>
<p>将候选论文分为核心、相关但非核心、排除,减少偏题污染。</p>
<ul>
<li><code>core_papers.json</code></li>
<li><code>adjacent_papers.json</code></li>
<li><code>excluded_papers.json</code></li>
<li><code>github_filter</code> 只影响最终视图</li>
</ul>
</article>
</div>
<div class="stage">
<div class="stage-title">Verify</div>
<article class="node quality">
<h2>Verification + PDF</h2>
<p>验证 DOI、URL、PDF 和代码链接状态,只下载明确开放 PDF。</p>
<ul>
<li><code>verification.json</code></li>
<li><code>download_log.json</code></li>
<li><code>fulltext/</code></li>
<li><code>paper_notes.json</code></li>
</ul>
</article>
</div>
<div class="stage">
<div class="stage-title">Synthesis</div>
<article class="node llm">
<h2>Evidence Synthesis</h2>
<p>基于已筛选语料生成方法矩阵、主题综合、争议点和研究空白。</p>
<ul>
<li><code>literature_matrix.json</code></li>
<li><code>synthesis.json</code></li>
<li>缺失证据标记 <code>MATERIAL GAP</code></li>
<li>不凭空补全文结论</li>
</ul>
</article>
</div>
<div class="stage">
<div class="stage-title">Report</div>
<article class="node quality">
<h2>Review + Report</h2>
<p>运行质量门、claim 级证据账本和复核 Agent,再由 canonical model 渲染中英文 Markdown、HTML 和 PDF。</p>
<ul>
<li><code>quality_gate.json</code></li>
<li><code>evidence_ledger.json</code></li>
<li><code>review_agent_findings.json</code></li>
<li><code>report.canonical.json</code> 保存 citation map</li>
<li><code>report.zh.md</code> / <code>report.en.md</code></li>
<li><code>report.zh.html</code> / <code>report.en.html</code></li>
<li><code>report.zh.pdf</code> / <code>report.en.pdf</code></li>
<li>参考文献附带论文链接和代码仓库链接</li>
</ul>
</article>
</div>
</div>
</section>
<section class="agent-map" aria-label="Agent 数据流向交互图">
<h2>Agent 数据流向与交互图</h2>
<p>这张图展示一次 PaperPilot run 里,用户输入、Prompt/Tool/Capability 注册表、各类 Agent、确定性工具、证据账本和报告渲染之间的真实数据流。</p>
<div class="dataflow">
<div class="flow-column">
<div class="flow-stack-title">Input</div>
<article class="flow-card gate arrow-right">
<h3>用户需求</h3>
<p>自然语言 topic、CLI 参数、模型配置、本地语料。</p>
<ul>
<li><code>keyword</code></li>
<li><code>--user-corpus</code></li>
<li><code>--github-filter</code></li>
</ul>
</article>
<article class="flow-card data arrow-right">
<h3>Run Context</h3>
<p>创建任务目录,写入状态、事件和注册表清单。</p>
<ul>
<li><code>task.json</code></li>
<li><code>state.json</code></li>
<li><code>events.jsonl</code></li>
</ul>
</article>
</div>
<div>
<div class="flow-stack-title">Agent + Tool Pipeline</div>
<div class="lane">
<article class="flow-card llm arrow-right">
<h3>QueryUnderstandingAgent</h3>
<p>理解关键词、歧义、范围和推荐方向。</p>
<ul>
<li>in: user topic</li>
<li>out: <code>query_understanding.md</code></li>
</ul>
</article>
<article class="flow-card llm arrow-right">
<h3>PlannerAgent</h3>
<p>生成英文检索式、子方向和来源策略。</p>
<ul>
<li>in: query understanding</li>
<li>out: <code>plan.json</code></li>
</ul>
</article>
<article class="flow-card llm arrow-right">
<h3>ResearchProtocolAgent</h3>
<p>定义研究问题、纳入/排除标准和负面关键词。</p>
<ul>
<li>in: plan</li>
<li>out: <code>protocol.json</code></li>
</ul>
</article>
<article class="flow-card data">
<h3>Prompt Registry</h3>
<p>所有 LLM Agent 通过版本化 prompt 和必需 JSON 字段运行。</p>
<ul>
<li><code>prompt_manifest.json</code></li>
</ul>
</article>
</div>
<div class="flow-band">
<article class="flow-card arrow-right">
<h3>Search Tools</h3>
<p>Source Registry、多源 API 与本地语料共同进入候选池。</p>
<ul>
<li>AI/CS: arXiv / OpenReview / DBLP / ACL / DeepXiv</li>
<li>BioMed: PubMed / Europe PMC / bioRxiv / medRxiv / DeepXiv</li>
<li>General: S2 / OpenAlex / Crossref / optional-key sources</li>
<li><code>source_diagnostics.json</code></li>
<li><code>user_corpus_log.json</code></li>
</ul>
</article>
<article class="flow-card data arrow-right">
<h3>Corpus Builder</h3>
<p>标准化、去重、排序和代码链接解析。</p>
<ul>
<li><code>metadata.json</code></li>
<li><code>corpus.json</code></li>
</ul>
</article>
<article class="flow-card llm arrow-right">
<h3>RelevanceJudgeAgent</h3>
<p>把论文划分为 core、adjacent、exclude。</p>
<ul>
<li><code>core_papers.json</code></li>
<li><code>excluded_papers.json</code></li>
</ul>
</article>
<article class="flow-card quality arrow-right">
<h3>Verification Tools</h3>
<p>检查 DOI、URL、PDF、代码状态并提取全文。</p>
<ul>
<li><code>verification.json</code></li>
<li><code>fulltext/</code></li>
</ul>
</article>
<article class="flow-card data">
<h3>Tool / Capability Registry</h3>
<p>记录工具层和能力层边界,给后续插件化留接口。</p>
<ul>
<li><code>registries.json</code></li>
</ul>
</article>
</div>
<div class="flow-band">
<article class="flow-card llm arrow-right">
<h3>SynthesisAgent</h3>
<p>生成综述正文、方法流派、逐篇总结和趋势。</p>
<ul>
<li><code>literature_matrix.json</code></li>
<li><code>synthesis.json</code></li>
</ul>
</article>
<article class="flow-card quality arrow-right">
<h3>Quality Gate</h3>
<p>检查论文数量、PDF/代码覆盖率、偏题率和来源覆盖。</p>
<ul>
<li><code>quality_gate.json</code></li>
<li><code>reflection.json</code></li>
</ul>
</article>
<article class="flow-card quality arrow-right">
<h3>Evidence Ledger</h3>
<p>把报告 claim 绑定到论文编号引用。</p>
<ul>
<li>claim -> <code>[1]</code>/<code>[2]</code></li>
<li><code>evidence_ledger.json</code></li>
</ul>
</article>
<article class="flow-card llm arrow-right">
<h3>Review Agents</h3>
<p>来源、相关性、引用合规和过度断言复核。</p>
<ul>
<li>SourceVerifier</li>
<li>CitationCompliance</li>
<li>DevilsAdvocate</li>
</ul>
</article>
<article class="flow-card data">
<h3>Canonical Report</h3>
<p>中英文、HTML、PDF 共用同一个规范化报告模型。</p>
<ul>
<li><code>report.canonical.json</code></li>
<li><code>citation_map</code></li>
</ul>
</article>
</div>
</div>
<div class="flow-column">
<div class="flow-stack-title">Output</div>
<article class="flow-card quality">
<h3>Report Renderer</h3>
<p>从 canonical 渲染中文、英文、HTML、PDF,并同步输出 Obsidian Wiki。</p>
<ul>
<li><code>report.zh.md/html/pdf</code></li>
<li><code>report.en.md/html/pdf</code></li>
<li><code>obsidian_wiki/</code></li>
</ul>
</article>
<article class="flow-card data">
<h3>Inspect / Resume</h3>
<p>用户可查看事件、质量门、证据账本和复核结果,或复用任务目录重跑。</p>
<ul>
<li><code>PaperPilot inspect</code></li>
<li><code>PaperPilot resume</code></li>
</ul>
</article>
</div>
</div>
<div class="dataflow-note">
<div class="note-card">LLM Agent 只做理解、规划、筛选、综合和审稿;API 请求、下载、去重、排序和渲染由确定性工具完成。</div>
<div class="note-card">所有关键阶段同时写入 artifact 和 <code>events.jsonl</code>,所以失败后能定位卡在哪个阶段。</div>
<div class="note-card">报告中的论文编号来自同一份 <code>report.canonical.json</code>,避免中英文、HTML、PDF 引用错位。</div>
</div>
</section>
<section class="layers" aria-label="关键架构层">
<article class="panel">
<h2>v1.5 状态机与事件流</h2>
<p>PaperPilot 不是简单线性脚本,而是保存阶段状态的研究工作流。每个 run folder 都有状态、清单、Wiki 和可审计中间产物。</p>
<div class="code">Intake -> Protocol -> Search -> Corpus -> Screening -> Verification -> Synthesis -> Review -> Report</div>
<ul>
<li><code>state.json</code> 记录每个阶段的完成情况。</li>
<li><code>events.jsonl</code> 记录 start、progress、stage、done 等事件。</li>
<li><code>manifest.json</code> 记录最终产物清单和模型信息。</li>
<li><code>obsidian_wiki/</code> 输出论文、方法、主题和 claim note。</li>
<li><code>PaperPilot inspect <task-id></code> 可查看质量门、证据账本和复核结果。</li>
</ul>
</article>
<article class="panel">
<h2>质量门与偏题控制</h2>
<p>报告质量不再只依赖排序分数,核心语料先经过纳入/排除标准和相关性筛选,然后生成综述级正文。</p>
<ul>
<li>gRNAde 这类预印本/发表版通过标题相似度合并。</li>
<li>AutoDock Vina、RNA-SeQC、ProLIF、RTM-align 等偏题工具进入 <code>exclude</code>。</li>
<li>正式报告默认最多 100 篇,不再强制最低篇数;只有没有可报告论文时写入 <code>shortfall.json</code>。</li>
<li><code>quality_gate.json</code> 输出 <code>pass</code>、<code>retry</code> 或 <code>needs_user_attention</code>。</li>
</ul>
</article>
<article class="panel">
<h2>统一引用编号</h2>
<p>报告生成阶段会以最终 <code>report.papers</code> 排序为唯一编号来源,把结构化论文位置都渲染成 <code>[1]</code>、<code>[2]</code> 这类引用。</p>
<div class="code">report.papers -> citation_map -> paper_summaries / method_taxonomy / tables / references</div>
<ul>
<li>逐篇总结、方法流派代表论文、核心论文表、证据矩阵、代码表和 PDF 表都带编号。</li>
<li>中英文 Markdown、HTML、PDF 共享同一个 <code>report.canonical.json</code>,编号和排序一致。</li>
<li>参考文献区按 <code>[n]</code> 列出论文,若找到仓库则附带 Repository 链接。</li>
</ul>
</article>
<article class="panel">
<h2>Evidence Ledger + Review Agents</h2>
<p>报告不只输出正文,还会为关键综述 claim 建立证据账本,并由轻量复核 Agent 检查来源、相关性、引用一致性和过度断言风险。</p>
<div class="code">canonical report -> evidence_ledger.json -> review_agent_findings.json -> final report</div>
<ul>
<li><code>evidence_ledger.json</code> 把 claim 绑定到 <code>[1]</code>、<code>[2]</code> 等论文引用。</li>
<li><code>SourceVerifierAgent</code> 检查 DOI、URL、PDF、代码状态。</li>
<li><code>CitationComplianceAgent</code> 检查引用编号是否来自同一个 canonical paper list。</li>
<li><code>DevilsAdvocateAgent</code> 标记小语料、质量门未过、证据缺口等过度解读风险。</li>
</ul>
</article>
<article class="panel">
<h2>Prompt / Tool / Capability Registry</h2>
<p>Prompt 不再只是散落在 Python 函数里的字符串,而是带角色、版本和必需 JSON 字段的注册表。工具和能力也会写入运行目录,方便后续插件化。</p>
<div class="code">prompt_manifest.json + registries.json + events.jsonl</div>
<ul>
<li>Prompt Registry 管理 QueryUnderstanding、Planner、Protocol、Screening、Synthesis、Reflection、Abstract。</li>
<li>Source Registry 记录 arXiv、Semantic Scholar、OpenAlex、Crossref、OpenReview、PubMed、Europe PMC、bioRxiv、medRxiv、DBLP、ACL Anthology、Papers.cool、DeepXiv / Agentic Data 以及 optional-key sources。</li>
<li>ToolRegistry 记录 GitHub、PDF、fulltext、report renderer 等非搜索工具。</li>
<li>CapabilityRegistry 预留 literature_review、systematic_review、code_reproducibility_review 和 topic_monitoring。</li>
</ul>
</article>
<article class="panel">
<h2>用户语料入口</h2>
<p>除了在线检索,用户可以把已有 PDF、BibTeX、RIS、Markdown 或文本目录交给 PaperPilot,系统会把它们并入候选语料并记录导入日志。</p>
<div class="code">--user-corpus ./papers --user-corpus references.bib</div>
<ul>
<li>本地 PDF 会以文件名作为最小标题进入语料,后续仍参与筛选和去重。</li>
<li>BibTeX / RIS 会尽量解析标题、作者、年份、DOI 和 URL。</li>