DEV Community

GhostFace
GhostFace

Posted on

We Open-Sourced a Methodology That Teaches LLMs to Actually Think

Agentic Method — not more prompts, but a workflow that makes model output observable, falsifiable, and evolvable.

GitHub logo Ghost-Silver / Agentic-Method

A Agentic Prompt System to improve LLMs.

Agentic Method · 智能体方法论

License: MIT Prompts Examples Methodology

一套严谨、证据驱动的自主智能体方法论。

观察 → 假设 → 实验 → 观测更新 → 知识更新
Observation → Hypothesis → Experiment → Observation Update → Knowledge Update

English Version


这是什么?

Agentic Method 是一组元提示词(meta-prompts)与子智能体协议,面向高风险的工程、研究与决策任务。它不是轻量级的聊天提示词库,而是一套工作流系统,强制智能体:

  1. 冻结上下文后再行动。
  2. 生成竞争性假设,而非单一答案。
  3. 在实验前做出可证伪的量化预测
  4. 报告观测与裁决,而非仅有结论。
  5. 归档失败并诚实更新世界模型。
  6. 通过受控的并行评测进化自身提示词

设计原理

当前的中低端模型已经具备足够强的指令遵循能力,其真正落后于高端模型的地方是零样本推理能力。然而,即使是高端模型,在面对大型代码开发或复杂科研问题时,也难免产生逻辑谬误与模型幻觉。

Agentic Method 通过以下机制解决这一问题:

  • 严格 DSL 锚定:用 (CTX)(H)(EXP)(PREDICTION)(OBSERVATION)(VERDICT) 等标签将模型的解码空间约束到特定任务区域,显著降低幻觉。
  • 强制深层推理:每个关键结论必须附带置信度 (CONF) 与证据等级,模型不能停留在表面回答。
  • 子 Agent 交叉审查:通过 FORM_REVIEWERHYPOTHESIS_VALIDATORCOUNTEREXAMPLE_REVIEWER 等角色识别循环论证、隐藏假设与事后合理化。
  • 引入科研方法:反事实推理、二分实验、消融实验、对照实验、思想实验等方法被显式嵌入工作流,强制模型进行高阶思考。

本质上,我们不是让模型“更聪明”,而是让模型的思考过程更可观测、可证伪、可审计

模型要求与成本策略

推荐配置

为完整运行本协议中的复杂任务(尤其是涉及多文件代码审查、架构决策、长链条因果推理),推荐使用:

  • 参数量:200B+
  • 上下文窗口:200K+
  • 能力:强指令遵循、长上下文稳定、支持工具调用(用于子 Agent)

降低成本的关键策略

本协议会消耗大量 token 与上下文,但这种消耗对任务质量的提升是显著的。最佳实践是按需加载 + 模型路由

  • 主 Agent / 编排层:使用最强模型,负责任务分解、假设生成、最终裁决。
  • 子 Agent / 审查层:使用更便宜的模型,负责格式审查、假设验证、反例构造等子任务。
  • 按需加载:不要让 Agent 一次性加载全部 prompt。让它先读取 main.md,再根据当前任务类型加载对应的核心 prompt。
  • 定时进化:在每天空闲时间运行 prompt-evolution-prompt.md 对已有 prompt 进行 PEL 迭代。

在良好 prompt 的加持下,中等模型在特定子任务上可以接近甚至媲美更高级模型。

推荐工作流

Step 1: Agent 读取 main.md,理解全局协议与可用 prompt 目录
        ↓
Step 2: 用户告诉

The Problem Is Becoming Obvious

Today's LLMs — especially mid-range models — already have strong instruction-following abilities. Ask them to format output, follow steps, call tools: they mostly comply.

But as soon as the task gets complex — reviewing a multi-file code change, designing a controlled experiment, or reasoning about the root cause of a system bug — models tend to fail in two characteristic ways:

  1. Hallucination: confidently stating conclusions with no grounding.
  2. Post-hoc rationalization: jumping to an answer first, then fabricating a plausible chain of reasoning afterward (fake CoT).

The issue isn't that models aren't "smart enough." It's that their decoding space is too unconstrained. Without external scaffolding, nothing anchors them to the track of "correct reasoning."


Our Approach: Constrain the Decoding Space with Methodology

Agentic Method is not a collection of prompts. It is a meta-workflow that externalizes, structures, and audits the model's reasoning process through four mechanisms:

1. Strict DSL Anchoring

Tags like (CTX), (H), (PREDICTION), (OBSERVATION), (VERDICT) force the model to declare at every critical step:

  • What is the current context?
  • What is the hypothesis?
  • What is the falsifiable prediction?
  • What was actually observed?
  • What is the final verdict?

This turns output from free-form prose into structured scientific records — and hallucinations drop dramatically.

2. Forced Deep Reasoning

Every key conclusion must carry:

  • Evidence grade (F0-F4)
  • Confidence (CONF: <level>, <evidence summary>)
  • At least one competing hypothesis (BRANCH)
  • Explicit falsification conditions (FALSIFICATION)

No more surface-level answers.

3. Sub-Agent Cross-Review

Roles like FORM_REVIEWER, HYPOTHESIS_VALIDATOR, and COUNTEREXAMPLE_REVIEWER make agents audit each other. Circular reasoning, hidden assumptions, and post-hoc rationalizations get flagged explicitly.

4. Embedded Scientific Method

Bisection, ablation, controlled experiments, and counterfactual reasoning are not just suggestions in a document. They are non-skippable steps embedded in the prompts.


30 Core Prompts for High-Stakes Tasks

The repo includes 30 desensitized, reusable core prompts:

  • experimental-design-prompt.md — design verifiable experiments
  • logical-inference-prompt.md — rigorous logical reasoning and proof review
  • code-review-prompt.md — systematic code review
  • debug-prompt.md — causal diagnosis and repair
  • performance-optimization-prompt.md — performance decision protocol
  • prompt-evolution-prompt.mdlet prompts evolve themselves
  • subagent-protocol.md — protocol for 18 sub-agent roles
  • ...and many more

All prompts share the same DSL and can be loaded on demand, composed, and evolved.


Prompt Evolution Loop (PEL)

Perhaps the most interesting part is the Prompt Evolution Loop (PEL).

The idea is simple: take a seed prompt, generate multiple mutated variants, evaluate them in parallel on the same set of real tasks, and keep the fittest ones.

Our example report shows one real PEL run:

  • The CONSTRAINT_ADD mutation fixed a P0 protocol-consistency defect.
  • The ANTI_PATTERN_BLOCK mutation had to be discarded because it contradicted existing rules.
  • The EXAMPLE_INJECT mutation only worked when examples were bound to concrete checklist items.

These findings are themselves evidence that prompt engineering can move from alchemy to experimental science.


Recommended Setup

This methodology is designed for high-stakes tasks and consumes more tokens and context. We believe it's worth it.

  • Main agent / orchestration: 200B+ parameters, 200K+ context window
  • Sub-agent / review layer: cheaper medium-sized models
  • How to run: read main.md first, then load only the prompt matching your current task

Where It Helps

  • Complex code review and architecture decisions
  • Root-cause bug diagnosis
  • Performance optimization experiment design
  • Scientific argumentation and technology surveys
  • Any task where a wrong statement is expensive

Open Source, MIT License

We want this methodology to be validated, improved, and applied across more domains.

If you:

  • Apply it to a domain outside software engineering or research;
  • Evolve a better prompt variant through PEL;
  • Find a flaw in any prompt;

Please open an Issue or PR on GitHub. The community will accumulate domain-specific adapters and best practices together.


Next Steps

  1. Open the repo:

    GitHub logo Ghost-Silver / Agentic-Method

    A Agentic Prompt System to improve LLMs.

    Agentic Method · 智能体方法论

    License: MIT Prompts Examples Methodology

    一套严谨、证据驱动的自主智能体方法论。

    观察 → 假设 → 实验 → 观测更新 → 知识更新
    Observation → Hypothesis → Experiment → Observation Update → Knowledge Update

    English Version


    这是什么?

    Agentic Method 是一组元提示词(meta-prompts)与子智能体协议,面向高风险的工程、研究与决策任务。它不是轻量级的聊天提示词库,而是一套工作流系统,强制智能体:

    1. 冻结上下文后再行动。
    2. 生成竞争性假设,而非单一答案。
    3. 在实验前做出可证伪的量化预测
    4. 报告观测与裁决,而非仅有结论。
    5. 归档失败并诚实更新世界模型。
    6. 通过受控的并行评测进化自身提示词

    设计原理

    当前的中低端模型已经具备足够强的指令遵循能力,其真正落后于高端模型的地方是零样本推理能力。然而,即使是高端模型,在面对大型代码开发或复杂科研问题时,也难免产生逻辑谬误与模型幻觉。

    Agentic Method 通过以下机制解决这一问题:

    • 严格 DSL 锚定:用 (CTX)(H)(EXP)(PREDICTION)(OBSERVATION)(VERDICT) 等标签将模型的解码空间约束到特定任务区域,显著降低幻觉。
    • 强制深层推理:每个关键结论必须附带置信度 (CONF) 与证据等级,模型不能停留在表面回答。
    • 子 Agent 交叉审查:通过 FORM_REVIEWERHYPOTHESIS_VALIDATORCOUNTEREXAMPLE_REVIEWER 等角色识别循环论证、隐藏假设与事后合理化。
    • 引入科研方法:反事实推理、二分实验、消融实验、对照实验、思想实验等方法被显式嵌入工作流,强制模型进行高阶思考。

    本质上,我们不是让模型“更聪明”,而是让模型的思考过程更可观测、可证伪、可审计

    模型要求与成本策略

    推荐配置

    为完整运行本协议中的复杂任务(尤其是涉及多文件代码审查、架构决策、长链条因果推理),推荐使用:

    • 参数量:200B+
    • 上下文窗口:200K+
    • 能力:强指令遵循、长上下文稳定、支持工具调用(用于子 Agent)

    降低成本的关键策略

    本协议会消耗大量 token 与上下文,但这种消耗对任务质量的提升是显著的。最佳实践是按需加载 + 模型路由

    • 主 Agent / 编排层:使用最强模型,负责任务分解、假设生成、最终裁决。
    • 子 Agent / 审查层:使用更便宜的模型,负责格式审查、假设验证、反例构造等子任务。
    • 按需加载:不要让 Agent 一次性加载全部 prompt。让它先读取 main.md,再根据当前任务类型加载对应的核心 prompt。
    • 定时进化:在每天空闲时间运行 prompt-evolution-prompt.md 对已有 prompt 进行 PEL 迭代。

    在良好 prompt 的加持下,中等模型在特定子任务上可以接近甚至媲美更高级模型。

    推荐工作流

    Step 1: Agent 读取 main.md,理解全局协议与可用 prompt 目录
            ↓
    Step 2: 用户告诉
  2. Start with core/master-prompt.md
  3. Pick a hard task you're currently struggling with, and try experimental-design-prompt.md or debug-prompt.md
  4. If it works, give us a ⭐ or share your use case

This is not another prompt repo. This is a workflow that teaches LLMs to think like scientists.

GitHub logo Ghost-Silver / Agentic-Method

A Agentic Prompt System to improve LLMs.

Agentic Method · 智能体方法论

License: MIT Prompts Examples Methodology

一套严谨、证据驱动的自主智能体方法论。

观察 → 假设 → 实验 → 观测更新 → 知识更新
Observation → Hypothesis → Experiment → Observation Update → Knowledge Update

English Version



这是什么?

Agentic Method 是一组元提示词(meta-prompts)与子智能体协议,面向高风险的工程、研究与决策任务。它不是轻量级的聊天提示词库,而是一套工作流系统,强制智能体:

  1. 冻结上下文后再行动。
  2. 生成竞争性假设,而非单一答案。
  3. 在实验前做出可证伪的量化预测
  4. 报告观测与裁决,而非仅有结论。
  5. 归档失败并诚实更新世界模型。
  6. 通过受控的并行评测进化自身提示词

设计原理

当前的中低端模型已经具备足够强的指令遵循能力,其真正落后于高端模型的地方是零样本推理能力。然而,即使是高端模型,在面对大型代码开发或复杂科研问题时,也难免产生逻辑谬误与模型幻觉。

Agentic Method 通过以下机制解决这一问题:

  • 严格 DSL 锚定:用 (CTX)(H)(EXP)(PREDICTION)(OBSERVATION)(VERDICT) 等标签将模型的解码空间约束到特定任务区域,显著降低幻觉。
  • 强制深层推理:每个关键结论必须附带置信度 (CONF) 与证据等级,模型不能停留在表面回答。
  • 子 Agent 交叉审查:通过 FORM_REVIEWERHYPOTHESIS_VALIDATORCOUNTEREXAMPLE_REVIEWER 等角色识别循环论证、隐藏假设与事后合理化。
  • 引入科研方法:反事实推理、二分实验、消融实验、对照实验、思想实验等方法被显式嵌入工作流,强制模型进行高阶思考。

本质上,我们不是让模型“更聪明”,而是让模型的思考过程更可观测、可证伪、可审计

模型要求与成本策略

推荐配置

为完整运行本协议中的复杂任务(尤其是涉及多文件代码审查、架构决策、长链条因果推理),推荐使用:

  • 参数量:200B+
  • 上下文窗口:200K+
  • 能力:强指令遵循、长上下文稳定、支持工具调用(用于子 Agent)

降低成本的关键策略

本协议会消耗大量 token 与上下文,但这种消耗对任务质量的提升是显著的。最佳实践是按需加载 + 模型路由

  • 主 Agent / 编排层:使用最强模型,负责任务分解、假设生成、最终裁决。
  • 子 Agent / 审查层:使用更便宜的模型,负责格式审查、假设验证、反例构造等子任务。
  • 按需加载:不要让 Agent 一次性加载全部 prompt。让它先读取 main.md,再根据当前任务类型加载对应的核心 prompt。
  • 定时进化:在每天空闲时间运行 prompt-evolution-prompt.md 对已有 prompt 进行 PEL 迭代。

在良好 prompt 的加持下,中等模型在特定子任务上可以接近甚至媲美更高级模型。

推荐工作流

Step 1: Agent 读取 main.md,理解全局协议与可用 prompt 目录
        ↓
Step 2: 用户告诉

Top comments (0)