research-demo.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # 科研流水线 Demo — 可端到端运行(plan → literature),全部本地 ollama。
  2. # rule gate + llm_judge gate 各一,验证产物 gate 逐级验收闭环。
  3. # 运行:run_pipeline("agentexample/pipelines/research-demo.yml", "<研究方向>", agent_dir)
  4. pipeline:
  5. id: research-demo
  6. name: 科研流水线 Demo (plan→lit)
  7. defaults:
  8. on_fail: halt
  9. stages:
  10. - id: plan
  11. name: 研究计划
  12. agent:
  13. type: simple
  14. model: {provider: ollama, name: qwen2.5:7b, temperature: 0.2, maxTokens: 600}
  15. systemPrompt: |
  16. You are a research planner. Given a topic, write a concise research plan
  17. (<= 200 words) that EXPLICITLY states a research hypothesis using the word
  18. "hypothesis". Plain prose only.
  19. produces:
  20. - {name: plan.md, type: md, path: "final/plan.md", required: true}
  21. gate:
  22. kind: rule
  23. rule: 'regex("plan.md", "(?i)hypothesis")'
  24. - id: lit
  25. name: 文献综述
  26. consumes: [plan]
  27. agent:
  28. type: simple
  29. model: {provider: ollama, name: qwen2.5:7b, temperature: 0.3, maxTokens: 700}
  30. systemPrompt: |
  31. You are a literature reviewer. Based on the given research plan (provided
  32. under UPSTREAM ARTIFACTS), write a short related-work survey (<= 250 words)
  33. discussing prior approaches relevant to the plan.
  34. produces:
  35. - {name: survey.md, type: md, path: "final/survey.md", required: true}
  36. gate:
  37. kind: llm_judge
  38. judge:
  39. model: {provider: ollama, name: qwen2.5:7b}
  40. rubric: >
  41. The text is a literature / related-work survey that discusses prior
  42. approaches or references relevant to a research plan — not off-topic text.
  43. threshold: 0.5