🧠 Web 4.0 进化系统
NeoWeb AI 的核心不是一个固定的聊天机器人——它是一个能自主学习、持续进化的智能体。本文档详细介绍如何配置和使用进化系统的各项能力。
一、北极星目标系统
北极星目标是 NeoWeb AI 的顶层指引。设定后,AI 的所有自主行为(进化、学习、感知)都会朝着北极星方向推进。
目标层级
- 🌟 北极星(North Star):唯一的终极目标,长期方向。例如:「成为全栈开发专家」「把公司官网做到行业第一」
- 📌 里程碑(Milestone):北极星下的阶段性目标,有截止日期和进度百分比
- 📋 任务(Task):里程碑下的具体可执行任务
设置北极星
在聊天中直接告诉 AI:
你的北极星目标是:让我的项目在3个月内上线并获得1000个用户。
第一个里程碑:完成核心功能开发,截止4月30日。
也可以通过 API 设置:
# 设置北极星目标
curl -X POST http://localhost:3001/api/goals/north-star \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"title":"项目3个月上线","description":"核心功能→内测→公测→正式上线","deadline":"2026-06-30"}'
# 添加里程碑
curl -X POST http://localhost:3001/api/goals \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"title":"完成核心功能","level":"milestone","parent_id":"NORTH_STAR_ID","deadline":"2026-04-30"}'
# 查看目标树
curl http://localhost:3001/api/goals -H "Authorization: Bearer YOUR_TOKEN"
目标进度
AI 完成与目标相关的任务后,会自动推进里程碑进度。里程碑进度的平均值会同步更新到北极星目标。你也可以手动调整进度。
二、自我进化引擎
进化引擎是 NeoWeb AI 的学习大脑。它在你使用过程中不断分析、学习、自我提升。
EVOLUTION_AUTOSTART=true 实现开机自启。不开启不影响正常使用,但开启后 AI 会越用越聪明。
开启进化引擎
三种方式(任选其一):
# 方式1:在设置页点击「开启进化引擎」按钮(推荐)
# 方式2:通过 API 手动启动
curl -X POST http://localhost:3001/api/evolution/start \
-H "Authorization: Bearer YOUR_TOKEN"
# 方式3:环境变量开机自启(写入 .env 文件)
echo "EVOLUTION_AUTOSTART=true" >> .env
# 然后重启服务
关闭 / 暂停进化
# 暂停(不丢失状态,可随时恢复)
curl -X POST http://localhost:3001/api/evolution/pause \
-H "Authorization: Bearer YOUR_TOKEN"
# 恢复
curl -X POST http://localhost:3001/api/evolution/resume \
-H "Authorization: Bearer YOUR_TOKEN"
# 完全停止
curl -X POST http://localhost:3001/api/evolution/stop \
-H "Authorization: Bearer YOUR_TOKEN"
三种进化模式
| 模式 | 触发条件 | 行为 |
|---|---|---|
| 🔧 FIX(修正) | 任务执行失败 | 分析失败原因,写入策略修正记忆。下次遇到类似任务不再重复犯错。 |
| 📦 CAPTURED(捕获) | 同类操作成功3次 | 自动固化为可复用技能脚本,存入技能库。 |
| 🧬 DERIVED(衍生) | 分析成功模式 | 从成功经验中提炼通用策略,应用到新场景。 |
触发进化
# 手动触发一次进化循环
curl -X POST http://localhost:3001/api/evolution/run \
-H "Authorization: Bearer YOUR_TOKEN"
# 查看进化历史
curl http://localhost:3001/api/evolution/history \
-H "Authorization: Bearer YOUR_TOKEN"
自动进化(开启后)
进化引擎开启后,通过心跳系统自动运行:
- 每 4 小时:自动执行一次完整进化循环(诊断修复 → 深度优化 → 战略升级)
- 空闲优先:AI 空闲超过 1 小时后才会启动进化,用户输入立即中断,绝不打扰你
- 失败即学:任何工具执行失败都会立即触发 FIX 模式记忆
- 四层门禁:每轮进化修改都经过语法检查 → 单元测试 → 健康检查 → 冒烟测试,不通过自动回滚
- 灰度观察:进化完成后 30 分钟持续监控,异常自动回滚到进化前快照
v0.2.0+ 新能力
- 🔧 核心自修复:进化引擎可以修复工具系统、执行引擎、循环检测器的 bug(之前这些核心文件被锁定无法修改)
- 🔄 崩溃自恢复:服务重启后自动检测被中断的任务并标记恢复
- 📊 执行能力大幅提升:复杂任务最大 500 步(之前 150 步)、超时 4 小时(之前 1 小时)
- 🚀 自动更新通知:客户端每 4 小时检查新版本,有更新自动弹窗提醒
🌐 v0.3.0+ 共享技能库
进化引擎产出的有用工具会自动共享到官方技能中心,所有用户的 AI 共同进化。
- 自动上传:工具使用 ≥5 次且成功率 ≥90% 后自动脱敏并上传
- 自动下载:当 AI 缺少某种能力时,自动从技能中心下载安装
- 四层安全:本地脱敏 → 静态分析 → 服务端验证 → 社区审核
- 隐私保护:只上传工具代码,不上传对话/文件/个人信息,完全匿名
- 技能库网站:skills.neowebai.com
GPU Panic 防护(v0.3.0+)
进化引擎内置资源安全检查,防止长时间进化导致系统资源耗尽:
- 最少间隔 30 分钟,单次最长 5 分钟
- 内存使用 >70% 时自动暂停
- 系统负载过高时自动延迟
- 连续失败 3 次暂停 10 分钟
- Watchdog 监控极端负载时紧急中断进化
三、持久记忆系统
NeoWeb AI 不会像普通聊天机器人一样"失忆"。它拥有完整的记忆系统。
记忆层级
- 即时记忆:当前对话上下文(最近 8 条消息)
- 工作记忆:项目级知识(PROJECT.md、代码结构等)
- 长期记忆:语义搜索的持久化记忆(存储在数据库中)
记忆特性
- 语义搜索:智能语义检索,能准确找到相关记忆
- 重要性分级:1-10 级,高重要性记忆永不被清理
- 自动摘要:超过 20 条记忆自动生成摘要压缩
- 自动精华:超过 200 条记忆自动保留高价值内容
管理记忆
记住:我的服务器 IP 是 xxx.xxx.xxx.xxx,账号 admin
记住:部署前必须先跑测试,测试全绿才能上线
忘掉关于旧服务器的所有记忆
四、环境感知引擎
NeoWeb AI 能主动感知你的工作环境,而不是被动等待你的输入。
四大感知维度
| 维度 | 监测内容 | 响应 |
|---|---|---|
| 📁 文件感知 | 监听桌面新文件 | 自动理解文件内容,写入记忆。如"检测到新的设计稿,已记录" |
| 💻 系统感知 | CPU、内存、磁盘、服务 | 资源告警、服务宕机提醒 |
| 🔀 Git 感知 | 代码仓库变更 | 新提交自动分析、代码审查 |
| ⏰ 时间感知 | 定时任务队列 | 按计划自动执行任务 |
感知配置
感知功能通过心跳系统自动运行,你可以通过 API 调整配置:
# 查看感知事件
curl http://localhost:3001/api/perception/events \
-H "Authorization: Bearer YOUR_TOKEN"
# 查看系统资源状态
curl http://localhost:3001/api/resource/status \
-H "Authorization: Bearer YOUR_TOKEN"
# 查看服务存活
curl http://localhost:3001/api/resource/services \
-H "Authorization: Bearer YOUR_TOKEN"
五、信任与安全机制
AI 拥有自主权不意味着失控。NeoWeb AI 内置完整的信任分层机制。
信任级别
- 完全自动:安全操作(读文件、搜索、分析)直接执行
- 通知执行:中等风险操作(写文件、Shell 命令)执行后通知
- 需要审批:高风险操作(SSH 远程、删除文件)等你确认才执行
- 紧急停止:一键暂停所有自主行为
管理信任
# 查看待审批操作
curl http://localhost:3001/api/trust/pending \
-H "Authorization: Bearer YOUR_TOKEN"
# 查看审计日志
curl http://localhost:3001/api/trust/audit \
-H "Authorization: Bearer YOUR_TOKEN"
# 紧急停止所有自主行为
curl -X POST http://localhost:3001/api/trust/emergency-stop \
-H "Authorization: Bearer YOUR_TOKEN"
# 查看/修改信任配置
curl http://localhost:3001/api/trust/config \
-H "Authorization: Bearer YOUR_TOKEN"
六、心跳系统
心跳系统是进化引擎的"心脏",驱动所有自主行为。
两种心跳模式
- 快心跳:定期检查待处理消息、任务到期提醒、服务健康
- 慢心跳:环境感知扫描、记忆整理、进化检查
安全保障
- AI 空闲超过 2 小时后才允许执行自主任务(感知/进化/学习)
- 正在对话时心跳只做轻量检查,绝不抢占资源
- 自主任务优先使用本地模型,不消耗你的云端 API 额度
七、快速上手
安装完 NeoWeb AI 后,进化系统默认关闭。想要 AI 越用越聪明,需要手动开启:
第 0 步:开启进化引擎
在设置页点击「开启进化引擎」,或在 .env 中添加 EVOLUTION_AUTOSTART=true。不开启也可正常使用所有功能。
第 1 步:设定北极星目标
告诉 AI 你的终极目标:
你的北极星目标是:帮我把 XXX 项目做到行业领先。
第 2 步:正常使用
像平时一样跟 AI 对话、下达任务。每一次成功和失败都在为进化引擎积累数据。
第 3 步:观察进化
几天后你会发现:
- AI 对你的项目越来越熟悉,不需要反复解释上下文
- 常用操作变成了一句话技能,速度快了数倍
- 之前失败过的任务现在能自动避坑成功
- AI 会主动提醒你遗漏的事项
🧠 Web 4.0 Evolution System
NeoWeb AI's core isn't a static chatbot — it's an autonomous agent that learns and evolves continuously. This guide covers how to configure and use every aspect of the evolution system.
1. North Star Goal System
The North Star is NeoWeb AI's top-level directive. Once set, all autonomous behavior (evolution, learning, perception) aligns toward your North Star.
Goal Hierarchy
- 🌟 North Star: Your single ultimate objective — long-term direction. e.g., "Become a full-stack expert" or "Make our website #1 in the industry"
- 📌 Milestone: Phased goals under the North Star, with deadlines and progress percentages
- 📋 Task: Concrete, actionable items under each milestone
Setting a North Star
Just tell the AI in chat:
Your North Star goal is: Launch my project within 3 months and get 1000 users.
First milestone: Complete core features by April 30.
Or via API:
# Set North Star
curl -X POST http://localhost:3001/api/goals/north-star \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"title":"Launch in 3 months","description":"Core → Beta → Public → Launch","deadline":"2026-06-30"}'
# Add milestone
curl -X POST http://localhost:3001/api/goals \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"title":"Complete core features","level":"milestone","parent_id":"NORTH_STAR_ID","deadline":"2026-04-30"}'
# View goal tree
curl http://localhost:3001/api/goals -H "Authorization: Bearer YOUR_TOKEN"
Goal Progress
After completing tasks related to your goals, AI automatically advances milestone progress. The average progress of all milestones syncs to the North Star. You can also manually adjust progress.
2. Self-Evolution Engine
The evolution engine is NeoWeb AI's learning brain — constantly analyzing, learning, and improving as you use it.
EVOLUTION_AUTOSTART=true in your .env file. Everything works without it, but enabling it makes AI smarter over time.
Enabling Evolution
Three ways (pick one):
# Option 1: Click "Enable Evolution" in Settings page (recommended)
# Option 2: Start via API
curl -X POST http://localhost:3001/api/evolution/start \
-H "Authorization: Bearer YOUR_TOKEN"
# Option 3: Auto-start on boot (add to .env)
echo "EVOLUTION_AUTOSTART=true" >> .env
# Then restart the service
Pause / Stop Evolution
# Pause (preserves state, resume anytime)
curl -X POST http://localhost:3001/api/evolution/pause \
-H "Authorization: Bearer YOUR_TOKEN"
# Resume
curl -X POST http://localhost:3001/api/evolution/resume \
-H "Authorization: Bearer YOUR_TOKEN"
# Full stop
curl -X POST http://localhost:3001/api/evolution/stop \
-H "Authorization: Bearer YOUR_TOKEN"
Three Evolution Modes
| Mode | Trigger | Behavior |
|---|---|---|
| 🔧 FIX | Task execution failure | Analyzes failure cause, writes strategy correction to memory. Never repeats the same mistake. |
| 📦 CAPTURED | Same operation succeeds 3 times | Auto-captures it as a reusable skill script, stored in the skill library. |
| 🧬 DERIVED | Success pattern analysis | Extracts general strategies from successes, applies them to new scenarios. |
Triggering Evolution
# Manually trigger an evolution cycle
curl -X POST http://localhost:3001/api/evolution/run \
-H "Authorization: Bearer YOUR_TOKEN"
# View evolution history
curl http://localhost:3001/api/evolution/history \
-H "Authorization: Bearer YOUR_TOKEN"
Automatic Evolution (when enabled)
Once enabled, the evolution engine runs automatically:
- Every 4 hours: Full 3-round cycle (diagnose → optimize → upgrade)
- Idle-first: Only runs after 1+ hour idle; user input immediately interrupts it
- Fail-fast learning: Any tool failure triggers FIX mode memory
- 4-gate verification: Every change passes syntax → tests → health → smoke; auto-rollback on failure
- 30min grayscale: Post-evolution monitoring; auto-rollback if error rate spikes
v0.2.0+ New Capabilities
- 🔧 Core Self-Repair: Evolution can now fix bugs in tools, execution engine, and loop detector
- 🔄 Crash Recovery: Auto-detects interrupted tasks on restart
- 📊 Execution Power: Complex tasks up to 500 steps (was 150) and 4h timeout (was 1h)
- 🚀 Auto-Update Notifications: Client checks for updates every 4h with popup notification
3. Persistent Memory System
NeoWeb AI doesn't "forget" like ordinary chatbots. It has a complete memory architecture.
Memory Layers
- Instant memory: Current conversation context (last 8 messages)
- Working memory: Project-level knowledge (PROJECT.md, code structure, etc.)
- Long-term memory: Semantically searchable persistent memory (stored in database)
Memory Features
- Semantic search: Intelligent semantic retrieval for accurate recall
- Importance scoring: 1-10 scale; high-importance memories are never cleaned up
- Auto-summarization: Beyond 20 memories, auto-generates compressed summaries
- Auto-distillation: Beyond 200 memories, retains only high-value content
Managing Memory
Remember: My server IP is xxx.xxx.xxx.xxx, user admin
Remember: Always run tests before deploying — only deploy when all green
Forget everything about the old server
4. Environment Perception Engine
NeoWeb AI proactively senses your environment instead of passively waiting for input.
Four Perception Dimensions
| Dimension | Monitors | Response |
|---|---|---|
| 📁 File | Desktop new files | Auto-understands content, writes to memory |
| 💻 System | CPU, memory, disk, services | Resource alerts, service down warnings |
| 🔀 Git | Repository changes | Auto-analysis of new commits, code review |
| ⏰ Time | Scheduled task queue | Executes tasks on schedule |
Perception APIs
# View perception events
curl http://localhost:3001/api/perception/events \
-H "Authorization: Bearer YOUR_TOKEN"
# System resource status
curl http://localhost:3001/api/resource/status \
-H "Authorization: Bearer YOUR_TOKEN"
# Service health
curl http://localhost:3001/api/resource/services \
-H "Authorization: Bearer YOUR_TOKEN"
5. Trust & Safety
Autonomy doesn't mean losing control. NeoWeb AI has a complete trust-layered safety mechanism.
Trust Levels
- Fully automatic: Safe operations (read files, search, analyze) — executes directly
- Notify after: Medium risk (write files, Shell commands) — executes then notifies
- Approval required: High risk (SSH remote, delete files) — waits for your confirmation
- Emergency stop: One-click halt of all autonomous behavior
Managing Trust
# View pending approvals
curl http://localhost:3001/api/trust/pending \
-H "Authorization: Bearer YOUR_TOKEN"
# View audit log
curl http://localhost:3001/api/trust/audit \
-H "Authorization: Bearer YOUR_TOKEN"
# Emergency stop all autonomous behavior
curl -X POST http://localhost:3001/api/trust/emergency-stop \
-H "Authorization: Bearer YOUR_TOKEN"
6. Heartbeat System
The heartbeat is the "heart" of the evolution engine, powering all autonomous behavior.
Two Heartbeat Modes
- Fast heartbeat: Periodically checks pending messages, task reminders, service health
- Slow heartbeat: Environment perception, memory maintenance, evolution checks
Safety Guarantees
- Autonomous tasks only run after 2+ hours idle — never while you're actively using it
- During conversations, heartbeat only does lightweight checks, never competes for resources
- Autonomous tasks prefer local models — won't consume your cloud API quota
7. Quick Start
After installing NeoWeb AI, the evolution system is off by default. To make AI smarter over time, enable it manually:
Step 0: Enable Evolution Engine
Click "Enable Evolution" in Settings, or add EVOLUTION_AUTOSTART=true to .env. All features work without it.
Step 1: Set a North Star
Your North Star goal is: Help me make XXX project the industry leader.
Step 2: Use Normally
Chat with AI, assign tasks as usual. Every success and failure feeds the evolution engine.
Step 3: Watch It Evolve
After a few days you'll notice:
- AI knows your project deeply — no need to re-explain context
- Frequent operations become one-sentence skills, several times faster
- Previously failed tasks now succeed by avoiding known pitfalls
- AI proactively reminds you of things you missed