LemonMemory. Ingest
(lemon_memory v0.1.0)
View Source
Asynchronous ingest pipeline that writes normalized memory documents to
LemonMemory.Store after a run is finalized.
Design
- Ingest runs in a dedicated
GenServerso it never blocks run finalization. - Ingest failures are logged and silently dropped — they must never crash or slow down the caller.
- The
session_searchfeature flag gates whether ingest is active. When the flag is:off(the default), calls toingest/3are no-ops.
Usage
# Called by LemonCore.Store when finalizing a run
LemonMemory.Ingest.ingest(run_id, record, summary)Configuration
Ingest respects LemonMemory.Store configuration and the session_search
feature flag in [features] of ~/.lemon/config.toml.
Summary
Functions
Returns a specification to start this module under a supervisor.
LemonCore.Store finalize-run hook: enqueue the finalized run for ingest.
Enqueue a finalized run for asynchronous memory ingest.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec handle_finalize_run(map()) :: :ok
LemonCore.Store finalize-run hook: enqueue the finalized run for ingest.
Wired by the runtime, not by the store:
config :lemon_core, LemonCore.Store,
finalize_run_hooks: [{LemonMemory.Ingest, :handle_finalize_run}]
@spec handle_finalize_run(GenServer.server(), map()) :: :ok
Enqueue a finalized run for asynchronous memory ingest.
This is a fire-and-forget cast. Feature flags are evaluated inside the ingest worker so the config only needs to be loaded once per ingest.
@spec ingest(GenServer.server(), run_id :: term(), record :: map(), summary :: map()) :: :ok