Book 65 · Patriola’s Guide to Claude
Knowledge Graphs
A real, deployed temporal knowledge graph that runs on a single local SQLite file instead of a cloud graph database — entities, typed relationships, and an append-and-close update rule that never overwrites a fact, so a reader can ask what was true on a given date and get a real answer.
Two tables, standing in for a graph database
A knowledge graph sounds like it needs a graph database. This book covers a real, deployed one that doesn't. Its own source code frames the comparison directly: a well-known commercial temporal knowledge graph runs on a cloud graph database with a monthly fee attached; this one runs on a single local SQLite file, costs nothing, and gives up almost none of what the expensive version offers — entities, typed relationships between them, and a record of when each relationship was true rather than only whether it currently is.
That last part is the piece most systems skip. A relationship either exists or it doesn't, in most designs, and updating it means overwriting whatever was there before. This graph does something different: nothing gets overwritten, ever. A fact that stops being true gets closed rather than deleted, so a reader asking what this system believed on a given date in the past gets a real, honest answer instead of whatever the most recent update happened to leave behind. The book also names, honestly, where the design stops — nothing in the graph itself expires a fact automatically, and a method that appears to bootstrap the whole system from a known set of facts turns out to have no live caller anywhere in the codebase today.
What you’ll learnEight chapters, from the schema to an honest gap in production
- two-tables-not-a-graph-database — The schema itself: two relational tables joined the ordinary way, standing in for a graph database.
- entities-that-create-themselves — How an entity comes into existence, and a real asymmetry between two different ways of creating one.
- never-overwrite-always-close — The append-and-close update rule that makes the whole system temporally honest.
- asking-what-was-true-on-a-date — Time-bounded queries, a direct payoff of the append-and-close design rather than new machinery.
- deciding-where-a-fact-goes — The real, deployed rule that decides whether a fact belongs in this graph, a separate unstructured store, or neither.
- nothing-expires-on-its-own — An honest gap: nothing in this system expires a fact on its own, and three distinct mechanisms catch staleness instead.
- the-validated-tool-layer — The validated tool layer a live session actually calls, and the two different strictness levels its validation runs at.
- conclusion — The general pattern, and one piece of this codebase that looks finished in its own documentation but has never actually run.
A preview
Nothing gets overwritten, ever. A fact that stops being true gets closed rather than deleted, so a reader asking what this system believed on a given date in the past gets a real, honest answer instead of whatever the most recent update happened to leave behind.Who it’s for
Anyone building agent memory with Claude
This is for anyone building knowledge-graph or long-term memory systems with Claude who wants a real, working design that doesn't require a cloud graph database or a monthly fee — along with an honest account of the two places this particular implementation still falls short.
A longer excerpt is available to newsletter subscribers.
New books in this series
One short email per book launch.