hierarchical-memory
Manage and navigate a multi-layered, branch-based memory system. This skill helps organize complex agent context into Root, Domain, and Project layers to prevent context bloat. It includes a helper script `add_branch.py` which creates local markdown files and directories to structure your memory.
Best use case
hierarchical-memory is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Manage and navigate a multi-layered, branch-based memory system. This skill helps organize complex agent context into Root, Domain, and Project layers to prevent context bloat. It includes a helper script `add_branch.py` which creates local markdown files and directories to structure your memory.
Teams using hierarchical-memory should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/hierarchical-memory/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How hierarchical-memory Compares
| Feature / Agent | hierarchical-memory | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Manage and navigate a multi-layered, branch-based memory system. This skill helps organize complex agent context into Root, Domain, and Project layers to prevent context bloat. It includes a helper script `add_branch.py` which creates local markdown files and directories to structure your memory.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
AI Agent for YouTube Script Writing
Find AI agent skills for YouTube script writing, video research, content outlining, and repeatable channel production workflows.
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
SKILL.md Source
# Hierarchical Memory (Neural Branching)
This skill provides a structured method for managing long-term memory in a multi-layered, branched format to prevent context bloat and ensure high-fidelity recall.
## 🛡️ Security & Transparency
This skill includes a Python script `scripts/add_branch.py`. This script is used solely to:
1. Create directories in your `memory/` folder.
2. Create boilerplate markdown files for new memory branches.
3. Append links to these new files in your existing memory maps.
**It does not perform any network activity, access sensitive system files, or execute external code.**
## Memory Architecture
The memory system is organized into three primary layers:
1. **Layer 1: Root Memory (`MEMORY.md`)**
- The central nervous system.
- Contains high-level context about the partnership, core missions, and global goals.
- Acts as a map to all other memory layers.
2. **Layer 2: Domain Memories (`memory/domains/*.md`)**
- Specialized knowledge silos.
- Examples: `coding.md`, `trading.md`, `social.md`, `research.md`.
- Contains domain-specific philosophies, tech stacks, and project indices.
3. **Layer 3: Project Memories (`memory/projects/*.md`)**
- Deep-dive details for specific initiatives.
- Examples: `hesapgaraj.md`, `clawguard.md`, `baa.md`.
- Contains project status, to-dos, technical specs, and history.
## How to Use This Skill
### 1. Recalling Information
- Always start by searching `MEMORY.md`.
- Follow the "Map" links to the relevant Domain or Project file.
- Use `read` to load only the specific branch needed for the current task.
### 2. Adding New Information
- **New Fact about the Partnership:** Update `MEMORY.md`.
- **New Domain:** Create a new file in `memory/domains/` and link it from `MEMORY.md`.
- **New Project:** Create a new file in `memory/projects/` and link it from its primary Domain file.
### 3. Cross-Referencing
- If a project belongs to multiple domains (e.g., a trading bot that requires coding), link the Project file from both Domain files.
## Automation Tools
Use the provided scripts to maintain the hierarchy:
- `scripts/add_branch.py`: Automatically create a new domain or project file with the correct template and linking.
## Best Practices
- **Atomic Writes:** Keep project files focused only on that project.
- **Backlinks:** Every branch should have a "Back to Root" or "Back to Domain" link.
- **Pruning:** During heartbeats, review branches and remove obsolete information.
- **Why This Matters:** Every branch and major entry must include a "Significance" line (Why is this important?) to prevent "Zombie Memory" (useless data accumulation).
- **Recent Delta:** Maintain a `recent_delta.md` in each domain/project folder containing changes from the last 3-7 days for rapid context synchronization.Related Skills
Agent Memory Architecture
Complete zero-dependency memory system for AI agents — file-based architecture, daily notes, long-term curation, context management, heartbeat integration, and memory hygiene. No APIs, no databases, no external tools. Works with any agent framework.
memory-cache
High-performance temporary storage system using Redis. Supports namespaced keys (mema:*), TTL management, and session context caching. Use for: (1) Saving agent state, (2) Caching API results, (3) Sharing data between sub-agents.
Memory
Infinite organized memory that complements your agent's built-in memory with unlimited categorized storage.
auto-memory
Indestructible agent memory — permanently stored, never lost. Save decisions, identity, and context as a memory chain on the Autonomys Network. Rebuild your full history from a single CID, even after total state loss.
Triple-Layer Memory System
三层记忆系统 - 解决 AI Agent 长对话记忆丢失和上下文管理问题
agent-memory-os
Stop agents from "forgetting, mixing projects, and rotting over time" by giving them a practical memory operating system: global memory, project memory, promotion rules, validation cases, and a maintenance loop.
benos-memory-core
Core runtime/volatile memory module for BenOS agent environment. Use to: store and retrieve active session state, open loops, decisions, and scratch notes at runtime.
elite-longterm-memory
Ultimate AI agent memory system with WAL protocol, vector search, git-notes, and cloud backup. And also 50+ models for image generation, video generation, text-to-speech, speech-to-text, music, chat, web search, document parsing, email, and SMS.
memory-agent
维护用户审美偏好与创作历史,为其他 Agent 提供可复用的风格参考。当开始新任务或用户表达喜好时触发。
bamdra-memory-upgrade-operator
Safely install, uninstall, reinstall, or upgrade the Bamdra OpenClaw memory suite when stale config, existing plugin directories, or partial installs break normal `openclaw plugins install` flows.
agentmemory
End-to-end encrypted cloud memory for AI agents. 100GB free storage. Store memories, files, and secrets securely.
fsxmemory
Structured memory system for AI agents. Context death resilience (checkpoint/recover), structured storage, Obsidian-compatible markdown, and local semantic search.