This file persists context between Claude Code sessions.
- kbot-control.amxd — single M4L device, TCP 127.0.0.1:9000, JSON-RPC 2.0, 37+ LOM methods. Supersedes AbletonOSC + AbletonBridge + kbot-bridge (all three can be decommissioned).
- packages/kbot-control-standalone/ — open-source-ready package with client.ts, LICENSE, LAUNCH assets.
- packages/kbot/src/growth.ts — "kbot is N% better this week" dashboard. The Suno "My Taste visible" play applied to an agent: surface measurable self-improvement to users.
- packages/kbot/src/critic-gate.ts — always-on adversarial critic on every tool output. GAN-style generator/discriminator pattern; every agent move gets scored before it leaves the loop.
- packages/kbot/src/planner/hierarchical/ — 4-tier planner design inspired by Suno's 3-stage transformer: Goal / Phase / Action / ToolCall.
- packages/kbot/CURATION_PLAN.md — 670 → 52 tools plan. 87% reduction. Plan only, not executed.
- packages/kbot/research/action-tokens/ — research proposal for an agent-action token LM. This is the Suno lesson applied literally: neural codec → audio pattern maps cleanly to agent-action tokens → agent outputs.
- Full migration: 22 ableton_* tools now prefer kbot-control, fall back to OSC. Backwards-compatible rollout.
- Demo session: 90s Atlanta soul — Serum 2 Mark1 Stage + 6-device stock FX chain + Cm9 / Ab△9 / Fm11 / G7♭9 progression.
- Ableton 12.4 beta 15 removed LOM browser access — this is a real Ableton regression, not a kbot bug. Worked around in the migration. Report upstream.
- Suno's architecture (neural codec → audio pattern LM → audio) maps 1:1 onto agent design (action codec → action pattern LM → tool calls). That's the research moat.
- Warner Music settled with Suno Nov 2025; licensed models launching 2026. Licensing precedent opens the door for agent-action training data deals.
.claude/INTERVIEW_CHEAT.md— the pitch..claude/STUDIO_MODE.md— the Claude Code prompt to replay the demo session.- TZFM one-breath defense is ready (see
packages/2027/src/dsp/fm.rs).
- Action-token research pivoted to embedding nearest-neighbor after baseline measurement killed the transformer bet (2026-04-19) — heuristic
learned-router.tsalready hits 91.8% top-5, far above the transformer proposal's 40% ship bar. New direction: embedding-NN + user-specific fine-tuning; prototype inpackages/kbot/research/action-tokens/embedding-nn/, transformer-era artifacts in_archive/. - Must add
durationMs+ outcome logging totool-pipeline.ts— still relevant: the per-user fine-tune corpus for the embedding-NN approach depends on it. browser.load_by_nameneeds UI fallback until Ableton restores the API.- Critic false-positive rate needs retrospective analysis to tune strictness. Currently shipping at default thresholds.
- Hierarchical planner Phase 2 (real tier logic) not implemented yet — scaffolding only.
- Tool curation not executed — plan only. 670 → 52 reduction remains a design doc.
- v3.99.0 — skills-loader v2 (agentskills.io format), 14 bundled native skills, Hermes import (76 skills), CLI
kbot skills list | import. Outperforms Hermes on 8 of 10 axes per audit. - v3.99.1 — self-awareness.ts ground-truth block injected into every system prompt. Reads version, configured provider, model, platform. Fixed introspection hallucination (kbot was claiming "GPT-4 over WebSocket" when asked about itself).
- v3.99.2 — stronger ground-truth directives. Explicit "NOT GPT-4, NOT Hermes, NOT Llama" disclaimers. kbot now answers self-referential questions accurately: "Kernel Bot v3.99.2, Node.js 22.18.0, Ollama's gemma3:12b."
- Ground truth reflects CONFIGURED provider, not runtime fallback provider. If Ollama is down and Claude answers, kbot still says "Ollama" — needs a runtime probe.
- Tokenizer doesn't stem — "dreams/dream" and "curate/curation" miss in relevance scoring. 2 of 10 benchmark queries still pick imported Hermes skill over native kbot skill. ~50 lines of stemming would fix.
ollama launch kbotnot yet in Ollama's integration list.openclaw(predecessor) already is. Distribution work.
- @kernel.chat/kbot@3.99.0 published + installed globally.
- 14 bundled skills in
packages/kbot/skills/across 7 categories (software-development, self-improvement, orchestration, memory, music-production, deployment, emergent). Ship in the tarball viafiles: ["skills/**/*.md"]. - skills-loader.ts v2 — recursive category-dir scan, YAML frontmatter (agentskills.io + Hermes + kbot.metadata), conditional activation (
requires_toolsets/fallback_for_toolsets/platforms), relevance scoring with native-content boost, token budget (2000), dedup with precedence: project-local > bundled > user-global. - CLI commands:
kbot skills list,kbot skills import --from <hermes|claude|path>. Import symlinks 76 Hermes skills into~/.kbot/skills/imported/.
Research conclusion (stored in project_hermes_adoption.md): Hermes's edge was curated skill bodies + agentskills.io format. kbot had the plumbing (skill-system.ts, skill-library.ts, skill-rating.ts) but disconnected from the standard. Now compatible and superior on 8 of 10 axes — agent orchestration, memory cascade, self-improvement, music production are native categories Hermes has nothing for.
- Functional edge cases: 12/12 pass
- Security: 10/10 pass (no eval, no Function(), YAML bombs stored as strings, path traversal inert)
- Content truthfulness: 3 bugs found and fixed (
train-curate→train-self;recordSkillExecution/patchSkill→skill_manage; "17 specialists" → "25+") - Fresh install: extracted tarball contains all 14 SKILL.md files at correct paths
- 731/731 existing tests still pass; typecheck clean
- Tokenizer doesn't stem — "dreams" vs "dream" miss, "curate" vs "curation" miss. 2 of 10 benchmark queries still pick imported Hermes skill over native kbot skill. Low-priority; stemming would add ~50 lines.
ollama launch kbotnot yet in Ollama's integration list.openclaw(kbot's predecessor) already is. Distribution work, not code.
7 new files in packages/kbot/src/:
teacher-logger.ts, train-curate.ts, train-self.ts, train-cycle.ts, train-agent-trace.ts, train-merge.ts, train-grpo.ts
Integration:
agent.ts::callProvider→ logs every non-local Claude call to~/.kbot/teacher/traces.jsonlcli.ts→ 5 new subcommands:train-self | train-cycle | train-merge | train-grpo | train-agent-trace~/.zshrc→export KBOT_TEACHER_LOG=1(always-on at shell open)~/Library/LaunchAgents/com.kernel.kbot-train-self.plist→ Sundays 3am (dry-run; enable withlaunchctl load)
Known fragility:
kbot-discovery-daemon(PID 2491) auto-commits "evolution: kbot proposal" every few min. It previously wiped uncommitted files. Commit work fast. (Committed: 3 commits during this session —fea4acd5 → ff0498da.)
Corpus status (first run):
~/.claude/projects/**/*.jsonl→ 2,537 examples examined, 200 kept, mean score 0.700.~/.kbot/teacher/dataset-default.jsonl(353KB) ready for MLX.- Teacher traces file: empty until future kbot sessions run through new middleware.
Live run (background task b8h2y33gf):
- Command:
kbot train-self --mode default --max-examples 150 --iters 200 --num-layers 8 - Base:
mlx-community/Qwen2.5-Coder-7B-Instruct-4bit(first-run HF download ~4GB) - Log:
~/.kbot/teacher/train-self.log - Output model:
kernel-self:v<timestamp>in Ollama - Test when done:
ollama run kernel-self:<ts>
6 phases of local fine-tuning infra, end-to-end on M3 Max 36GB:
New files under packages/kbot/src/:
teacher-logger.ts— middleware that captures every Claude call as (prompt, response, tools, outcome) to~/.kbot/teacher/traces.jsonl. PII/key scrubber (sk-ant, ghp_, AIza, JWT, email, IP). Size rotation at 500MB. Wired intoagent.ts::callProviderat line ~820.train-curate.ts— scores + dedupes traces into training JSONL. Modes: default / reasoning / agent-trace / code-only.train-self.ts— end-to-end pipeline: curate → mlx_lm.lora → mlx_lm.fuse → quantize → Ollama deploy. Default bases per mode (Qwen2.5-Coder-7B / DeepSeek-R1-Distill-7B / Qwen2.5-Coder-14B).train-cycle.ts— DeepSeek-R1 Distill style on-policy loop: student (Ollama) generates → Claude grades with JSON rubric → corrected pairs append to corrections.jsonl → optional retrain.train-agent-trace.ts— reformats tool-use traces with explicit<think>/<tool>/<args>/<result>/<answer>tokens for Phase 4 specialization.train-merge.ts— MergeKit wrapper (TIES / SLERP / DARE / linear). Default kbot triad: qwen-coder + deepseek-r1 + self. MoE swap path documented (DeepSeek-V2-Lite-16B, Qwen3-MoE).train-grpo.ts— GRPO rollouts with verifiable rewards: regex-match, json-valid, build-pass, test-pass, lint-pass, custom. Group-relative advantage calc. Rollouts persist to JSONL; external runner hookup via--runner-cmd.
CLI commands registered in cli.ts before program.parse:
kbot train-self --mode [default|reasoning|agent-trace|code-only]kbot train-cycle --student --teacher --samples --threshold --retrainkbot train-merge [--default | --method ties/slerp/dare_ties/linear]kbot train-grpo --student --group-size --runner-cmdkbot train-agent-trace --min-tools --verified-only
Validated:
npm run typecheckcleankbot --helpshows all 5 new commands- Teacher-logger end-to-end test persists trace and scrubs
sk-ant-api03-...→sk-ant-<REDACTED>
Research grounding (2025–2026):
- s1/s1.1 (1K curated reasoning traces) → reasoning mode
- DeepSeek-R1 Distill (on-policy student+teacher) → train-cycle
- Magpie/Genstruct (instruction back-translation) → curator approach
- Agent-R / SWE-Gym (tool-token SFT) → agent-trace mode
- MergeKit / TIES / SLERP → train-merge
- GRPO (DeepSeek-Math) → train-grpo
- DeepSeek-V2-Lite / Qwen3-MoE → MoE swap path docs
Hardware target confirmed: M3 Max, 36GB unified, MLX 0.29.3 + mlx-lm 0.29.1 installed. ~350–500 tok/s expected for 7B LoRA.
Pending to fully close loop:
- Real user sessions must run through the (updated)
callProviderto populate~/.kbot/teacher/traces.jsonl. Today: zero traces yet. - Observer log (
~/.kbot/observer/session.jsonl) is tool-call-only, NOT prompt/response. It's a good source foragent-tracemode after grouping by session, but curator's default mode currently skips it correctly (yields 0 examples until teacher-log accumulates). - MergeKit / mlx_lm.fuse / llama.cpp convert binaries not yet checked; pipeline fails gracefully when missing.
- Bench harness (Claude-as-judge on 20 held-out tasks) not yet written — plan says write it at Phase 1 ship; queued for next session.
- npm publish + version bump (
v3.98.0 "teacher logger"→v3.99.0 "train-self"→v4.0.0 "reasoning distill") not done.
Next session pickup:
- Use kbot for 1–2 days so teacher-log populates (~200–500 traces minimum).
- Run
kbot train-self --dry-run --mode defaultto confirm curator emits a dataset. - Install
mergekit(pip install mergekit) to unblocktrain-merge. - Write the bench harness.
- Version-bump + publish v3.98.0 with teacher-logger alone (Phase 0 ships standalone value: forever-free dataset accumulation).
Stream V2 — 6 new systems (~5,700 lines, 26 new tools):
- PCM audio engine: oscillators, ADSR, chiptune sequencer, 7 SFX types
- Stream overlay: follow/raid/sub/donation/achievement alerts, goal bars, ticker, info bar
- Weather system: 12 weather types, day/night cycle, mood-coupled particles
- AI chat: Gemma 4 via Ollama, viewer memory, topic tracking, 4 response modes
- VOD system: auto-record, highlight detection, clips, YouTube upload
- Chat commands: 31 commands, XP economy, inventory, polls, boss fights, giveaways
Intelligence Coordinator (886 lines):
- 4-phase cognitive loop wired into agent.ts
- Pre-execution: learned routing, confidence gating, graph context, anticipation
- Tool oversight: pattern warnings, destructive tool detection, graph logging
- Post-response: heuristic self-eval (no LLM), pattern extraction, drive updates
- Cross-session consolidation every 10 interactions (selfTrain, graph prune, behaviour rules)
Stream Renderer Improvements:
- Pulsing red LIVE dot, weather/time in header, viewer count badge
- Ambient scenery: trees, rocks, grass tufts, flowers, clouds (procedural, camera-relative)
- Ground-level atmospheric haze, improved speech bubble position
- Chat panel accent border, branded kernel.chat watermark
- All v2 systems wired into render loop and chat processing chain
- Stream auditor agent created (.claude/agents/stream-auditor.md)
Stats: v3.97.0 on npm | 5,105 downloads/week | 19,384 total | 787+ tools | 37 registered users
Stream: Live on Twitch (kernelchatkbot) + Kick. Rumble needs fresh key each session.
Groq: $0.25 invoice for March (llama-3.1-8b-instant). Account needs login to check which email.
Pending:
- Tune PCM audio (enabled but untested on stream)
- Test all 31 chat commands live on Twitch
- X API tokens still expired (social posting blocked)
- Video demo still needed
- kernel.chat site needs tool count update (787+)
- Daily stream auditor cron (session-only, needs launchd for persistence)
Shipped:
- Dream engine (7-tier memory cascade, dreaming daemon)
- Buddy system (8 species, evolution, achievements, chat, trading cards, leaderboard)
- Voice input, memory scanner, user behavior learning
- Service watchdog, morning briefing
- Multi-agent finance, music gen, AI interpretability, cyber threat intel
- A2A protocol, Ollama 0.19 detection, DeepSeek V4 provider
- KBotBridge Remote Script (programmatic Ableton device loading via Browser API)
- iPhone control (Apple ecosystem + mobile-mcp)
- Buddy leaderboard on kernel.chat/#/leaderboard
- Coldplay Clocks session + Empire of the Sun / Tame Impala build
- Install script (kernel.chat/install.sh)
- CI fixed, demo GIF re-recorded, README updated everywhere
Stats: 764+ tools, 10 stars, 1,929 downloads (Apr 1), v3.73.3
Users: Jae (portfolio analysis emails), Harrison (install help), Ray (agent setup)
Ableton: KBotBridge on port 9997, AbletonOSC enabled. Two sessions saved.
Pending:
- Collective intelligence plan (partially built, not fully executed)
- iPhone Developer Mode needs Xcode installed for full device control
- X API tokens expired (social posting needs manual)
- Video demo needs better recording (current GIF has issues)
- kernel.chat site updated: scroll fixed, 764+ tools, responsive breakpoints
User Issue: Harrison (hwmccormick123@gmail.com)
- Harrison couldn't connect kbot to Claude Cowork — form requires
https://, kbot serve only spoke HTTP - Fixed by adding native HTTPS support to
kbot serve - Emailed him the fix via kernel-comms MCP
- Email agent is live and running (launchd
com.kernel.email-agent) — Harrison can reply and get AI responses via local Ollama
- serve.ts — Added
--httpsflag with auto-generated self-signed TLS cert (~/.kbot/certs/) - cli.ts — Added
--https,--cert <path>,--key <path>flags ensureSelfSignedCert()— EC P-256 cert via openssl, 365-day validity, localhost + 127.0.0.1 SANs- Users can also provide custom certs:
kbot serve --cert x.pem --key x.key - Clean build, clean typecheck
- HN post live: https://news.ycombinator.com/item?id=47622060 (Show HN: K:BOT — 738-tool terminal AI agent, plugs into Claude Cowork)
- X thread drafted — 4 tweets in
tools/social-posts-2026-04-02.md(X API tokens expired, needs manual post) - LinkedIn drafted — also in
tools/social-posts-2026-04-02.md - Demo recording script created at
tools/demo-recording.sh(asciinema + vhs + agg all installed) - Competitor intel: Skales (BSL-1.1, desktop GUI agent from Vienna, 6 HN points) — kbot differentiates on: true MIT open source, terminal-native, 738 tools, Claude Cowork connector, deeper local AI
- Running: 1,477 total runs, 608 pulses, 70 intel scans, 0 errors today
- Email agent: running via launchd since 6:30 AM
- Ollama: online with qwen2.5-coder:32b + 13 other models
- Resend webhook: active, pointing to Supabase
receive-emailedge function
- 738 registered tools
- v3.71.0 on npm
- npm: 4,799 downloads/week, 10 GitHub stars
- 170 npm versions published
- X thread needs manual posting (API tokens expired — needs
X_API_KEY,X_API_SECRET,X_ACCESS_TOKEN,X_ACCESS_SECRETin.env) - Claude-in-Chrome extension not bridged to Claude Code terminal (separate MCP — not configured in
~/.claude/settings.json) - npm publish with HTTPS changes not yet done
- Video demo still pending
- LinkedIn post needs manual posting
What happened: Claude Code's full source (~512K lines TypeScript) leaked via source maps in npm package @anthropic-ai/claude-code@2.1.88. Studied the architecture, built original features inspired by patterns found.
- Dream Engine (dream.ts, 660 lines) — post-session memory consolidation via local Ollama, exponential decay aging, dream journal auto-injected into system prompt
- 5 dream tools — dream_now, dream_status, dream_journal, dream_search, dream_reinforce
- Rival Intel Agent (.claude/agents/rival-intel.md) — competitive intelligence on Claude Code architecture
- CLI —
kbot dream run/status/search/journal - Published npm + pushed GitHub
- Buddy System (buddy.ts, 513 lines) — 8 ASCII companion species, 5 moods, deterministic assignment, persistent naming
- Voice Input (voice-input.ts, 466 lines) — local STT via whisper.cpp + Ollama, push-to-talk
- Memory Scanner (memory-scanner.ts, 564 lines) — passive in-session detection of corrections, preferences, project facts. Hooks into addTurn(), scans every 5 turns.
- 6 new tools — buddy_status, buddy_rename, voice_listen, voice_status, memory_scan_status, memory_scan_toggle
- Published npm + pushed GitHub
- 686 registered tools (was 671 at session start)
- v3.64.0 on npm (was v3.62.0 at session start)
- npm: 4,806 downloads/week, 6 GitHub stars
Active tracks (all Roland Cloud):
- TR-808 DRUMS (track 5) — 81-note pattern: bouncy syncopated kick, clap on 2&4, hi-hats w/ triplet rolls, rimshot, conga
- ZENOLOGY 808 BASS (track 17) — 10-note sub bass pattern, F1→Db2→Ab1→Eb2 with ghost re-triggers
- ZENOLOGY MELODY (track 18) — 14-note dreamy pluck motif, Ab→Bb→C movement
- XV-5080 PAD (track 13) — 16-note wide chord voicings, one per bar
- ZENOLOGY COUNTER (track 20) — 8-note subtle F5/Eb5 fills
What worked:
- kbot AbletonOSC tools: transport, track rename, clip create, MIDI write, clip fire, mixer — all solid
- Plugin loading via AppleScript:
View > Search in Browser→ type name → keyboard Down arrows → Return - ZENOLOGY (not FX) loads with 3 Down arrows to skip past FX presets
- TR-808 loaded via Python Quartz drag from browser to session view
cliclickinstalled via Homebrew for macOS mouse automation
What didn't work:
load_pluginOSC endpoint — always times out (custom kbot extension, not in standard AbletonOSC)- CGEvent mouse drags — coordinates didn't match screen positions (Retina scaling mismatch)
- IDE terminal steals focus from Ableton on every bash command — solved by running clicks inside
osascriptblocks - Loading multiple heavy Roland plugins in sequence can crash Ableton
Presets still needed (user will do manually):
- ZENOLOGY tracks need bass/pluck/texture presets selected
- XV-5080 needs a pad preset selected
- Add reverb + delay sends on melody and counter tracks
- v3.59.0 committed and pushed (96 files, +8,157 lines)
- Commit:
ea31a96b+1733988a(serum2 registration fix)
- 5 bug fixes — concurrent session state (memory.ts → Map), selfTrain guard, DNS rebinding SSRF, Gemini/Cohere tool warning, edit_file full-context diff
- Session isolation — serve.ts creates unique session per HTTP request, destroys after
- 9 M4L devices — auto-pilot, bass-synth, dj-fx, drum-synth, genre-morph, hat-machine, pad-synth, riser-engine, sidechain
- DJ Set Builder — registered in tool index
- Serum 2 Preset tool — was missing from index, now registered
- Computer-use expansion — 866+ lines added to computer.ts
- Ableton Live integration — OSC-based class in integrations/
list_granted_applications— worksrequest_access— works (granted Finder)screenshot— works (captured desktop)- Significance: kbot goes from terminal-only to full desktop agent
- 698 tests passing (vitest), 0 type errors
- 670+ registered tools
- npm publish blocked — token expired, needs
npm login
- npm publish (needs auth)
- GitHub release (can do next session)
- Show HN post
- Video demo
- Concurrent state in memory.ts — Replaced single
sessionHistoryarray withMap<string, ConversationTurn[]>keyed by session ID. All functions accept optionalsessionIdparam (default'default'). AddeddestroySession()for serve mode cleanup. CLI unchanged. - Concurrent state in learning.ts — Added concurrency docs (shared state is intentional for learning). Added
selfTrainRunningguard to prevent overlappingselfTrain()runs. - DNS rebinding in fetch.ts — SSRF protection now resolves hostname via
dns.lookup()and checks resolved IP against blocked ranges. Domains pointing to 127.0.0.1 are now caught. - Gemini/Cohere silent degradation — Added upfront warning when these providers are used with tools: "provider doesn't support native tool calling — tools will be parsed from text output".
- edit_file diff preview — Now passes full file content to diff preview (was passing just the matched fragment). Diff algorithm shows 3 lines of context with
...separators.
- Wired
sessionIdthroughAgentOptions→runAgent→ all memory calls serve.tsnow creates a unique session per HTTP request and destroys it after- Concurrent
/streamrequests no longer share conversation history
- 8 new session isolation tests in memory.test.ts
- 698 tests passing (up from 690)
- 0 type errors (tsc --noEmit clean)
- Clean build
- 600 registered tools (verified: 549 in tools/ + 51 elsewhere)
- README "600+" claim is accurate
Published: @kernel.chat/kbot@3.54.0, 3.55.0, 3.56.0 (npm + GitHub)
- 6 new CLI command groups, 32 new tools — everything manageable from terminal
kbot admin— users, billing (Stripe), moderation, platform stats (6 tools)kbot monitor— live health dashboard, logs, uptime checks, alerts (4 tools)kbot deploy— all-in-one ship: web + functions + npm + release (5 tools)kbot analytics— npm downloads, GitHub traffic, user growth, revenue (5 tools)kbot env— secrets management, sync, rotation guides (5 tools)kbot db— backup, inspect, SQL, migrations, health check (6 tools)- Fixed pre-existing duplicate 'sessions' command bug
- GitHub release: https://github.com/isaacsight/kernel/releases/tag/v3.56.0
- 9 M4L devices, DJ set builder, Serum 2 preset tool
- M4L bridge working on TCP 9999
- 30-min premixed trap set (664 bars, 16,778 notes, F minor, 144 BPM)
- 7 drum patterns, Roland Cloud instruments
- 4 npm publishes. v3.42.0 → v3.45.0
- 114 science tools across 11 lab files
- See git history for full details
- 13 npm publishes. v3.26.0 → v3.31.2
- Finance stack, cybersecurity, self-defense, cognitive systems
- ~10,000 lines, 350+ tools, 26 agents
- 60+ source files, 45K+ lines at kernel.chat/#/play
See git history.