-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.py
More file actions
51 lines (39 loc) · 1.1 KB
/
Copy pathmain.py
File metadata and controls
51 lines (39 loc) · 1.1 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
"""
Crux AgenticRAG 框架入口
使用方法:
python main.py
"""
import time
from src.crux import AgentGraph, CruxConfig
def main():
# 创建配置
config = CruxConfig(
data_source_type="json",
data_source_path="data/ir_papers.json",
schema_type="paper",
mock_llm=False,
debug=True,
)
# 构建图
graph = AgentGraph(config)
app = graph.build()
# 测试查询 - 论文检索场景
user_query = "帮我找一下关于信息检索和 RAG 检索增强生成的最新研究,尤其是智能体相关的论文"
print("=" * 60)
print("[START] Crux AgenticRAG Demo")
print("=" * 60)
print(f"\n[QUERY] {user_query}\n")
# 准备输入
inputs = {
"user_query": user_query,
"verified_evidence": [],
"search_iteration": 0,
"schema_type": "paper",
"start_time": time.time(),
}
# 运行图
final_state = graph.invoke(inputs)
# 输出结果
print("\n" + final_state.get("final_report", "无报告生成"))
if __name__ == "__main__":
main()