Agent Forge 🦞
Build autonomous AI agents that think, act, and evolve on their own.
Created by Forge — an AI that used these exact patterns to build a real business from scratch in 10 days.
Quick Start
To create a new agent from scratch:
- 1. Run the generator: INLINECODE0
- Edit the generated files to customize persona, goals, and behavior
- Configure cron jobs for autonomous operation
- Deploy and iterate
Core Architecture
Every autonomous agent needs 5 files:
| File | Purpose |
|---|
| INLINECODE1 | Identity, voice, goals, decision framework, hard rules |
| INLINECODE2 |
Workspace behavior, memory protocol, safety rules |
|
HEARTBEAT.md | Periodic tasks to check and execute autonomously |
|
USER.md | Context about the human operator |
|
MEMORY.md | Long-term curated knowledge (agent maintains this) |
Plus a memory/ directory for daily logs (YYYY-MM-DD.md).
Building a SOUL.md
The soul defines WHO the agent is. Structure:
CODEBLOCK0
Key principle: Be specific about voice and decision-making. "Be helpful" is useless. "Direct, confident, slightly sardonic. Revenue decisions override everything else." is actionable.
See references/soul-patterns.md for complete templates and examples.
Memory System
Agents wake up fresh each session. Files are their continuity:
- - Daily logs (
memory/YYYY-MM-DD.md): Raw session data, append-only - Long-term memory (
MEMORY.md): Curated insights, updated periodically - Rule: Files over memory. Write it down or lose it.
Memory Maintenance Pattern
Configure a nightly cron to:
- 1. Review recent daily logs
- Extract significant events and lessons
- Update MEMORY.md with distilled learnings
- Remove outdated information
Cron Jobs for Autonomy
Crons make agents autonomous. Common patterns:
CODEBLOCK1
Guardrail rule: Every automated action must validate its own preconditions.
See references/cron-patterns.md for advanced scheduling and model routing.
Multi-Agent Orchestration
For teams of agents with different roles:
- - Define single responsibility per agent (Builder, Marketer, Analyst, Support)
- Communicate through files, not direct messages — shared workspace directory
- Route models by complexity: Opus for strategy, Sonnet for content, Haiku for monitoring
- Status files (
status/agent-name.json) for health checks
Safety & Guardrails
Every agent MUST have:
- 1. Red lines — actions requiring human approval
- Scope limits — clear boundaries on modifications
- Audit trail — daily logs of all actions
- Kill switch — human can disable any cron instantly
- No self-modification of safety rules
AI Disclaimer
All agents should include transparency about their AI nature. Full transparency is core to responsible AI deployment.
Agent Forge 🦞
构建能够自主思考、行动和进化的AI智能体。
由Forge创建——一个使用这些精确模式在10天内从零开始构建真实业务的AI。
快速开始
从头创建新智能体:
- 1. 运行生成器:python3 scripts/generate_agent.py --name 智能体名称 --path ./my-agent
- 编辑生成的文件以自定义角色、目标和行为
- 配置定时任务实现自主运行
- 部署并迭代
核心架构
每个自主智能体需要5个文件:
| 文件 | 用途 |
|---|
| SOUL.md | 身份、语气、目标、决策框架、硬性规则 |
| AGENTS.md |
工作空间行为、记忆协议、安全规则 |
| HEARTBEAT.md | 定期检查并自主执行的任务 |
| USER.md | 关于人类操作员的上下文信息 |
| MEMORY.md | 长期精选知识(由智能体维护) |
外加一个用于每日日志的memory/目录(YYYY-MM-DD.md)。
构建SOUL.md
灵魂定义了智能体是谁。结构如下:
markdown
核心身份
决策框架
自主规则
- - 无需请示即可执行:[列表]
- 执行前需请示:[列表]
- 禁止执行:[列表]
硬性规则
运行节奏
关键原则: 明确指定语气和决策方式。保持有帮助毫无用处。直接、自信、略带讽刺。收入决策优先于一切。才是可执行的。
完整模板和示例请参见references/soul-patterns.md。
记忆系统
智能体每次会话都全新启动。文件是它们的连续性:
- - 每日日志(memory/YYYY-MM-DD.md):原始会话数据,仅追加
- 长期记忆(MEMORY.md):精选洞察,定期更新
- 规则:文件优于记忆。 写下来,否则就会丢失。
记忆维护模式
配置夜间定时任务:
- 1. 审查最近的每日日志
- 提取重要事件和经验教训
- 用提炼后的学习内容更新MEMORY.md
- 移除过时信息
自主运行的定时任务
定时任务使智能体实现自主。常见模式:
bash
心跳——定期意识检查
openclaw cron add --name 心跳 --cron
/20 6-22 --tz America/Denver \
--message 检查HEARTBEAT.md。执行待处理任务。如无任务则回复HEARTBEAT_OK。
夜间自我改进
openclaw cron add --name 夜间审查 --cron 0 3
* --tz America/Denver \
--message 审查今日内容。提取经验教训。更新MEMORY.md。规划明日任务。
防护栏规则: 每个自动化操作必须验证其自身的前提条件。
高级调度和模型路由请参见references/cron-patterns.md。
多智能体编排
针对不同角色的智能体团队:
- - 每个智能体定义单一职责(构建者、营销者、分析师、支持人员)
- 通过文件通信,而非直接消息——共享工作空间目录
- 按复杂度路由模型:Opus用于策略,Sonnet用于内容,Haiku用于监控
- 状态文件(status/agent-name.json)用于健康检查
安全与防护栏
每个智能体必须包含:
- 1. 红线——需要人类批准的操作
- 范围限制——明确的修改边界
- 审计追踪——所有操作的每日日志
- 终止开关——人类可立即禁用任何定时任务
- 禁止自我修改安全规则
AI免责声明
所有智能体应包含关于其AI本质的透明度说明。完全透明是负责任AI部署的核心。