learning_hub
learning_hub
¶
Centralized learning hub — single store shared across all daemon jobs.
Instead of each job opening its own connection to the global learning store, the daemon maintains a single GlobalLearningStore instance and passes it to every JobService. This provides three benefits:
-
Instant cross-job learning. Pattern discoveries in Job A are immediately visible to Job B because they share the same in-memory store backed by one SQLite connection.
-
No locking contention. Multiple jobs writing through the same store instance serialise at the Python level rather than fighting over SQLite WAL locks across threads/processes.
-
Lifecycle ownership. The daemon controls when the store is created (
start) and when a final persist happens (stop), ensuring clean shutdown semantics.
Classes¶
LearningHub
¶
Centralized learning for daemon mode.
Instead of each job opening its own SQLite connection to ~/.marianne/global-learning.db, the daemon maintains a single GlobalLearningStore instance shared across all jobs.
Benefits: - Pattern discoveries in Job A immediately available to Job B - No cross-process SQLite locking contention - Periodic persistence instead of per-write persistence - Cross-job effectiveness tracking
Source code in src/marianne/daemon/learning_hub.py
Attributes¶
store
property
¶
Get the shared learning store.
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the hub has not been started yet. |
Functions¶
start
async
¶
Initialize store and start persistence loop.
Source code in src/marianne/daemon/learning_hub.py
stop
async
¶
Persist final state and stop.