Quick Reference
Layer 1: Community (npm package)
Purpose
Purpose
The open-source engine that powers Mega Brain. Distributed via npm as
mega-brain-ai. Anyone can install and use this to build their own knowledge management system.Distribution: Public —
npm publishWho uses it: Open source community, all users as the foundation layer
What Belongs in L1
Core Engine
core/- Processing enginecore/tasks/- Task definitionscore/workflows/- Workflow templatescore/schemas/- JSON schemascore/intelligence/- Intelligence scripts
CLI & Tooling
bin/- CLI binaries- Setup wizard
- Validation scripts
- Pre-publish gates
Integration
.claude/- Claude Code integration.claude/hooks/- Lifecycle hooks.claude/commands/- Slash commands.claude/skills/- Skill system.claude/rules/- Operational rules
Templates
agents/_templates/- Agent templatesagents/conclave/- Deliberation agentsdocs/- Documentation.gitkeepfiles (structure markers)
Real Examples
Key rule:
.gitkeep files are always L1, regardless of directory. They mark where populated content will live but contain no personal data.Layer 2: Premium (populated content)
Purpose
Purpose
Content generated through the Mega Brain pipeline — actual knowledge, agent personalities, dossiers, playbooks. Requires a paid subscription or private repository access.
Distribution: Private — premium repository or direct sync
Who uses it: Paying users who have run the pipeline and built their knowledge base
What Belongs in L2
Agents
agents/minds/(populated)agents/cargo/(populated)- Agent personalities and memories
- Agent DNA configurations
Knowledge
knowledge/dossiers/knowledge/playbooks/knowledge/dna/knowledge/sources/
Artifacts
artifacts/insights/artifacts/chunks/artifacts/extractions/- Populated state files
Processed Content
- Dossiers with expert knowledge
- Extracted DNA schemas
- Synthesized narratives
- Theme compilations
Real Examples
Key rule: L2 is a superset of L1. An L2 distribution includes all L1 content plus the populated knowledge content.
Layer 3: Personal (never distributed)
Purpose
Purpose
User-generated content specific to one person’s workflow — raw source materials, processing logs, session history, company-specific data. Never leaves the local machine except in personal backups.
Distribution: Local backup only — never shared
Who uses it: The individual user only — this is their private data
What Belongs in L3
Raw Materials
inbox/- All input materials- Videos, PDFs, transcripts
- Course materials
- Podcast downloads
Logs & History
logs/- Processing logs.claude/sessions/- Session history- Execution reports
- Audit trails
State & Runtime
.claude/mission-control/- Session state files
- Runtime configuration
- Processing checkpoints
Company Data
agents/sua-empresa/- Company-specific agents
- Internal processes
- Proprietary workflows
Real Examples
Key rule: L3 content is the “input” and “runtime state” of your system. Valuable to you personally but meaningless (or sensitive) to others.
Special Categories
NEVER — Secrets and Credentials
Purpose: Files that must never be committed to any git repository. What belongs:.env,.env.local- Environment variablescredentials.json,token.json- API credentials.mcp.json- MCP configuration with tokens*.key,*.pem- Certificate files
DELETE — Obsolete Content
Purpose: Files superseded by newer implementations. Runpython3 core/intelligence/audit_layers.py to identify delete candidates.
Classification Flowchart
1
Check NEVER
Does it contain API keys, tokens, or credentials?YES → NEVER (add to
.gitignore)2
Check L3
Is it user-generated (inbox, logs, sessions, company data)?YES → L3 (gitignored)
3
Check L2
Is it populated knowledge (dossiers, playbooks, DNA, artifacts)?YES → L2 (private repo)
4
Check .gitkeep
Is it a
.gitkeep file anywhere?YES → L1 (structure marker)5
Default to L1
Is it core engine, CLI, integration, or templates?YES → L1 (public repo)
Distribution Matrix
Community vs Pro Features
Validation
Verify layer classification before publishing:Layer Management Best Practices
1
Separate Concerns
Keep L1 (engine), L2 (content), and L3 (personal) clearly separated
2
Never Mix
Don’t commit L3 content to L1/L2 repos. Don’t include secrets anywhere.
3
Validate Before Publish
Always run validation before pushing to public or premium repos
4
Document Decisions
When adding new content, document which layer it belongs to and why
Next Steps
Architecture
Understand the full system architecture
Knowledge Pipeline
Learn how L2 content is generated
