Repository navigation
Expand file tree
/
Copy pathstart-all.sh
More file actions
executable file
·186 lines (168 loc) · 6.11 KB
/
Copy pathstart-all.sh
File metadata and controls
executable file
·186 lines (168 loc) · 6.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#!/usr/bin/env bash
#
# Unified agent startup script
#
# Start all agents or a specific subset:
# ./start-all.sh # Start all available agents
# ./start-all.sh mfr # Start MFR system agents only
# ./start-all.sh debate # Start debate system agents only
#
# Or specify custom agent list:
# AGENTS=mistral,data,prolog ./start-all.sh
set -e
# Change to script directory
cd "$(dirname "$0")"
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
CYAN='\033[0;36m'
NC='\033[0m' # No Color
# Preset agent groups
ALL_AGENTS="coordinator,mistral,groqbot,analyst,creative,golem,chair,recorder,semem,mfr-semantic,data,prolog,executor,demo"
MFR_AGENTS="coordinator,mistral,golem,groqbot,analyst,creative,chair,recorder,semem,mfr-semantic,data,prolog,executor,demo"
DEBATE_AGENTS="chair,recorder,mistral,golem,groqbot,analyst,creative"
BASIC_AGENTS="mistral,groqbot,golem,data,prolog,demo"
echo -e "${BLUE}=== TIA Multi-Agent System ===${NC}"
echo ""
# Load .env file if it exists
if [ -f ".env" ]; then
echo -e "${GREEN}📄 Loading environment from .env file${NC}"
set -a # automatically export all variables
source .env
set +a
echo ""
fi
# Enable logging defaults if not already set
: "${LOG_LEVEL:=info}"
export LOG_LEVEL
# Determine which agents to start
if [ -n "$1" ]; then
case "$1" in
mfr)
echo -e "${CYAN}Starting MFR (Model-First Reasoning) system${NC}"
export AGENTS="$MFR_AGENTS"
;;
debate)
echo -e "${CYAN}Starting Debate system${NC}"
export AGENTS="$DEBATE_AGENTS"
;;
basic)
echo -e "${CYAN}Starting basic agents${NC}"
export AGENTS="$BASIC_AGENTS"
;;
help|--help|-h)
echo "Usage: $0 [preset|help]"
echo ""
echo "Presets:"
echo " mfr - MFR system (full suite): $MFR_AGENTS"
echo " debate - Debate system: $DEBATE_AGENTS"
echo " basic - Basic agents: $BASIC_AGENTS"
echo " (none) - All available agents"
echo ""
echo "Custom agent list:"
echo " AGENTS=mistral,data,prolog $0"
echo ""
echo "Available agents:"
echo " coordinator - MFR orchestrator"
echo " mistral - Mistral AI agent (requires MISTRAL_API_KEY)"
echo " groqbot - Groq AI agent (requires GROQ_API_KEY)"
echo " analyst - Mistral analyst variant (requires MISTRAL_API_KEY)"
echo " creative - Mistral creative variant (requires MISTRAL_API_KEY)"
echo " golem - Malleable agent with runtime prompt changes (requires MISTRAL_API_KEY)"
echo " semem - Semem MCP agent (optional)"
echo " mfr-semantic - MFR semantic constraint agent"
echo " data - SPARQL knowledge query agent"
echo " prolog - Tau-Prolog logic agent"
echo " executor - Plan execution agent (requires MISTRAL_API_KEY)"
echo " chair - Debate facilitator (requires MISTRAL_API_KEY)"
echo " recorder - Meeting recorder (requires SEMEM_AUTH_TOKEN)"
echo " demo - Simple demo bot"
exit 0
;;
*)
echo -e "${RED}Unknown preset: $1${NC}"
echo "Run '$0 help' for usage information"
exit 1
;;
esac
echo ""
elif [ -z "$AGENTS" ]; then
echo -e "${CYAN}Starting default MFR (Model-First Reasoning) system${NC}"
export AGENTS="$MFR_AGENTS"
echo ""
fi
# Check API keys and provide helpful feedback
WARNINGS=0
if [ -z "$MISTRAL_API_KEY" ] || [ "$MISTRAL_API_KEY" = "your_mistral_api_key_here" ] || [ "$MISTRAL_API_KEY" = "your API key" ]; then
echo -e "${YELLOW}⚠️ Warning: MISTRAL_API_KEY not set or is placeholder${NC}"
echo " Mistral-based agents will be skipped"
echo " Set MISTRAL_API_KEY in .env file to enable:"
echo " - mistral, analyst, creative, chair agents"
echo " - executor agent"
echo " Get your API key from: https://console.mistral.ai/"
echo ""
WARNINGS=$((WARNINGS + 1))
fi
if [ -z "$GROQ_API_KEY" ] || [ "$GROQ_API_KEY" = "your_groq_api_key_here" ]; then
# Only warn if groqbot is explicitly requested
if [[ "$AGENTS" == *"groqbot"* ]]; then
echo -e "${YELLOW}⚠️ Warning: GROQ_API_KEY not set or is placeholder${NC}"
echo " Groq agent will be skipped"
echo " Set GROQ_API_KEY in .env file to enable groqbot"
echo " Get your API key from: https://console.groq.com/"
echo ""
WARNINGS=$((WARNINGS + 1))
fi
fi
if [ -z "$SEMEM_AUTH_TOKEN" ] || [ "$SEMEM_AUTH_TOKEN" = "your-api-key" ]; then
# Only warn if semem is explicitly requested
if [[ "$AGENTS" == *"semem"* ]] || [[ "$AGENTS" == *"recorder"* ]]; then
echo -e "${YELLOW}⚠️ Warning: SEMEM_AUTH_TOKEN not set or is placeholder${NC}"
if [[ "$AGENTS" == *"semem"* ]] && [[ "$AGENTS" == *"recorder"* ]]; then
echo " Semem and Recorder agents will be skipped"
elif [[ "$AGENTS" == *"semem"* ]]; then
echo " Semem agent will be skipped"
else
echo " Recorder agent will be skipped"
fi
echo " (This is optional - system will work without them)"
echo ""
WARNINGS=$((WARNINGS + 1))
fi
fi
# Check for secrets file
if [ ! -f "config/agents/secrets.json" ]; then
echo -e "${RED}❌ Error: config/agents/secrets.json not found${NC}"
echo " Create this file with XMPP credentials for all agents"
echo ""
echo " Example structure:"
echo " {"
echo " \"mistral\": { \"password\": \"your_password\" },"
echo " \"data\": { \"password\": \"your_password\" },"
echo " \"prolog\": { \"password\": \"your_password\" }"
echo " }"
echo ""
exit 1
fi
if [ $WARNINGS -eq 0 ]; then
echo -e "${GREEN}✅ Environment checks passed${NC}"
echo ""
fi
# Show what will be started
if [ -n "$AGENTS" ]; then
echo -e "${BLUE}Agent subset:${NC} $AGENTS"
else
echo -e "${BLUE}Starting:${NC} All available agents"
fi
echo ""
echo -e "${CYAN}Configuration:${NC}"
echo " XMPP service: ${XMPP_SERVICE:-<from profiles>}"
echo " XMPP domain: ${XMPP_DOMAIN:-<from profiles>}"
echo " Semem API: ${SEMEM_BASE_URL:-https://mcp.tensegrity.it}"
echo ""
# Start the agent runner
echo -e "${GREEN}Starting agents...${NC}"
echo ""
node src/services/run-all-agents.js