Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

add xspace-agent/xspace-agent/packages/create-xspace-agent/templates/multi-agent/src/index.js.hbs

overstepping905cf15315a8
diff --git a/xspace-agent/xspace-agent/packages/create-xspace-agent/templates/multi-agent/src/index.js.hbs b/xspace-agent/xspace-agent/packages/create-xspace-agent/templates/multi-agent/src/index.js.hbs
new file mode 100644
index 000000000..4d6b2fb1b
--- /dev/null
+++ b/xspace-agent/xspace-agent/packages/create-xspace-agent/templates/multi-agent/src/index.js.hbs
@@ -0,0 +1,64 @@
+require('dotenv/config');
+const { AgentTeam } = require('xspace-agent');
+
+const config = {
+ auth: {
+ token: process.env.X_AUTH_TOKEN,
+ },
+ agents: [
+ {
+ name: 'host',
+ ai: {
+ provider: '{{provider}}',
+ model: '{{defaultModel}}',
+ apiKey: process.env.{{providerEnvKey}},
+ systemPrompt:
+ 'You are the host of this X Space. Welcome speakers, ' +
+ 'guide the conversation, and keep things on topic.',
+ },
+ voice: {
+ provider: process.env.TTS_PROVIDER || 'openai',
+ apiKey: process.env.ELEVENLABS_API_KEY,
+ },
+ },
+ {
+ name: 'expert',
+ ai: {
+ provider: '{{provider}}',
+ model: '{{defaultModel}}',
+ apiKey: process.env.{{providerEnvKey}},
+ systemPrompt:
+ 'You are a subject matter expert in this X Space. ' +
+ 'Provide detailed, insightful answers when the host or audience asks questions.',
+ },
+ voice: {
+ provider: process.env.TTS_PROVIDER || 'openai',
+ apiKey: process.env.ELEVENLABS_API_KEY,
+ },
+ },
+ ],
+ turnManagement: {
+ strategy: 'round-robin',
+ turnDelay: 2000,
+ },
+};
+
+const spaceUrl = process.argv[2];
+if (!spaceUrl) {
+ console.error('Usage: npm start -- <space-url>');
+ process.exit(1);
+}
+
+const team = new AgentTeam(config);
+
+team.on('status', (status) => console.log(`[team] ${status}`));
+team.on('transcription', (data) => console.log(`[${data.speaker}] ${data.text}`));
+team.on('response', (data) => console.log(`[agent] ${data.text}`));
+team.on('error', (err) => console.error('[error]', err.message));
+
+team.join(spaceUrl).catch((err) => {
+ console.error('Failed to join space:', err.message);
+ process.exit(1);
+});
+
+