Operational memory
Retain incident knowledge with visible truth state and transparent retrieval rather than silently promoting generated text into fact.
Incident episodes
IncidentEpisode combines a portable incident, its DiagnosisResult, and a TruthState. The provider-neutral MemoryStore port keeps storage replaceable: the SQLite reference adapter covers local use, and the independently packaged lumis-sdk-postgres-memory plugin provides durable shared memory for teams. incident_id is an idempotency key—repeating identical content is safe, while different content for the same key raises a conflict rather than silently overwriting history.
Truth states
| State | Meaning |
|---|---|
| unconfirmed_hypothesis | Diagnosis retained without a confirmed resolution. Never reusable. |
| human_confirmed | A person recorded the cause, action, and outcome. |
| verification_confirmed | An explicit verified resolution tied to a passed verification record. |
| rejected | The retained hypothesis was contradicted—by a person or a failed verification. |
| superseded | Newer confirmed knowledge replaced the record. |
Transparent retrieval
MemoryQuery supports text plus optional classification and pipeline filters, and reusable_only=True restricts results to human- or verification-confirmed records. Every MemoryMatch carries a non-negative score, human-readable reasons (matched terms and truth state), and score_components separating the lexical, filter, and truth contributions—so ranking is explainable, not a black box. Semantic retrieval belongs behind an optional adapter, never as a hidden default.
From verified pattern to deterministic rule
The research architecture closes a second learning loop: when the same diagnosis-and-remediation pattern recurs across several verified episodes, it becomes a candidate for promotion into deterministic policy. Promotion is not an automatic model write. A project should aggregate only confirmed episodes, require an explicit recurrence threshold, generate a reviewable rule proposal, replay it against historical cases, and merge the rule through the normal version-control and review process.
- Group episodes by stable failure signature, diagnosis, remediation, and verified outcome—not raw text similarity alone.
- Exclude unconfirmed, rejected, superseded, failed, unknown, and timed-out outcomes from promotion evidence.
- Attach provenance: contributing incident IDs, rule version, threshold, reviewer, replay results, and approval decision.
- Keep the candidate inert until review and tests pass; promotion creates a versioned deterministic rule, never execution authority.
Replay evaluation
lumis_sdk.evaluation.evaluate_replay replays a corpus of ReplayCase values through the deterministic engine and returns exact match counts. Keep corpora synthetic or public, version them with the application, and report methodology with results—this is how rule changes are validated against history without touching production data.