VSKI Deleting the Sidecars: Light Graphs and Plugins
Assets & Materials
| VSKI platform (client portal: docs, binaries, wiki) | https://vski.sh/x/platform |
| The Calendar Timetree recipe, modeled end to end | https://vski.sh/x/platform/wiki/Graphs-Timetree |
Every self-hosted system grows the same two appendages. First the graph database beside the app database, because relationships are awkward in SQL. Then the automation zoo around both: an embeddings indexer under cron, a hand-rolled sync daemon, an HTTP trigger pointed at localhost. Neither appendage is in the deployment diagram anyone drew on day one, and both end up on-call’s problem.
New VSKI release deletes them. Light graphs moved the graph workload into the platform itself, and the plugin system did the same for the zoo. The same that retired the Lab.
The graph database you were not using
The audit that led to light graphs was almost embarrassing. Across tenants running Neo4j beside VSKI, 99% of the graph workloads - agent graphs, knowledge linking, dependency walking - never touched Cypher’s advanced reaches, never ran clustering or multi-hop pattern matching at scale, and never exceeded 100k edges. What they did pay for was the full sidecar: another deployment unit, another backup and replication story, a second source of truth to keep consistent with the records that actually mattered.
A light graph is now a first-class entity beside collections: a
registry entry in the tenant database and an in-memory topology
index - ids and edge labels interned to uint32 slots, adjacency lists
for traversal. A fully warm 100k-node / 100k-edge graph occupies about
25 MB and a worst-case BFS runs in single-digit milliseconds.
The API is the traversal set people actually use: neighbors, traverse, shortest path (hops or edge-weight cost), subgraph around seed nodes, stats. Deliberately absent: a graph query language. The day a tenant needs Cypher, they still know where to find Neo4j.
Time was the missing primitive
v0.10 shipped the storage; the first heavy users supplied the roadmap, and they all converged on the same ask: index events by time. “What did this person do last week.” “What changed on this date.” “How many hours accumulated on this edge.” The data model already fit - nodes and edges carry labels, weights, and free-form JSON properties - but the ingest and query primitives were missing. v0.13 closes the gap with nothing new to operate: no new tables, no migrations, one lazily backfilled index.
Ingest became idempotent. Indexing pipelines re-run, so
POST .../nodes?upsert=true replaces an existing id wholesale instead
of erroring - the graph equivalent of MERGE - and the whole batch is
one transaction: on failure nothing persists.
Counters became atomic. Edge PATCH accepts weightDelta: the server
reads the current weight under the graph’s write lock and adds to it,
so concurrent increments cannot lose updates. The classic
hours-accumulated / stock-consumed pattern is now one call, and stats
reports per-label edgeWeightSums computed in SQL, where a NULL weight
is distinguishable from zero.
Properties became queryable. The JSON properties maps are no
longer opaque: list endpoints accept repeatable filters like
prop=ref.collection=users, prop=capacity>=5, prop=status!=draft,
prop=title~meeting, compiled to SQLite json_extract comparisons.
This also answers the “we only have one weight field” worry - capacity,
stock, and every other dimension live in properties as first-class
query targets, no schema change required. Node labels are now interned
in the memory index too, so neighbors?nodeLabels=document restricts
traversal by node type, and source/target accept comma lists, so
“everything touching last week’s day nodes” is one request.
The modeling pattern that all of this serves is the timetree - time itself as backbone nodes, activity as edges hanging off them:
Deterministic ids (<record>:on_day:<day>) make re-ingest a no-op;
deleting a record cascades its edges while the calendar backbone stays.
The payoff query, in the Python SDK (vski-sdk 0.6.0):
cal = client.graph("calendar")
week = client.plugins.invoke("calendar-index", "week_of",
{"date": "2026-10-22"})
# {"week": "week:2026-W43", "days": ["day:2026-10-19", ...], ...}
edges = cal.get_edges(target=week["days"], label="on_day",
prop=["ref.collection=documents"]) # what happened
hours = cal.stats()["edgeWeightSums"]["on_day"] # how much of it
And accumulating an hour of work is cal.update_edge(edge_id, weight_delta=1.0). The server stays calendar-agnostic - sprints and
fiscal quarters are just more backbone nodes with the same shape.
The other sidecar genus
The zoo around the server got the same treatment in v0.12. Plugins are Python processes supervised by the server itself: spawned from a directory beside the data, controlled over stdin/stdout protocol frames, health-pinged every ten seconds, restarted with backoff when they crash. A warm function invocation is a pipe write - no socket, no cold start. Events arrive through the existing realtime gateway using durable consumer groups, so events that fired while a plugin was down are redelivered when it returns.
The design stance is the shadcn stance, and it is the same one that decided the Lab’s fate - we tested it here first:
- Plugins are source, not packages. You copy one into your distribution, verify its pinned dependencies, and build one image. The server never installs anything; official images ship no Python at all.
- An instance is data. Plugin plus database plus JSON config: a config change is a PATCH that restarts exactly one process, never the server, never the container.
- Not a sandbox. Code arrives via the filesystem only - no upload endpoint - and each process start mints a fresh service API key that walks the same collection and graph access rules as anyone else. Permission checks are not bypassed for convenience; they are the contract the plugin author documents.
The handler surface stays small:
from vski.plugin import Plugin
app = Plugin()
@app.on_event("documents") # realtime consumer group, at-least-once
async def on_document(ctx, event): ...
@app.function("reindex") # POST /invoke, or plugin:// triggers
async def reindex(ctx, params): ...
@app.cron("*/5 * * * *")
async def sweep(ctx): ...
The two features compose, and the composition is the point: the
calendar-index example plugin subscribes to a collection and a date
field and maintains the timetree on every create, update, and delete -
backbone included, backfill and week_of included - in about a
hundred lines you copy in and own. Four example plugins ship
(hello, note-bot, embeddings-indexer, graph-sync), and plugins
are still experimental and disabled by default
(PLUGINS_ENABLED=true to switch on).
One stance, three times
Retire the Lab, absorb the graph database, absorb the daemon zoo: the same move each time, and it has a shape. Audit what the deployments in front of you actually do, not what the category promises. Ship the 99% into the binary under the rules and the caps the platform already enforces. Refuse the rest loudly, so nobody wakes up married to infrastructure they never needed.
What survives every one of these moves is the operating story: one binary, one SQLite file per database, bounded memory, and a permission model that everything - including the processes the server itself supervises - has to walk through. The deployment diagram is down to the binary, the data, and code you own. That was the goal.
Sources
- GraphAware, neo4j-timetree (the time-as-backbone-nodes pattern this feature set descends from; retired 2021, the pattern remains): https://github.com/graphaware/neo4j-timetree
- FT Product Technology, “Adventures with Neo4j and Timetrees” (a production timetree, its costs and payoffs): https://medium.com/ft-product-technology/adventures-with-neo4j-and-timetrees-5413f97f8a82
- shadcn/ui documentation (copy the component, own the code - the distribution model plugins follow): https://ui.shadcn.com/docs