PHP backend server for the Stobe AI Framework for Kenshi. It is the Kenshi-side counterpart to HerikaServer patterns (event routing, prompt building, connector model), with Stobe-specific schema and game logic.
- Kenshi +
Stobe.dllsends HTTP events to StobeServer. - StobeServer routes events through
main.phpandprocessor/*. - Prompt/context is built from DB state and recent event history.
- LLM connectors generate responses.
- Responses are streamed back to the plugin and optional TTS is produced/cached.
StobeServer now includes a Herika-style background processor:
service/start.sh: daemon loop with heartbeat listener (127.0.0.1:12346).service/manager.php: periodic cycle tick for non-interactive workloads.- UI auto-start/status hooks in
ui/index.phpandui/home.php.
The processor is intended for periodic maintenance workloads that should not add latency to foreground chat responses:
- Middle-term memory summarization (
stobeMaybeRunMiddleTermCycle). - Regular memory packing/summarization (
stobeMaybeRunRegularMemoryCycle). - Dynamic profile refresh (
stobeMaybeRunDynamicProfileCycle).
main.php,stream.php,chat.php,gamedata.php,stt.php: main HTTP entry points.lib/bootstrap.php: canonical runtime bootstrap and shared includes.lib/settings.php:general_settingsread/write helpers.lib/chat_helper_functions.php: prompt assembly, world knowledge retrieval, response shaping.processor/: event processors (chat.php,rechat.php,bored.php,combat.php,context.php,location.php, etc).connector/: LLM connectors.tts/,stt/: speech connectors.ui/: dashboard and admin pages.data/schema.sql: schema + default settings.log/: runtime logs.soundcache/: TTS audio cache.
StobeServer is DB-config driven:
- Runtime settings are stored in
general_settings. - There is no runtime
conf.php/INI settings model for server behavior. - Global Settings UI reads/writes those DB keys.
- PHP 8.2+ with Apache
- PostgreSQL with pgvector
- DwemerDistro/WSL runtime (recommended deployment target)
Building AI systems is complex, and changes can unintentionally affect other connected systems. Before opening a pull request, follow the repository PR template and make sure the change has been discussed with either RANGROO or tyler.maister in Discord. When adding new features, prefer making them optional or toggleable where practical.