"KIKAgent: The Orchestrator That Architecturally Cannot Write Code"

KIK (Koordinator Inteligentnih Komponenti) has 5 tools — list_agents, delegate_agent, query_reports, query_detections, manage_schedule — and zero file write tools. Its system prompt is built dynamically from live agent registrations via buildAgentCapabilitiesSection(). Two operating modes: direct answer (simple questions) vs delegation (complex tasks). Config: max_iterations=8, temperature=0.3, no extended thinking.

KIK — Koordinator Inteligentnih Komponenti — is the brain that decides who does what. When a user asks "fix the N+1 query on invoices," KIK doesn't try to fix it. It delegates to LukAgent. When someone asks "create an auth module," KIK delegates to VajbCoder. When someone asks "what happened overnight?", KIK queries detection data directly.

The key insight: KIK has zero file tools. It cannot read files, write files, generate patches, or run commands. This isn't a limitation — it's the design. An orchestrator that can also execute will try to do everything itself instead of routing to specialists.


Five Tools, Zero File Access

| Tool | Purpose |
|------|---------|
| list_agents | Discover available specialists |
| delegate_agent | Route a task to a specialist |
| query_reports | Check agent execution history |
| query_detections | Read LUKA/BORNA findings |
| manage_schedule | Create/manage scheduled runs |

This tool set covers: discover → execute → observe → automate. Everything an orchestrator needs.


Dynamic System Prompt

KIK's prompt isn't static. It's assembled at runtime from three sources:

public function getSystemPrompt(): string
{
    $prompt = self::DEFAULT_PROMPT;
    $prompt .= $this->buildAgentCapabilitiesSection();
    $prompt .= $this->buildPromptSections();
    return $prompt;
}

DEFAULT_PROMPT — The base identity: "You are KIK, the central orchestrator..."

buildAgentCapabilitiesSection() — Queries AgentManager::getAgentInfo() and formats each agent's name, description, tools, and triggers into a readable section. When a new agent registers (PMAgent, FiskAgent, etc.), KIK automatically learns about it.

buildPromptSections() — Module-contributed sections. The PM module adds: "For project management tasks, delegate to @pmagent." Fiskalizacija adds: "For invoicing, delegate to @fiskagent." Each module teaches KIK about itself.


Two Operating Modes

KIK decides on each message:

Direct answer — Simple questions that don't need a specialist:

  • "What agents are available?" → calls list_agents, formats response

  • "What happened last night?" → calls query_detections, summarizes findings

  • "How many times did VajbCoder run this week?" → calls query_reports, counts


Delegation — Tasks that need a specialist:
  • "Fix the N+1 on invoices" → delegate_agent(agent: 'lukagent', task: 'Fix N+1...')

  • "Create a new PM project for auth" → delegate_agent(agent: 'pmagent', task: 'Create project...')

  • "Review the code in UserController" → delegate_agent(agent: 'reviewer', task: 'Review...')


The AI decides which mode based on the request. Simple informational queries get direct answers. Tasks that require tools KIK doesn't have get delegated.


Config: Fast and Deterministic

max_iterations: 8        // Routing shouldn't take many turns
temperature: 0.3         // Deterministic routing
model profile: 'balanced' // Sonnet-class (not Opus — routing != code gen)
extended thinking: false  // Unnecessary for classification

Eight iterations means: analyze the request (1), maybe query detections (2-3), delegate (4-5), relay the response (6-8). Most requests complete in 3-4 iterations.

Temperature 0.3 because you want the same request to route to the same agent every time. If "fix the N+1" sometimes goes to LukAgent and sometimes to VajbCoder, the system feels unreliable.


Up Next

Next up: VajbCoderAgent: Code Generation With Extended Thinking and Self-Check Loop — the agent that actually writes code, with the strongest model, git branch isolation, and a write-lint-test-fix cycle.

Comments (0)

No comments yet. Be the first to share your thoughts!

Leave a Comment

Recent Posts