Skip to content

Knowledge Bases

Built-in Knowledge

HQ ships with 8 knowledge bases in knowledge/:

Knowledge BasePathContents
Ralphknowledge/Ralph/Coding methodology — overview, core concepts, workflow, back-pressure, specifications, implementation
Workersknowledge/workers/Worker framework — Ralph loop pattern, skill schema, state machines, templates
HQ Coreknowledge/hq-core/Thread schema, checkpoint schema, INDEX.md specification
AI Securityknowledge/ai-security/Security framework — core principles, threat landscape, checklists, incident response
Design Stylesknowledge/design-styles/Image generation style guides — American Industrial, Ethereal Abstract, Liminal Portal
Dev Teamknowledge/dev-team/Development patterns — React best practices, troubleshooting, workflows
Loomknowledge/loom/Agent patterns reference — architecture, state machines, thread system
Projectsknowledge/projects/Project templates — README template for new projects

Company-Scoped Knowledge

After running /setup, you’ll have company-specific knowledge:

companies/{your-company}/knowledge/
├── profile.md # Your identity, role, domains
└── voice-style.md # Writing voice and style preferences

Knowledge bases are independent git repos symlinked into HQ. This enables:

  • Independent versioning — Each base has its own commit history
  • Selective sharing — Share some bases publicly, keep others private
  • Easy updatesgit pull in the knowledge repo updates HQ
knowledge/Ralph/ → repos/public/ralph-methodology/docs/
knowledge/workers/ → repos/public/knowledge-workers/

How It Works

  1. Knowledge repos live in repos/public/ or repos/private/
  2. Symlinks in knowledge/ point to the repo content
  3. HQ git tracks the symlinks, not the content
  4. Changes are committed in the target repo, not in HQ

Committing Knowledge Changes

Terminal window
# Navigate to the knowledge repo
cd repos/public/knowledge-ralph/
# Standard git workflow
git add .
git commit -m "Update best practices"
git push

Adding New Knowledge

  1. Create a new repo:
Terminal window
cd repos/public/
git init knowledge-my-topic
  1. Add content (markdown files)

  2. Symlink into HQ:

Terminal window
ln -s ../repos/public/knowledge-my-topic knowledge/my-topic
  1. Add to modules/modules.yaml for sync tracking

  2. Reindex search:

Terminal window
/search-reindex

Using Knowledge in Workers

Workers reference knowledge bases in their worker.yaml:

context:
base:
- knowledge/Ralph/
- knowledge/workers/
- companies/my-company/knowledge/

When a worker runs, Claude Code loads these paths as context, giving the worker access to all relevant knowledge.

Search Across Knowledge

All knowledge bases are indexed by qmd:

Terminal window
/search "deployment best practices"

This searches across all knowledge bases, workspace files, commands, and worker configurations.