Domain AgentsAgentic Chat

Agentic Chat

When no domain agent matches a message, KULVEX falls back to agentic chat — a multi-round tool_use loop powered by the LLM.

How It Works

  1. User sends a message that doesn’t match any agent pattern
  2. KULVEX injects 12 curated tools into the system prompt (~984 tokens)
  3. The LLM generates a response, optionally calling tools
  4. If tools are called, results are fed back to the LLM
  5. Repeat up to 5 rounds until the LLM produces a final text response
User: "What's my energy production this week compared to last week?"

  ├── Round 1: LLM calls get_solar_history(days=14)
  ├── Round 2: LLM analyzes data, generates comparison
  └── Final: Natural language response with numbers

Tool Set

The ALWAYS-available tool set includes:

ToolDescription
get_weatherCurrent weather + forecast
get_solarSolar energy production
get_home_statusSmart home device states
control_deviceTurn on/off home devices
get_presenceWho’s home
get_securitySecurity system status
search_webWeb search
send_messageSend via messaging channel
get_system_infoServer stats
run_backupTrigger backup
analyze_urlFetch and analyze a URL
get_calendarCalendar events

Security: ToolGuard

Every tool call goes through ToolGuard before execution:

  • Validates parameters against expected schemas
  • Blocks dangerous operations (rm -rf, DROP TABLE, etc.)
  • Rate limits tool calls per session
  • Logs all tool executions for audit

Cloud vs Local

  • Local (Mnemo): Uses the same agentic loop but with Ollama-compatible tool_use format
  • Cloud (Claude): Uses Anthropic’s native tool_use API, which is more reliable for complex multi-step tasks

Limits

  • Max 5 rounds per message to prevent infinite loops
  • 12 tools in the ALWAYS set to fit within context window
  • If the LLM fails to produce a valid tool call, the round is skipped