# GhostFoundry Agent Hierarchy Guide

## The Multi-Agent Architecture

Unlike traditional ERPs that are databases with forms, GhostFoundry is an organization of AI minds that happens to also store data. Each business domain is owned by a specialized AI Agent with persistent memory, autonomous reasoning, and the ability to escalate cross-domain issues.

## The Hierarchy

```
Agent CEO (Tes) — Strategic oversight, cross-domain reasoning
  ├── Agent Finance (Ledger) — Accounts, transactions, invoices, budgets
  ├── Agent HR (Harmony) — Employees, payroll, leave, workforce planning
  ├── Agent Sales (Pipeline) — Customers, pipeline, leads, revenue forecasting
  ├── Agent Inventory (Stockwatch) — Products, stock, suppliers, supply chain
  ├── Agent Compliance (Sentinel) — Security, anomalies, audit, regulations
  ├── Agent Projects (Milestone) — Projects, tasks, milestones, resources
  └── Agent Operations (Conductor) — Documents, workflows, approvals, processes
```

## Interacting with Agents

### Chat
Navigate to **Ghost Control → Agents**, click on any agent in the org chart, and start chatting. Each agent responds within its domain expertise:

- Ask **Ledger** about cash flow trends or invoice status
- Ask **Harmony** about leave balances or staffing gaps
- Ask **Pipeline** about deal probabilities or revenue forecasts
- Ask **Stockwatch** about stock levels or reorder suggestions
- Ask **Sentinel** about security alerts or compliance status

### Escalation
When an issue spans multiple domains, agents automatically escalate to Agent CEO (Tes). For example:
- Sales closing a big deal → Inventory can't fulfill → Escalation to Tes
- Budget overrun in one department → HR needs to adjust → Escalation to Tes

### Memory & Growth
Each agent maintains persistent memory:
- **Domain Knowledge** — Facts and patterns learned from data
- **User Preferences** — How you like information presented
- **Learned Patterns** — Trends discovered over time
- **Escalation History** — Record of cross-domain issues

Agents gain XP through interactions and level up:
- Level 0: Newborn — Fresh, learning the basics
- Level 1: Infant — Beginning to form memories
- Level 2: Apprentice — Recognizing patterns
- Level 3: Proficient — Making proactive suggestions
- Level 4: Expert — Deep domain reasoning
- Level 5: Master — Autonomous decision-making within scope

## Agent Status

- **Active** (green) — Running and responsive
- **Dormant** (gray) — Module disabled, agent is sleeping
- **Training** (amber) — Learning from new data

## Inter-Agent Communication

Agents communicate through a message system:
- **Escalations** — Issues that need parent agent attention
- **Reports** — Periodic status updates to CEO
- **Queries** — Asking another agent for data
- **Directives** — CEO instructions to sub-agents
- **Insights** — Sharing discovered patterns

View any agent's inbox by selecting them and clicking the "Inbox" tab.

## Why This Matters

No other ERP has this. SAP's Joule, Salesforce's Einstein, Oracle's Digital Assistant — they're all chatbots bolted onto static modules. GhostFoundry's agents are autonomous minds that own business domains, collaborate, learn, and evolve. That's the difference between software that you operate and software that operates for you.
