Guides users through creating a new TIA XMPP agent based on mistral-minimal...
This Skill helps you create a new TIA XMPP agent by copying and customizing the mistral-minimal example.
When a user wants to create a new agent, follow these steps:
Ask the user:
../my-agent)tensegrity.it)general@conference.tensegrity.it)cp -r mistral-minimal /path/to/new-agent
cd /path/to/new-agent
name field to the agent name.env.example to .envMISTRAL_API_KEY, GROQ_API_KEY, etc.)mistral2.ttl to <agent-name>.ttlmistral2 to the new agent namexmpp:service, xmpp:domain if using different serveragent:roomJid if joining different roomagent:nickname to desired display name<agent-name>.js or keep as-isPROFILE_NAME default to match your agent namemain and start script if renamedIf using a different LLM provider, edit mistral-provider.js:
For Groq:
import { Groq } from "hyperdata-clients";
export class GroqProvider extends BaseLLMProvider {
initializeClient(apiKey) {
return new Groq({ apiKey });
}
async completeChatRequest({ messages, maxTokens, temperature }) {
return await this.client.client.chat.completions.create({
model: this.model,
messages,
max_tokens: maxTokens,
temperature
});
}
extractResponseText(response) {
return response.choices[0]?.message?.content?.trim() || null;
}
}
For Claude:
import { Claude } from "hyperdata-clients";
export class ClaudeProvider extends BaseLLMProvider {
initializeClient(apiKey) {
return new Claude({ apiKey });
}
async completeChatRequest({ messages, maxTokens, temperature }) {
return await this.client.client.messages.create({
model: this.model,
messages,
max_tokens: maxTokens,
temperature
});
}
extractResponseText(response) {
return response.content[0]?.text?.trim() || null;
}
}
Update the import and class name in the main agent file accordingly.
npm install
npm start
The agent should:
Test by sending a message in the room: @agent-name hello
Edit the agent's .ttl file:
agent:aiProvider [
a agent:MistralProvider ;
agent:model "mistral-small-latest" ;
agent:systemPrompt "You are a helpful assistant specializing in..." ;
agent:apiKeyEnv "MISTRAL_API_KEY"
] .
In the .ttl file:
agent:aiProvider [
a agent:MistralProvider ;
agent:lingueEnabled true ;
agent:lingueConfidenceMin 0.7 ;
agent:ibisSummaryEnabled true
] .
Update the model in the .ttl file:
agent:aiProvider [
a agent:MistralProvider ;
agent:model "mistral-large-latest"
] .
Or for Groq:
agent:aiProvider [
a agent:GroqProvider ;
agent:model "llama-3.3-70b-versatile"
] .
Agents can only join one room via the profile, but you can:
AGENT_PROFILE env varsExtend the provider's handle method or create a custom provider by extending BaseProvider.
my-agent/
โโโ config/agents/
โ โโโ my-agent.ttl # Agent profile
โ โโโ mistral-base.ttl # Base profile (keep or customize)
โ โโโ secrets.json # Auto-generated XMPP passwords
โโโ my-provider.js # LLM provider implementation
โโโ my-agent.js # Main agent runner
โโโ package.json # Dependencies and scripts
โโโ .env # API keys and overrides
โโโ .env.example # Template
โโโ README.md # Documentation
.ttl fileNODE_TLS_REJECT_UNAUTHORIZED=0 if using self-signed certstelnet tensegrity.it 5222.envagent:apiKeyEnv in profile@agent-name hello.ttl syntax (common issue: missing dots at end of statements)After creating your agent:
pm2 or systemdSee mistral-minimal/README.md for the complete reference implementation.