Core Runtime
The LightMem2 core runtime is the host-independent execution engine that loads, manages, and runs plugins. It sits between the agent host and the plugins, providing a consistent environment regardless of which host the user is running.
Responsibilities
| Responsibility | Description |
|---|---|
| Plugin loading | Discovers, validates, and loads plugins from configured directories |
| Lifecycle management | Calls plugin hooks at the right time: install, enable, session start, session end, disable, uninstall |
| Configuration | Merges host config, plugin config, and user overrides into a resolved configuration |
| Event routing | Dispatches host events (messages, tool calls, session state changes) to plugins |
| Resource isolation | Ensures plugins cannot interfere with each other or the host |
Current Implementation
The core runtime is implemented across these workspace packages:
| Package | Purpose |
|---|---|
kernel | Shared types, interfaces, events, and runtime contracts |
runtime-core | Host-agnostic runtime engine and shared execution logic |
host-adapter | Shared host-adapter contracts and path-resolution interfaces |
layers/history | Canonical state, raw semantic turns, task registry |
layers/decision | Policy analysis, reduction/eviction decisions, estimator |
layers/memory experimental | Distillation and retrieval (in progress) |
Next
- Plugins — how plugins are structured
- Plugin Lifecycle — the plugin state machine
- Host Adapters — how hosts connect