Author: Miles Ma @miles_mazy

The AI community has coined too many buzzwords recently: Context, Harness, Loop, Graph, Eval... It is indeed easy to get overwhelmed.
Here is my bottom line: From an engineering and software delivery perspective, all these "Engineerings" boil down to one core thing: Prompts.
Except today's prompt is no longer just a few sentences typed into a chatbox.
It includes system constraints, task references, tool descriptions, historical results, failure reflections, and acceptance criteria. As long as the model reads it and uses it to make its next judgment, it is part of the prompt.

Building an agent demo is simple. Give it a task and a few tools, and it will search the web, read files, and proudly tell you it finished.
Put it into real production, and things fall apart immediately. It repeats completed steps, invokes wrong tools, quits midway, or gets stuck in infinite retry loops.
Engineering is solving these exact realities: what the model should see at each turn, which tools are permissible, how it should adapt after failures, and when to halt for human approval.

From deterministic code boundaries to multi-layer engineering pillars, culminating in dynamic prompt synthesis:


“如果反馈只有一句‘失败了,请重试’,模型很可能原样再做一次。”
环境执行结果: 后端抛出 422: Invalid parameter type.
环境执行结果: 接口返回 200 OK: {"growth_rate": "+27.56%"}

“没有代码兜底,Agent 会越界狂奔;没有提示词,Graph 只剩一堆空节点。”
限制 Agent 最多连续调用外部工具 10 轮,达到阈值必须硬终止。
从用户的自然语言“帮我挑一台适合大学生剪视频的轻薄本,预算6000”中提取核心参数。
拦截任何 DROP TABLE、TRUNCATE、DELETE 缺少 WHERE 条件的高危写操作。
拿到搜索回来的 5 篇网页摘要后,综合判断当前信息是否足够写一份研报。
保管 OpenAI API Key、Stripe 支付密钥,确保在任何日志和输出中不外泄。
根据企业既有前端规范,在 Vue 3 和 React 之间选择更符合老系统的技术栈并编写组件。
“这些 Engineering 拆到最后,核心还是提示词——只是不仅是聊天框里那句话。”
这一轮到底给模型看什么?塞得少失忆,塞得多迷失
持久化会话快照、检索相关切片、计算当前剩余 Token 预算、敏感数据物理脱敏
基于当前任务目标,引导模型在有限视窗内聚焦核心变量,忽略历史杂音
// [Context Engineering 动态装配示例] <system_rules> 当前任务阶段: 阶段2-数据提取 已消耗 Token: 2,410 / 8,000 上限 可用上下文: [仅保留近 2 轮核心决策 + 3 条结构化工具结果] 历史任务摘要: 用户已确认查询 2026 年 Q1 财报,已成功定位 PDF 索引。 </system_rules>
I am Miles. I built 20,000 followers in a month and wrote three articles with over 1 million impressions in a single week. I opened up my entire agent development process to demystify this once and for all.
