How hydrosemicon/kokomi_kernel works
Kokomi Kernel is the embodied-state and action-control layer for the Waifu 3.0 research platform. Its core workflow normalizes environment and interaction events into observations, maintains freshness-aware state and derived world facts, then assembles bounded cognitive context for an LLM. Audited responses pass through action control; execution outcomes return as observations. Separate capabilities cover persistent memory and social state, ASR and TTS, drive-based proposals, and operational controls. README documents the overall loop; source-index import references and excerpts support selected internal links, while unsampled details are not inferred.
Main entry points: alice.js Kernel runtime · index.js Behavior architecture · context-composer.js Context composer · observation.js Observation validation
Components 26
Runtime and interfaces
- Kernel runtime
alice.js - Operations dashboard
dashboard/app.js
Behavior and state
- Observation validation
src/behavior/observation.js - Persistent state
src/behavior/state-store.js - World model
src/behavior/world-model.js - Drive system
src/behavior/drive-system.js - Behavior proposals
src/behavior/spontaneous-behavior.js - Behavior architecture
src/behavior/index.js
Cognition and persistence
- Context composer
src/behavior/context-composer.js - Response protocol
src/protocol/llm-response.js - Memory store
src/memory/memory-store.js - Social state
src/social/social-state-store.js - Event store
src/behavior/event-store.js - Turn registry
src/behavior/turn-registry.js
Speech I/O
- ASR transcript
src/speech/asr-transcript.js - Capture coordinator
src/speech/asr-capture-coordinator.js - Echo guard
src/speech/echo-guard.js - TTS adapter
src/speech/tts-adapter.js - ElevenLabs provider
src/speech/elevenlabs-tts.js - Filler controller
src/speech/filler-controller.js - Filler manifest
src/speech/filler-manifest.js - Playback coordinator
src/speech/playback-coordinator.js
Actions and world
- Action gate
src/behavior/action-gate.js
Other components
- Physical and social environment
- LLM cognition
- Robot hardware and services
Connections 44
- Physical and social environment → Observation validation: sends events
README.md - Observation validation → Persistent state: reduces observations
README.md - Persistent state → World model: derives facts
README.md - Persistent state → Drive system: supplies inputs
README.md - World model → Drive system: supplies facts
README.md - World model → Behavior proposals: informs proposals
README.md - Drive system → Behavior proposals: informs proposals
README.md - Persistent state → Context composer: projects state
README.md - World model → Context composer: projects facts
README.md - Drive system → Context composer: projects drives
README.md - Behavior proposals → Context composer: includes options
README.md - Memory store → Context composer: supplies memories
README.md - Social state → Context composer: supplies social state
README.md - Context composer → LLM cognition: sends context
README.md - LLM cognition → Response protocol: returns response
README.md - Response protocol → Action gate: audits actions
README.md - Action gate → Robot hardware and services: dispatches actions
README.md - Robot hardware and services → Observation validation: returns outcomes
README.md - Kernel runtime → Behavior architecture: composes runtime
alice.js - Behavior architecture → Observation validation: uses validator
src/behavior/index.js - Behavior architecture → Persistent state: creates store
src/behavior/index.js - Behavior architecture → World model: creates model
src/behavior/index.js - Behavior architecture → Drive system: creates system
src/behavior/index.js - Behavior architecture → Behavior proposals: creates engine
src/behavior/index.js - Behavior architecture → Context composer: creates composer
src/behavior/index.js - Kernel runtime → Observation validation: ingests events
alice.js - Kernel runtime → Memory store: retrieves memories
alice.js - Kernel runtime → Social state: reads social context
alice.js - Kernel runtime → Response protocol: audits response
README.md - Response protocol → Memory store: validates proposals
src/protocol/llm-response.js - Response protocol → Social state: validates proposals
src/protocol/llm-response.js - Kernel runtime → Event store: records events
alice.js - Kernel runtime → Action gate: dispatches actions
alice.js - Kernel runtime → Turn registry: tracks turns
alice.js - Capture coordinator → ASR transcript: coordinates capture
README.md - Echo guard → ASR transcript: suppresses echo
src/speech/asr-transcript.js - ASR transcript → Observation validation: forwards transcripts
README.md - Kernel runtime → ASR transcript: configures ingestion
alice.js - Kernel runtime → TTS adapter: dispatches speech
README.md - TTS adapter → ElevenLabs provider: delegates speech
src/speech/tts-adapter.js - ElevenLabs provider → Playback coordinator: plays audio
- Filler controller → Filler manifest: uses manifest
- Filler controller → Playback coordinator: coordinates clips
- Operations dashboard → Kernel runtime: operates kernel
README.md