Samuel Gomez Serrano

Senior Software Engineer | System Architecture & AI Engineering

I design systems teams can understand, operate, and evolve.

Enterprise insurance platforms at work. In the open, Kairo Runtime: a control plane that routes AI engineering agents by capability, quota, and cost.

Watch the assembly come apart

npm
@kal-elsam/kairo-runtime
source
github.com/Kal-elSam/harness
license
MIT
requires
Node.js 22.19 or newer

Kairo Runtime, exploded

Six modules, read from the public repository. Scroll to take the assembly apart.

  1. kairo-router plugin

    Claude Code plugin: denies non-role agent launches, injects dispatch instructions, adds CodeGraph context.

    source
    integrations/claude-code/kairo-router
    check
    kairo team check-agent
  2. Project router

    Resolves each role to a real model, checking strategy, model entitlement and provider eligibility.

    source
    src/global/team/project-router.js
    input
    approved team and provider capacity
  3. Capability scoring

    Scores models per role from percentile-normalized evidence. Missing evidence is never turned into a zero.

    source
    src/global/intelligence/capability-scoring.js
    outcomes
    after five attributed results, measured success replaces public role fit
  4. Quota pacing

    Paces remaining quota against the time left in each reset window. Missing signals stay unknown.

    source
    src/global/intelligence/quota-pacing.js
    pace
    remaining quota / remaining window time
  5. Fallback

    Under quota pressure an eligible fallback is selected, and a role’s fallback stays in that role.

    source
    src/global/team/exhaustion.js
    detection
    pure classification of provider failure output: no probes, writes or retries
  6. Provider adapters

    Adapter modules for the agent hosts Kairo works with.

    source
    src/global/adapters/
    files
    claude.js codex.js cursor.js opencode.js pi.js