From Smart Bowl Signals to a Living Pet Graph

From Smart Bowl Signals to a Living Pet Graph

A smart bowl reading looks like this: 120 g served, 82 g eaten, 340 seconds, 7:14 a.m. It is perfectly precise and almost meaningless on its own. A vet note is the opposite: rich with meaning ("mild tartar, monitor appetite"), structured not at all.

To answer real questions about a pet, both kinds of data have to end up in the same knowledge graph, speaking the same language, with the same standard of proof. This post walks through how our ingestion pipeline does that — how a gram reading and a paragraph of clinical prose both become verified, source-linked graph facts. It's the most engineering-heavy stop in this series, and it's built around one principle: extract with evidence, never without.

The problem: three ways to build a bad graph

Building a graph is easy. Building one you can trust enough to advise a pet parent is not, and there are three classic ways to fail.

Dump telemetry in raw. If every bowl event becomes a disconnected blob of numbers, the graph knows that something happened but not what it means. Numbers need to attach to entities — this pet, this food, this time of day — before they're knowledge.

Let an LLM invent the structure. The tempting shortcut is to hand text to a large language model and ask for entities and relationships as JSON. We deliberately don't. Extraction quality then drifts with every prompt tweak and model upgrade, you can't cleanly verify the output against the source text, and hallucinated "facts" enter the graph wearing the same uniform as real ones.

Extract first, clean up later. Loose extraction plus a post-hoc cleanup crew sounds pragmatic, but the cleanup never catches up. Quality has to be enforced at the door.

The approach: one road, machine-extracted, verified at the door

Our pipeline commits to three decisions.

Everything becomes a chunk. The unit of ingestion is a passage of text with a source reference — a page of a vet note, a paragraph of a book, or a short narrative synthesized from device telemetry. One road in means one standard of evidence for everything that follows.

Numbers stay numbers — and also become sentences. Raw measurements land in time-series storage attached to graph entities, so "average breakfast intake over 30 days" stays a fast, exact query. In parallel, telemetry windows are rendered as small factual narratives that flow through the same extraction path as any document. The numeric layer keeps precision; the narrative layer creates the graph's semantics.

ML extracts; nothing enters unverified. Purpose-built extraction models — not free-form LLM generation — propose entities and relationships, and a verification model must confirm each one against the source passage before it's written.

The process: following one bowl event all the way in

Let's trail a single reading through the pipeline.

Step 1 — Telemetry becomes a narrative chunk. The bowl event above is written up as a small factual passage, linked to its device and timestamps:

"On the morning of 12 July, Max ate 82 g of the 120 g of Brand X kibble served, finishing in under six minutes — about 30% below his 30-day breakfast average."

The raw grams also land as numeric facts on the graph's time axis, so nothing is lost to rounding or phrasing.

Step 2 — Time is masked before extraction. Before any entity recognition runs, temporal phrases ("on the morning of 12 July", "six weeks ago") are masked out. Why? Because otherwise extraction models cheerfully turn "July 12" into an entity, and your graph fills with date-nodes. Instead, time attaches to the resulting relationships as structured attributes — how precise the timestamp is, the earliest and latest moment the fact could hold, whether it was phrased relatively. Anything knowable at extraction time is captured then, never reconstructed later.

Step 3 — Zero-shot entity recognition. A generalist NER model (the GLiNER family of zero-shot extractors) finds entities using labels drawn from the graph's own ontology — pet, food, ingredient, symptom, behavior, breed, medication, place. Zero-shot matters commercially: the same engine that reads dog-nutrition books today can read a new domain tomorrow without retraining. There is deliberately no hardcoded label list; if a graph has no ontology, extraction refuses to run rather than guessing.

Step 4 — Zero-shot relation extraction. A companion model (the GLiREL family) proposes typed relationships between the entities it found — atecontainsexhibitstreated with — again constrained to the ontology's vocabulary. Nominal events get special handling: phrases like "Bella's surgery" or "Max's grooming appointment" name events without ever using a verb, so a synthesis step materializes them as event entities that relationships can attach to.

Step 5 — The entailment gate. Here's the door policy. Every candidate fact is checked by a natural-language-inference model: does the source passage actually entail this triple? Every triple faces the gate — not just borderline ones — because a "borderline-only" gate is a bypass for confidently wrong extractions. Failures aren't deleted; they're quarantined with a reason, so we can audit what the extractors wanted to claim.

A concrete rejection: from "we switched Max to a chicken-free diet as a precaution", an extractor might propose Max —[allergic to]→ chicken. The passage doesn't say that. The NLI gate bounces it; the fact stays out of the graph until real evidence shows up.

Step 6 — Every write carries provenance. Nothing reaches the graph anonymously. Each entity and relationship records which chunk produced it, from which source, when, and by which pipeline actor. This is enforced at the persistence layer — a write without provenance context is refused, not warned about. Two things fall out for free: every answer the assistant gives can cite its sources (Part 4), and erasure works — delete a source's chunks and the facts they licensed lose that support and are re-evaluated, which matters when the data describes someone's household.

Step 7 — Grounding, one chunk at a time. After extraction, each chunk gets a grounding pass scoped to its footprint: entity resolution and graph hygiene. Entity resolution deserves a highlight — deciding whether "Bella", "Bella the beagle", and "the puppy" are one entity isn't done by name similarity alone. Candidate matches are cheap to generate, but the decision is made by a classifier that reads the actual passages where both mentions occur. Names lie; narratives usually don't. A chunk then transitions from extracted to grounded, and only grounded facts vote at full strength in retrieval.

The results: what a month of Max looks like

After a month, one dog's graph is a dense, layered thing. Around Max sit dozens of meal events with exact intake curves queryable as time series; edges to foods and their ingredients; symptom observations with time ranges; vet-note facts with clinical provenance; and breed-level knowledge from literature connected to his personal data — every edge datestamped, source-linked, and verified against the passage that produced it.

Two properties matter most in practice:

  • Numbers and meaning stay joined. "Show me appetite vs. heat over July" is a numeric query; "why might his appetite dip?" is a graph walk. Same substrate, one hop apart.
  • Trust is inspectable. Any fact can be traced to the exact bowl event, note, or page that produced it — and to every source that has since agreed or disagreed. How that agreement is scored is the subject of Part 3.

Key takeaways

  • One road into the graph: telemetry, vet notes, and books all become chunks that travel the same extraction path with the same standard of proof.
  • Telemetry is bilingual: raw numbers stay in time-series form for exact math, while synthesized narratives carry the semantics into the graph.
  • Never let a model invent structure: zero-shot extractors propose facts; an entailment check against the source text decides. Unverified facts are quarantined, not admitted.
  • Time is metadata, not an entity — masked before extraction, attached to relationships as structured attributes.
  • Provenance is mandatory at the persistence layer, which makes citations and per-source erasure natural instead of bolted on.

Next in the series → Part 3: Teaching the Graph to Weigh Its Evidence — what happens when three sources agree, two repeat themselves, and one disagrees.