Global AI Hackathon with Qwen Cloud · Track 1 · MemoryAgent
The memory thatforgets on purpose —and cites every claim.
A night nurse inherits 14 patients and a six-minute verbal handover. Lamplight is a
cross-shift clinical memory agent: it ingests 15 shifts of notes, decays what
resolved, keeps what can kill, and briefs the incoming nurse in
334 of 2,000 budgeted tokens — every claim cited to its source episode,
every memory operation signed into a hash-chained ledger.
● deployed live on Alibaba Function Compute · offline-deterministic · zero keys · byte-identical replay
0
tests passing, ~45 s, fully offline
0%
source coverage on lamplight_memory
0/2,000
tokens used in the hero brief — hard budget, never exceeded
0.00 vs 0.85
mean critical-item recall@5 vs naive RAG, same embeddings
0 vs 151
retired items resurfaced across 78 briefs — the baseline did it 151 times
Committed run: bench_results/RESULTS.md · regenerate with python memory_bench.py · bench on deterministic FakeQwen hash-embeddings, disclosed below.
The money shot
Fifteen shifts in. Watch it remember — and watch it forget.
This is the real output of lamplight demo: the Bed 9, shift-15 hero brief, rebuilt
byte-identically from committed fixtures. Card #1 stitches one drug reaction across three
shifts and three different phrasings. The retired panel is the part most memory systems
can't do: the resolved item is gone, visibly, and is never cited again.
HANDOVER BRIEF · Bed 9 · for shift 15 · engine: FakeQwen (offline)
334 / 2,000 tok
[s04] Cefazolin 1 g IV q8h started for cellulitis; first dose 0930, tolerated.
[s06] Faint erythema across the right forearm noted during 0200 turn — new since yesterday, not at old or current IV sites; possibly related to the antibiotic…
[s12] Red patches on the right forearm again at 0400 — small, flat, not raised; patient asked if it was a rash; no itch or airway symptoms.
Why tonight next cefazolin dose due 0200 tonight — confirm reaction status before it is hung.
Oral antibiotic switch planned tomorrow if bloods hold; ate well. Routine context — no action unless status changes.
Three phrasings — erythema, red patches, rash — consolidated into one
critical thread naive RAG only finds 67% of the time. Reproduce it yourself:
lamplight demo.
The memory design
Forgetting is a feature. So is proving it.
The track asks for efficient storage, timely forgetting, and recall inside a limited context window. Lamplight implements each as a tested, mechanical invariant — not a prompt.
Decay with real half-life math
critical items (allergy-suspect, falls-risk) never decay until explicitly resolved and confirmed. condition half-lives in 72 h, routine in one shift. Items below strength 0.05 are swept by a signed expire op — forgetting is a typed state transition, not silence.
strength(t) = s₀ · 2^(−Δt / λ)
Budget-knapsack brief
Top-40 retrieve → rerank → value = rerank × decay × criticality → greedy-pack into 2,000 tokens. It logs what it left out, and why. The #1 safety item is never traded for two cheap ones.
Mechanical citation validator
A brief card citing nothing — or citing a resolved or expired episode — is rejected, never patched. Invariants I1–I2, enforced by test.
Ed25519 hash-chained ops ledger
Every write, consolidate, decay, contradict, and expire is a signed, hash-chained ledger entry. Who knew what, when — and when the system forgot it — is a signed fact. Flip one byte and lamplight verify-chain fails, by test (I4).
Byte-identical replay
lamplight replay rebuilds the whole 15-shift ward from committed fixtures and byte-compares the hero brief to the committed expected output (I5) — with a socket guard installed so any network call raises.
Domain-agnostic engine
The engine ships as the lamplight-memory package — nothing clinical inside. examples/support_handover.py rebuilds it as an on-call support handover in ~15 lines: the payments-500s incident persists, queue noise decays.
Honest by design
What's real, what's disclosed, what's not.
Every claim on this page is reproducible offline from the repo. And every limitation is stated in the README before anyone has to ask.
Disclosure
Bench runs on hash-embeddings
The committed bench uses the deterministic FakeQwen transport with hash-embeddings. The 0.99-vs-0.85 separation comes from the memory architecture — decay, consolidation, two-stage retrieval — not embedding quality. Live text-embedding-v4 + qwen3-rerank paths exist behind DASHSCOPE_API_KEY.
Disclosure
The baseline honestly wins its ties
Naive RAG scores 1.00 on plainly-worded threads — same as Lamplight. The edge is decisive exactly where architecture matters: the buried falls-risk clause (1.00 vs 0.00), the three-phrasing cefazolin thread (1.00 vs 0.67), and forgetting (0 vs 151 resurfaced).
Disclosure
Synthetic ward, not a medical device
All 6 patients × 15 shifts are hand-authored synthetic fixtures. No real patients, no PHI. Lamplight is a research prototype and makes no clinical claims.
Disclosure
Deployment status, stated plainly
Alibaba Function Compute is scaffolded (infra/fc/s.yaml) with an honest status file in infra/fc/PROOF.md; the FastAPI app runs locally. The Next.js timeline UI is deferred — the engine and its bench are the submission's spine.
Questions a skeptic should ask
FAQ
Does it really run offline?
Yes — everything: tests, bench, demo, replay. The default transport is deterministic FakeQwen; no DASHSCOPE_API_KEY, no sockets. python scripts/verify_offline.py installs a hard socket guard (any network call raises), rebuilds the ward, byte-compares the hero brief, and verifies the signed op-chain.
How does it actually "forget"?
Three mechanisms, all auditable: decay classes with half-life math (strength(t)=s₀·2^(−Δt/λ)), immediate retirement when an item is explicitly resolved, and a nightly sweep that expires items below strength 0.05 via a signedexpire operation. Retired items are shown struck-through in the demo and can never be cited again — forgetting precision is 1.0 across 78 benched briefs.
What about PHI and privacy?
There is no PHI anywhere: the entire ward is hand-authored synthetic fixture data. Architecturally, episode plaintext is ECIES-sealed at rest (PyNaCl SealedBox): the store column is NULL, ciphertext lives in an envelopes table, and text is unsealed only at brief-build time. Lamplight is a research prototype, not a medical device.
Is the 0.99 vs 0.85 bench fair?
Both sides get the same embeddings and the same query; the naive top-k RAG baseline is the single-stage version of Lamplight's own retrieval. The bench also reports where the baseline ties at 1.00 — and the run is committed (bench_results/RESULTS.md) and regenerable with python memory_bench.py, with floors that fail the build on regression.
How do I run it?
Clone, then: python -m venv .venv && . .venv/bin/activate, pip install -e ".[dev]", pytest -q (458 passing, ~45 s), lamplight demo for the hero brief, lamplight replay for the byte-identical rebuild. Full judge path in DEMO.md.
Is it only for nursing?
No. The clinical ward is the benchmark; the engine is a domain-agnostic shift-handover memory. examples/support_handover.py rebuilds it as an on-call support handover in ~15 lines — swap patients for queues, nothing else changes.
Give your agent a memory with mortality attached.
One clone, zero keys, and the skeptic's command — verify_offline.py — proves every number on this page with the network off.