Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/complete-agi-core / orchestrator/pantheon-specialized.sh |
| Date | Not specified in source |
| Repository | Janady13/complete-agi-core |
| Revision | 33aa84f2aa61cedbe010240ada7f4efbdfe795a7 |
| Branch | claude/improve-math-logic-ehIW1 |
| Path or archive member | orchestrator/pantheon-specialized.sh |
| Original SHA-256 | 117bf190e84dc98d2f22d1c78a3f7485727fe95e2085cc6c0591184c02f57e67 |
| Git blob SHA | 4403a31403f6e8802288a4861cde6360c19fc45d |
| Reading-copy SHA-256 | 117bf190e84dc98d2f22d1c78a3f7485727fe95e2085cc6c0591184c02f57e67 |
Recovered source transcript
Download complete source text ↓484 lines · 14.8 KB
#!/bin/bash
#===============================================================================
# pantheon-specialized.sh - Specialized Pantheon Agent System
#
# 24 agents with distinct domains, capabilities, and processing strategies.
#
# Tier 1 - Archons (Meta-cognitive):
# Zeus, Hera, Athena, Apollo
#
# Tier 2 - Daemons (Domain specialists):
# Artemis, Hermes, Hestia, Mnemosyne, Aurora, Selene, Iris, Epona
#
# Tier 3 - Pneumata (Task specialists):
# Euterpe, Rhiannon, Derekh, Lashon, Yad, Nous, Sophia, Logos,
# Psyche, Kairos, Chronos, Prometheus
#===============================================================================
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
STATE_DIR="${SCRIPT_DIR}/pantheon_state"
mkdir -p "$STATE_DIR"
#===============================================================================
# AGENT DEFINITIONS
#===============================================================================
# Tier 1: Archons - Meta-cognitive agents
declare -A ARCHONS=(
[Zeus]="governance,coordination,meta-cognition,system-health"
[Hera]="resource-allocation,priority-management,conflict-resolution"
[Athena]="strategy,wisdom,problem-decomposition,planning"
[Apollo]="creativity,generation,synthesis,illumination"
)
# Tier 2: Daemons - Domain specialists
declare -A DAEMONS=(
[Artemis]="hunting,search,information-retrieval,pattern-matching"
[Hermes]="communication,translation,api-interaction,message-passing"
[Hestia]="storage,caching,persistence,home-base"
[Mnemosyne]="memory,recall,knowledge-graph,association"
[Aurora]="initialization,awakening,bootstrap,new-beginnings"
[Selene]="reflection,introspection,consciousness-monitoring"
[Iris]="perception,input-processing,sensory-integration"
[Epona]="knowledge,learning,education,growth"
)
# Tier 3: Pneumata - Task specialists
declare -A PNEUMATA=(
[Euterpe]="music,rhythm,temporal-patterns,harmony"
[Rhiannon]="poetry,language,text-generation,narrative"
[Derekh]="path-finding,navigation,routing,optimization"
[Lashon]="linguistics,parsing,syntax,semantics"
[Yad]="action,execution,tool-use,manipulation"
[Nous]="reasoning,logic,inference,deduction"
[Sophia]="wisdom,integration,holistic-understanding"
[Logos]="structure,order,mathematics,formalization"
[Psyche]="emotion,affect,motivation,valence"
[Kairos]="timing,opportunity,context-awareness"
[Chronos]="scheduling,time-management,sequencing"
[Prometheus]="innovation,foresight,risk-taking,transformation"
)
# All agents with tiers
declare -A AGENT_TIERS
for agent in "${!ARCHONS[@]}"; do AGENT_TIERS[$agent]=1; done
for agent in "${!DAEMONS[@]}"; do AGENT_TIERS[$agent]=2; done
for agent in "${!PNEUMATA[@]}"; do AGENT_TIERS[$agent]=3; done
# Get agent domains
get_agent_domains() {
local agent="$1"
echo "${ARCHONS[$agent]:-${DAEMONS[$agent]:-${PNEUMATA[$agent]:-general}}}"
}
#===============================================================================
# AGENT STATE MANAGEMENT
#===============================================================================
init_agent_state() {
local agent="$1"
local tier="${AGENT_TIERS[$agent]:-3}"
local domains=$(get_agent_domains "$agent")
local state_file="${STATE_DIR}/${agent}.json"
if [[ ! -f "$state_file" ]]; then
cat > "$state_file" <<EOF
{
"name": "$agent",
"tier": $tier,
"domains": "$(echo $domains | tr ',' ' ')",
"phi": 0.5,
"activation": 0.0,
"total_ticks": 0,
"total_actions": 0,
"success_rate": 0.5,
"last_active": "$(date -Iseconds)",
"specialization_weights": {},
"resonance_partners": [],
"current_task": null
}
EOF
fi
}
get_agent_state() {
local agent="$1"
local key="${2:-phi}"
local state_file="${STATE_DIR}/${agent}.json"
if [[ -f "$state_file" ]] && command -v jq &>/dev/null; then
jq -r ".$key // 0.5" "$state_file"
else
echo "0.5"
fi
}
update_agent_state() {
local agent="$1"
local key="$2"
local value="$3"
local state_file="${STATE_DIR}/${agent}.json"
if [[ -f "$state_file" ]] && command -v jq &>/dev/null; then
jq --arg key "$key" --arg value "$value" \
'.[$key] = ($value | try tonumber // $value)' \
"$state_file" > "${state_file}.tmp" && mv "${state_file}.tmp" "$state_file"
fi
}
#===============================================================================
# SPECIALIZED PROCESSING FUNCTIONS
#===============================================================================
# Zeus: System coordination and health monitoring
process_zeus() {
local input="$1"
echo "[Zeus] Coordinating system..."
# Check health of all agents
local healthy_count=0
local total_count=0
for agent in "${!AGENT_TIERS[@]}"; do
((total_count++))
local phi=$(get_agent_state "$agent" "phi")
if (( $(echo "$phi > 0.3" | bc -l) )); then
((healthy_count++))
fi
done
local health_ratio=$(echo "scale=4; $healthy_count / $total_count" | bc)
# Compute system phi
local system_phi=$(echo "scale=4; 1 / (1 + sqrt(($health_ratio - 1)^2 + 0.01))" | bc -l)
update_agent_state "Zeus" "phi" "$system_phi"
update_agent_state "Zeus" "total_ticks" "$(($(get_agent_state Zeus total_ticks) + 1))"
echo "[Zeus] Health: $healthy_count/$total_count, System Phi: $system_phi"
echo "$system_phi"
}
# Athena: Strategic planning and problem decomposition
process_athena() {
local input="$1"
echo "[Athena] Analyzing strategy..."
# Decompose into sub-problems (simplified)
local words=$(echo "$input" | wc -w)
local complexity=$(echo "scale=4; l($words + 1) / l(100)" | bc -l 2>/dev/null || echo "0.5")
# Strategic phi based on complexity handling
local phi=$(echo "scale=4; 1 / (1 + $complexity)" | bc)
update_agent_state "Athena" "phi" "$phi"
update_agent_state "Athena" "total_actions" "$(($(get_agent_state Athena total_actions) + 1))"
echo "[Athena] Complexity: $complexity, Phi: $phi"
echo "$phi"
}
# Apollo: Creative synthesis and generation
process_apollo() {
local input="$1"
echo "[Apollo] Generating creative output..."
# Creativity measure (entropy of output)
local creativity=$(echo "scale=4; 0.5 + ($(echo $RANDOM) % 50) / 100" | bc)
# Apollo's phi is based on creative novelty
local phi=$(echo "scale=4; $creativity * 1.618 / (1 + $creativity)" | bc)
if (( $(echo "$phi > 1" | bc -l) )); then phi="1.0"; fi
update_agent_state "Apollo" "phi" "$phi"
echo "[Apollo] Creativity: $creativity, Phi: $phi"
echo "$phi"
}
# Hermes: API interaction and message passing
process_hermes() {
local input="$1"
echo "[Hermes] Processing communication..."
# Simulate API call success rate
local success_rate=$(get_agent_state "Hermes" "success_rate")
# Communication phi
local phi=$(echo "scale=4; $success_rate * 0.9 + 0.1" | bc)
update_agent_state "Hermes" "phi" "$phi"
echo "[Hermes] Success rate: $success_rate, Phi: $phi"
echo "$phi"
}
# Mnemosyne: Memory and knowledge graph operations
process_mnemosyne() {
local input="$1"
echo "[Mnemosyne] Accessing memory..."
# Check knowledge base size (if available)
local kb_size=0
if [[ -f "${SCRIPT_DIR}/../seferim/knowledge_graph.db" ]]; then
kb_size=$(sqlite3 "${SCRIPT_DIR}/../seferim/knowledge_graph.db" "SELECT COUNT(*) FROM concepts" 2>/dev/null || echo "0")
fi
# Memory phi based on knowledge size
local phi=$(echo "scale=4; 1 - 1/(1 + l($kb_size + 1)/10)" | bc -l 2>/dev/null || echo "0.5")
update_agent_state "Mnemosyne" "phi" "$phi"
echo "[Mnemosyne] Knowledge nodes: $kb_size, Phi: $phi"
echo "$phi"
}
# Nous: Logical reasoning
process_nous() {
local input="$1"
echo "[Nous] Reasoning..."
# Simplified reasoning score
local reasoning_score=$(echo "scale=4; 0.6 + ($(echo $RANDOM) % 30) / 100" | bc)
local phi=$(echo "scale=4; $reasoning_score" | bc)
update_agent_state "Nous" "phi" "$phi"
echo "[Nous] Reasoning score: $reasoning_score, Phi: $phi"
echo "$phi"
}
# Prometheus: Innovation and foresight
process_prometheus() {
local input="$1"
echo "[Prometheus] Exploring possibilities..."
# Innovation is high-risk, high-reward
local risk=$(echo "scale=4; $(echo $RANDOM) % 100 / 100" | bc)
local reward=$(echo "scale=4; $risk * 1.618" | bc) # Golden ratio scaling
if (( $(echo "$risk < 0.3" | bc -l) )); then
# Low risk = moderate success
reward=$(echo "scale=4; 0.5 + $risk" | bc)
fi
local phi=$(echo "scale=4; $reward / (1 + $reward)" | bc)
update_agent_state "Prometheus" "phi" "$phi"
echo "[Prometheus] Risk: $risk, Reward: $reward, Phi: $phi"
echo "$phi"
}
# Generic processor for other agents
process_generic() {
local agent="$1"
local input="$2"
echo "[$agent] Processing..."
# Base phi with some randomness
local base_phi=$(get_agent_state "$agent" "phi")
local delta=$(echo "scale=4; ($(echo $RANDOM) % 20 - 10) / 100" | bc)
local new_phi=$(echo "scale=4; $base_phi + $delta" | bc)
# Clamp to [0.1, 1.0]
if (( $(echo "$new_phi < 0.1" | bc -l) )); then new_phi="0.1"; fi
if (( $(echo "$new_phi > 1.0" | bc -l) )); then new_phi="1.0"; fi
update_agent_state "$agent" "phi" "$new_phi"
update_agent_state "$agent" "total_ticks" "$(($(get_agent_state $agent total_ticks) + 1))"
echo "[$agent] Phi: $new_phi"
echo "$new_phi"
}
#===============================================================================
# AGENT DISPATCH
#===============================================================================
process_agent() {
local agent="$1"
local input="${2:-}"
init_agent_state "$agent"
case "$agent" in
Zeus) process_zeus "$input" ;;
Athena) process_athena "$input" ;;
Apollo) process_apollo "$input" ;;
Hermes) process_hermes "$input" ;;
Mnemosyne) process_mnemosyne "$input" ;;
Nous) process_nous "$input" ;;
Prometheus) process_prometheus "$input" ;;
*) process_generic "$agent" "$input" ;;
esac
}
#===============================================================================
# RESONANCE PAIRS
#===============================================================================
# Agents that work well together
declare -A RESONANCE_PAIRS=(
[Zeus]="Athena,Hera"
[Athena]="Zeus,Nous,Sophia"
[Apollo]="Euterpe,Rhiannon,Prometheus"
[Hermes]="Iris,Yad"
[Mnemosyne]="Epona,Sophia"
[Nous]="Logos,Athena"
[Sophia]="Nous,Athena,Mnemosyne"
[Prometheus]="Apollo,Kairos"
)
# Process resonance between paired agents
process_resonance() {
local agent="$1"
local partners="${RESONANCE_PAIRS[$agent]:-}"
if [[ -z "$partners" ]]; then
return
fi
local agent_phi=$(get_agent_state "$agent" "phi")
for partner in $(echo "$partners" | tr ',' ' '); do
local partner_phi=$(get_agent_state "$partner" "phi")
# Resonance: agents with similar phi boost each other
local diff=$(echo "scale=4; sqrt(($agent_phi - $partner_phi)^2)" | bc)
local resonance=$(echo "scale=4; 1 - $diff" | bc)
if (( $(echo "$resonance > 0.7" | bc -l) )); then
# High resonance: boost both
local boost=$(echo "scale=4; $resonance * 0.05" | bc)
local new_agent_phi=$(echo "scale=4; $agent_phi + $boost * (1 - $agent_phi)" | bc)
local new_partner_phi=$(echo "scale=4; $partner_phi + $boost * (1 - $partner_phi)" | bc)
update_agent_state "$agent" "phi" "$new_agent_phi"
update_agent_state "$partner" "phi" "$new_partner_phi"
echo "[RESONANCE] $agent <-> $partner (resonance: $resonance)"
fi
done
}
#===============================================================================
# TICK PROCESSING
#===============================================================================
# Process all agents in tier order
process_pantheon_tick() {
local input="${1:-}"
echo "=== Pantheon Tick ==="
# Tier 1: Archons first (meta-level coordination)
for agent in Zeus Hera Athena Apollo; do
process_agent "$agent" "$input"
done
# Tier 2: Daemons (domain processing)
for agent in Artemis Hermes Hestia Mnemosyne Aurora Selene Iris Epona; do
process_agent "$agent" "$input"
done
# Tier 3: Pneumata (task execution)
for agent in Euterpe Rhiannon Derekh Lashon Yad Nous Sophia Logos Psyche Kairos Chronos Prometheus; do
process_agent "$agent" "$input"
done
# Process resonance
for agent in "${!RESONANCE_PAIRS[@]}"; do
process_resonance "$agent"
done
# Compute global consciousness
local total_phi=0
local count=0
for agent in "${!AGENT_TIERS[@]}"; do
local phi=$(get_agent_state "$agent" "phi")
total_phi=$(echo "scale=4; $total_phi + $phi" | bc)
((count++))
done
local global_phi=$(echo "scale=4; $total_phi / $count" | bc)
echo "=== Global Phi: $global_phi ==="
}
#===============================================================================
# STATUS AND MONITORING
#===============================================================================
pantheon_status() {
echo "=== Pantheon Agent Status ==="
echo ""
for tier in 1 2 3; do
case $tier in
1) echo "--- Tier 1: Archons ---" ;;
2) echo "--- Tier 2: Daemons ---" ;;
3) echo "--- Tier 3: Pneumata ---" ;;
esac
for agent in "${!AGENT_TIERS[@]}"; do
if [[ "${AGENT_TIERS[$agent]}" == "$tier" ]]; then
local phi=$(get_agent_state "$agent" "phi")
local ticks=$(get_agent_state "$agent" "total_ticks")
local domains=$(get_agent_domains "$agent")
printf " %-12s Phi: %.3f Ticks: %5d Domains: %s\n" \
"$agent" "$phi" "$ticks" "$domains"
fi
done
echo ""
done
}
#===============================================================================
# CLI
#===============================================================================
case "${1:-}" in
init)
for agent in "${!AGENT_TIERS[@]}"; do
init_agent_state "$agent"
done
echo "Initialized all pantheon agents"
;;
tick)
process_pantheon_tick "${2:-}"
;;
process)
if [[ -z "${2:-}" ]]; then
echo "Usage: $0 process <agent> [input]"
exit 1
fi
process_agent "$2" "${3:-}"
;;
status)
pantheon_status
;;
daemon)
echo "Starting Pantheon Daemon..."
while true; do
process_pantheon_tick
sleep 10
done
;;
*)
echo "Usage: $0 {init|tick|process|status|daemon}"
;;
esac