🔬

Rick — Live state

State engine
"What is it right now? Ask me."

What Rick does

Rick answers one question quickly: what is the latest value of this thing? Devices, services and agents publish updates on the Kevin bus. Rick keeps a last-value cache and a history cache for each subject. You can ask it a question and get an answer (query and response), or subscribe and have changes pushed to you (publish and subscribe).

That is what lets a dashboard open and show current state immediately, instead of waiting for the next update to arrive.

How it works

Listens on MQTT

Updates published by devices and services are ingested as they arrive and stored as the subject's latest value.

Query or subscribe

Read a value or recent history once over REST, or subscribe over WebSocket and get changes pushed to you.

Fast core

The hot path has a C++ implementation with a pure-Python fallback, so it still runs on machines without the compiled library.

Alerting

Alert rules watch incoming values and raise an alert when one crosses a limit.

History cache and persistence

History is kept in a local SQLite store. Last values can be persisted to SQLite too, so they survive a restart. That is off by default, and no database server is needed. You can correct a last value from Marco; history cannot be edited.

Observable

Rick reports its own update throughput and queue depth, so Marco's operations panel can show how busy it is.

Rick in the platform

Rick is a normal Kevin service. It publishes its version and a heartbeat on the bus like the rest, and it is optional: smaller installs run without it. Marco reads from it, and so can any service that needs current state.