OpenCortex:自我进化的记忆架构 - Openclaw Skills
作者:互联网
2026-04-06
什么是 OpenCortex?
OpenCortex 是一款专业级记忆架构,旨在将标准智能体转变为持久化知识系统。它通过实施结构化的记忆文件层级和自动化维护程序,解决了智能体健忘的常见问题。通过使用此框架,开发者可以确保其 Openclaw Skills 通过对交互进行每日提炼和每周综合,随着时间的推移变得更加高效。
该系统基于一套核心原则运行,强制执行高质量的文档记录、决策跟踪和工具使用。它专为可靠性和安全性而构建,具有选择性加密、Git 备份的机密清除功能以及隔离的 cron 会话,可在无需人工干预的情况下保持智能体工作区的整洁。
下载入口:https://github.com/openclaw/skills/tree/main/skills/jd2005l/opencortex
安装与下载
1. ClawHub CLI
从源直接安装技能的最快方式。
npx clawhub@latest install opencortex
2. 手动安装
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
/skills/
优先级:工作区 > 本地 > 内置
3. 提示词安装
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 opencortex。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
OpenCortex 应用场景
- 使用持久化记忆最佳实践引导新的智能体实例。
- 在长期互动中组织复杂的项目数据和联系信息。
- 从重复的智能体程序中自动创建技术操作手册(Runbooks)。
- 防止在子智能体委派和汇报期间发生知识流失。
- 在 Openclaw Skills 中为敏感的基础设施元数据实现安全的加密保险库。
- 智能体将所有交互、工具输出和决策记录到结构化的每日日志文件中。
- 触发每晚提炼过程以分析日志,提取永久性知识并将其路由到特定文件,如项目、联系人或基础设施地图。
- 系统运行自动审计,以验证所有新工具和决策是否根据定义好的原则进行了记录。
- 每周进行一次综合例程,识别循环模式和未完成的线索,以优化智能体的长期战略。
- 架构不断自我完善,修剪陈旧数据并压缩信息,以维持轻量级但全面的上下文窗口。
OpenCortex 配置指南
要安装此技能,请确保您处于 OpenClaw 工作区目录中并运行以下命令:
# 通过 ClawHub 安装技能
clawhub install opencortex
# 执行本地化安装程序
bash skills/opencortex/scripts/install.sh
# 验证安装和 cron 任务状态
bash skills/opencortex/scripts/verify.sh
安装后,您可以在 SOUL.md 中自定义智能体的身份,并在 memory/projects/ 目录中定义特定于项目的目标。
OpenCortex 数据架构与分类体系
OpenCortex 利用标准化的文件层级来管理 Openclaw Skills 的知识资产:
| 文件/文件夹 | 用途 |
|---|---|
SOUL.md |
定义智能体个性、边界和身份。 |
MEMORY.md |
包含核心原则和主要记忆索引。 |
TOOLS.md |
API 方法和工具能力的综合仓库。 |
INFRA.md |
映射基础设施详情,包括主机、IP 和服务。 |
memory/projects/ |
按特定项目组织的提炼后的知识文件。 |
memory/runbooks/ |
根据以往成功经验自动生成的步骤程序。 |
memory/archive/ |
历史每日日志和每周总结。 |
name: OpenCortex
homepage: https://github.com/JD2005L/opencortex
description: >
Self-improving memory architecture for OpenClaw agents. Structured memory files,
nightly distillation, weekly synthesis, enforced principles (P0 for custom, P1-P8 managed),
write-ahead durability, and model-agnostic delegation — so your agent
compounds knowledge instead of forgetting it. Includes opt-in metrics tracking with
growth charts and compound scoring to measure effectiveness over time. All sensitive features (voice profiling,
infrastructure auto-collection, git push) are OFF by default and require explicit
opt-in via environment variable or flag. Safe to install: no network calls during
setup, fully auditable bash scripts, isolated cron sessions scoped to workspace only.
Use when: (1) setting up a new OpenClaw instance, (2) user asks to improve/organize
memory, (3) user wants the agent to stop forgetting things, (4) bootstrapping a fresh
agent with best practices. NOT for: runtime memory_search queries (use built-in memory
tools). Triggers: "set up memory", "organize yourself", "stop forgetting", "memory
architecture", "self-improving", "cortex", "bootstrap memory", "memory optimization".
metadata: {"openclaw":{"requires":{"bins":["grep","sed","find"],"optionalBins":["git","gpg","openssl","openclaw","secret-tool","keyctl","file"]},"env":{"CLAWD_WORKSPACE":{"description":"Workspace directory (defaults to cwd)","required":false},"CLAWD_TZ":{"description":"Timezone for cron scheduling (defaults to UTC)","required":false},"OPENCORTEX_VAULT_PASS":{"description":"Vault passphrase via env var. Prefer system keyring.","required":false,"sensitive":true},"OPENCORTEX_VOICE_PROFILE":{"description":"Set to 1 to enable voice profiling in the nightly distillation cron. Off by default.","required":false,"sensitive":false},"OPENCORTEX_INFRA_COLLECT":{"description":"Set to 1 to enable infrastructure auto-collection in the nightly distillation cron. Off by default.","required":false,"sensitive":false},"OPENCORTEX_SCRUB_ALL":{"description":"Set to 1 to scrub all tracked files (not just known text types) during git backup. Off by default.","required":false,"sensitive":false},"OPENCORTEX_ALLOW_FILE_PASSPHRASE":{"description":"Set to 1 to allow vault passphrase stored in a file (.vault/.passphrase). Off by default; prefer system keyring.","required":false,"sensitive":false}},"sensitiveFiles":[".secrets-map",".vault/.passphrase"],"networkAccess":"Optional git push only (off by default, requires --push flag)"}}
OpenCortex — Self-Improving Memory Architecture
Transform a default OpenClaw agent into one that compounds knowledge daily.
?? Full source on GitHub — review the code, file issues, or contribute.
What This Does
- Structures memory into purpose-specific files instead of one flat dump
- Installs nightly maintenance that distills daily work into permanent knowledge
- Installs weekly synthesis that catches patterns across days
- Establishes principles that enforce good memory habits — and backs them up with nightly audits that verify tool documentation, decision capture, sub-agent debriefs, failure analysis, and unnecessary deferrals to the user. Nothing slips through the cracks.
- Builds a voice profile of your human from daily conversations for authentic ghostwriting (opt-in, requires
OPENCORTEX_VOICE_PROFILE=1) - Encrypts sensitive data in an AES-256 vault with key-only references in docs; supports passphrase rotation (
vault.sh rotate) and validates key names onvault.sh set - Enables safe git backup with secret scrubbing (secrets never modified in your live workspace — scrubbed in an isolated copy only)
- Tracks growth over time (opt-in) — daily metrics snapshots with compound scoring and ASCII growth charts
Installation
Prerequisites (install these separately if you don't have them):
- OpenClaw 2026.2.x+
- ClawHub CLI
# 1. Download the skill from your OpenClaw workspace directory
cd ~/clawd # or wherever your workspace is
clawhub install opencortex
# 2. Run the installer FROM YOUR WORKSPACE DIRECTORY (not from inside the skill folder)
bash skills/opencortex/scripts/install.sh
# Optional: preview what would be created without changing anything
bash skills/opencortex/scripts/install.sh --dry-run
The installer will ask about optional features (encrypted vault, voice profiling, infrastructure collection, git backup). It's safe to re-run — it skips anything that already exists. The installer itself makes no network calls — it only creates local files and registers cron jobs.
# 3. Verify everything is working (read-only — checks files and cron jobs, changes nothing)
bash skills/opencortex/scripts/verify.sh
You can also ask your OpenClaw agent "is OpenCortex working?" — it knows how to run the verification and share results.
The script will:
- Create the file hierarchy (non-destructively — won't overwrite existing files)
- Create directory structure
- Set up cron jobs (daily distillation, weekly synthesis)
- Optionally set up git backup with secret scrubbing
After install, review and customize:
SOUL.md— personality and identity (make it yours)USER.md— info about your humanMEMORY.md— principles (add/remove as needed).secrets-map— add your actual secrets for git scrubbing
Updating
# 1. Download the latest version (run from workspace root)
clawhub install opencortex --force
# 2. Re-run the installer — it detects your existing install and offers to update
bash skills/opencortex/scripts/install.sh
The installer detects your existing version and offers three options: Update (recommended), Full reinstall, or Cancel. The update path is non-destructive — it adds missing content, refreshes cron messages, and offers any new optional features without overwriting your customized files.
Architecture
SOUL.md ← Identity, personality, boundaries
AGENTS.md ← Operating protocol, delegation rules
MEMORY.md ← Principles + memory index (< 3KB, loaded every session)
TOOLS.md ← Tool shed: APIs, scripts, and access methods with abilities descriptions
INFRA.md ← Infrastructure atlas: hosts, IPs, services, network
USER.md ← Human's preferences, projects, communication style
BOOTSTRAP.md ← First-run checklist for new sessions
memory/
projects/ ← One file per project (distilled, not raw)
contacts/ ← One file per person/org (role, context, preferences)
workflows/ ← One file per workflow/pipeline (services, steps, issues)
runbooks/ ← Step-by-step procedures (delegatable to sub-agents)
preferences.md ← Cross-cutting user preferences by category
archive/ ← Archived daily logs + weekly summaries
YYYY-MM-DD.md ← Today's working log (distilled nightly)
Principles (installed by default)
| # | Name | Purpose |
|---|---|---|
| P1 | Delegate First | Assess tasks for sub-agent delegation; stay available |
| P2 | Write It Down | Commit to files, not mental notes |
| P3 | Ask Before External | Confirm before emails, public posts, destructive ops |
| P4 | Tool Shed & Workflows | Document tools and workflows; enforced by nightly audit |
| P5 | Capture Decisions & Preferences | Record decisions and preferences; enforced by nightly + weekly audit |
| P6 | Sub-agent Debrief | Delegated work feeds back to daily log; orphans recovered by distillation |
| P7 | Log Failures | Tag failures/corrections; root cause analysis enforced by nightly audit |
| P8 | Check the Shed First | Consult TOOLS.md/INFRA.md/memory before deferring work to user; enforced by nightly audit |
Cron Jobs (installed)
| Schedule | Name | What it does |
|---|---|---|
| Daily 3 AM (local) | Distillation | Reads daily logs → distills into project/tools/infra files → audits tools/decisions/debriefs/failures → optimizes → archives |
| Weekly Sunday 5 AM | Synthesis | Reviews week for patterns, recurring problems, unfinished threads, decisions; auto-creates runbooks from repeated procedures |
Both jobs use a shared lockfile (/tmp/opencortex-distill.lock) to prevent conflicts when daily and weekly runs overlap.
Customize times by editing cron jobs: openclaw cron list then openclaw cron edit .
Git Backup (optional)
If enabled during install, creates:
scripts/git-backup.sh— auto-commit every 6 hours, scrubs secrets in an isolated temp copy (workspace files never modified).secrets-map— maps secrets to placeholders (gitignored, 600 perms)
Add secrets to .secrets-map in format: actual_secret|{{PLACEHOLDER_NAME}}
Before each push, git-backup.sh verifies no raw secrets remain in the scrubbed copy. If any are found, the backup is aborted — nothing reaches the remote.
Customization
Adding a project: Create memory/projects/my-project.md, add to MEMORY.md index.
Adding a contact: Create memory/contacts/name.md. Distillation auto-creates contacts from conversations.
Adding a workflow: Create memory/workflows/my-pipeline.md. Distillation auto-creates workflows when described.
Adding a preference: Append to memory/preferences.md under the right category. Distillation auto-captures from conversation.
Adding a principle: Append to MEMORY.md under ?? PRINCIPLES. Keep it short.
Adding a runbook: Create memory/runbooks/my-procedure.md. Sub-agents can follow these directly.
Adding a tool: Add to TOOLS.md with: what it is, how to access it, and a goal-oriented abilities description (so future intent-based lookup matches).
How It Compounds
Daily work → daily log
→ nightly distill → routes to project/tools/infra/principles files
→ optimization pass (dedup, prune stale, condense)
→ weekly synthesis → patterns, recurring problems, unfinished threads → auto-creates runbooks from repeated procedures → `memory/runbooks/`
Sub-agent work → debrief (P6) → daily log → same pipeline
Decisions → captured with reasoning (P5) → never re-asked
New tools → documented with abilities (P4) → findable by intent
Each day the agent wakes up slightly more knowledgeable and better organized.
相关推荐
专题
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
最新数据
相关文章
Email Templates AI: 生成专业外联内容 - Openclaw Skills
Cheapest AI:经济实惠的 LLM API 接入 - Openclaw Skills
最佳免费 AI:通过赠金访问顶级模型 - Openclaw Skills
最适合编程的 AI:顶级大模型的统一 API - Openclaw Skills
Anthropic 替代方案:访问 Claude 模型 - Openclaw Skills
Acuity API:自动化预约调度 - Openclaw Skills
Subreddit Scout:Reddit 市场调研自动化工具 - Openclaw Skills
RAG 知识系统:AI 智能体语义搜索 - Openclaw Skills
飞书套件:文档、即时通讯与 AI 工作流自动化 - Openclaw Skills
AAWP:适用于 EVM 链的 AI 代理钱包协议 - Openclaw Skills
AI精选
