r/devops7 • u/Alternative_Pin9598 • 20d ago
One script, one chore: the on-call handoff nobody reads at 9 a.m. Write notes all night, get "where things stand + what changed" in one command (real output)
The night shift leaves 40 lines in the incident channel. The morning person skims, sees "suspect deploy 4182", and rolls it back again. Nobody wrote down that the rollback was tried at 02:05 and didn't help, or they did, but it's line 23.
The chore: make every handoff note a fact with a name (status, suspect, tried, next_step), so the next person gets the latest value of each one plus what changed overnight, instead of scrolling.
(Disclosure: this sub is run by the SynapCores team, and the memory step below is a SynapCores feature. Run this morning on 2.3.2, real output.)
Setup, once
CREATE MEMORY handoff IDENTITY service WITH (llm_extraction = false);A MEMORY keeps facts per identity (here: per service). When a new note sets an attribute that already has a value, the new value becomes current and the old one becomes history.
The script: handoff.py (28 lines, stdlib only)
The two commands that matter:
# note: one fact per line
sql(f"""REMEMBER handoff FOR service = {quote(svc)} {quote(text)}
WITH (source_type = 'verified_user_statement', attribute = {quote(attr)}, value = {quote(value)})""")
# brief: current value of every fact, what changed, and the notes closest to your question
d = sql(f"RECALL handoff FOR service = {quote(svc)} ABOUT {quote(ask or 'current state')}")["data"]
for attr, s in d["current_state"].items():
print(f" {attr:<10} {s['value']}")
for t in d["temporal"]:
print(f" changed: {t['attribute']} {t['previous_value']} -> {t['current_value']}")(Full file in the first comment.)
The night shift, as it happened
python3 handoff.py note payments-api status investigating "01:10 p99 latency on payments-api jumped to 2.4s, right after deploy 4182"
python3 handoff.py note payments-api suspect deploy-4182 "Suspect deploy 4182, it added retry logic around the card provider"
python3 handoff.py note payments-api tried rollback "02:05 rolled back 4182. p99 still 2.1s, so it is not the deploy"
python3 handoff.py note payments-api suspect db-pool "payments-db connections at 198/200, pool exhausted"
python3 handoff.py note payments-api status mitigated "03:40 raised the pool to 300, p99 back to 180ms. Not root-caused"
python3 handoff.py note payments-api next_step "check the nightly reconciliation job" "Next: find what holds the connections, start with the nightly reconciliation job"9 a.m., the morning person runs one command
$ python3 handoff.py brief payments-api
== payments-api: where things stand
next_step check the nightly reconciliation job
status mitigated
suspect db-pool
tried rollback
changed: status investigating -> mitigated
changed: suspect deploy-4182 -> db-poolThe deploy theory is still in the history, but it's marked as replaced: suspect deploy-4182 -> db-pool. Nobody rolls back twice.
And when they have a specific question
$ python3 handoff.py brief payments-api "did anyone already try a rollback"
...
== closest notes to: did anyone already try a rollback
0.26 02:05 rolled back 4182. p99 still 2.1s, so it is not the deploy
0.24 Suspect deploy 4182, it added retry logic around the card providerThe question shares almost no words with the note ("try a rollback" vs "rolled back 4182"), and it still comes back first, because RECALL matches the original notes by meaning.
Wire it up: a Slack slash command that calls handoff.py note ..., and the on-call bot posts handoff.py brief <service> into the channel at shift change. One memory serves every service; FOR service = 'checkout-web' keeps its facts separate.
Free Community Edition: https://synapcores.com/download?utm_source=reddit&utm_medium=owned&utm_campaign=devops7-oncall-handoff
What's the one thing you wish the previous on-call had written down?
1
u/Alternative_Pin9598 20d ago
New to MEMORY? SQLv2 Lesson 4 walks through
REMEMBER,CURRENTandRECALLfrom zero, with a customer who moves cities (and why plain similarity search still ranks the old address first): https://www.reddit.com/r/SQLv2/comments/1xnqkkm/Full
handoff.py(stdlib only). Run it withSYNAPCORES_URLandSYNAPCORES_TOKEN(fromPOST /v1/auth/login), after the one-lineCREATE MEMORYabove:The six
notecommands from the post are a plain shell script, so you can replay the night shift and get the same brief.