On Hesse, Bach, Leibniz, and why the structure of wisdom is not a triple
There is a passage early in Hermann Hesse’s last novel where the narrator describes a player of the Glass Bead Game seated, in effect, at an organ — an instrument whose keys and pedals reach across the entire intellectual cosmos, whose stops are past counting, capable of sounding the whole content of human culture. The player does not compose. The player plays. Mathematics here, a Bach cantata there, a line of Chinese cosmology, a theorem, a fresco — struck in sequence and in counterpoint until the correspondences between them ring out like harmony.
I have spent the better part of a decade building, in databases and Rust crates and ontologies, a much clumsier version of exactly that organ. So I want to make a claim that is half literary and half engineering, and I mean both halves seriously: Hesse described a knowledge structure in 1943, before any of us had the vocabulary for it, and the structure he described is not a knowledge graph. It is a metagraph.
Let me earn that by walking through the music, the mathematics, and the failure — because the failure is the most important part.
Music was the mother tongue
It is easy to forget, reading summaries of The Glass Bead Game, that the whole edifice is built on music. Joseph Knecht does not enter Castalia as a logician. He is recruited as a boy by the old Music Master, and music is his first love and his lifelong door into everything else. The Game itself, throughout the book, is described again and again by analogy to music — and not just any music, but Bach: counterpoint, the fugue, theme and inversion, variation upon variation. One contemporary reader put it well — the Game is the art of making music with ideas, where a number, a text, a melody and an image each play the role a voice plays in a fugue, set against one another to sound their consonances and their dissonances.
This matters more than it looks. Because if you take the musical metaphor literally — and Hesse wants you to — then the atom of the Game is not a fact. It is a relation in motion. A fugue is not a set of notes; it is what the notes do to each other across time. A subject is stated, answered a fifth up, inverted, stretched, stacked against itself. The meaning lives in the intervals, the leading, the tension and its resolution.
Pythagoras already knew the scandal hiding here: that a plucked string and a whole number are the same fact wearing two costumes. Hesse’s deeper inspiration was even more combinatorial — he was openly enchanted by the I Ching, that Chinese oracle whose sixty-four hexagrams are nothing but the 2⁶ combinations of broken and unbroken lines. The cosmos as a lattice of recombinable strokes. Crucially, Hesse noted, the I Ching is not creative. It is selective. It does not invent; it draws relations out of an already-given space.
Hold that thought. It comes back to bite.
Leibniz’s ghost, and the dream of one language
The intuition under the Game is old and it has a name. Leibniz called it the characteristica universalis — a universal symbolic notation in which every concept could be written, and a calculus ratiocinator by which truths could be computed the way we compute sums. Behind it sat an even grander hope: a mathesis universalis, a single underlying mathematics of which the particular sciences are dialects. The Enlightenment encyclopedists reached for it. The structuralists hunted it across the whole twentieth century. The deepest claim of Hesse’s Game is the same claim, stated as art: that philosophy, music, mathematics and painting are regional accents of one language none of us has ever quite spoken aloud.
Now notice what that claim is, stripped of its romance. It says: there exists a shared structure beneath disciplines, made of entities and the relations between them, and meaning is the traversal of those relations. That is not a metaphor for the knowledge graph. That is the definition of one. Nodes for things, edges for how things stand to one another, and understanding as a walk across the edges.
People have noticed. There is an actual academic attempt — Joshua Fost’s “Toward the Glass Bead Game” — to build Hesse’s Game as Semantic Web: little images as beads, connecting tiles between them, and the arrangement bead–tile–bead read as subject–predicate–object. Every bead gets a URI; every bead phrase becomes a reified RDF triple. He built Castalia out of <subject> <predicate> <object>. And honestly, fair enough — it works as a first sketch. Lewis Lapham once remarked that Hesse’s Game lends itself almost too obviously to the transcendental aspirations of the internet, and the web of hyperlinks, the web of synapses, and the web of Castalian correspondences do all rhyme.
But this is exactly where I get off the bus. Because the triple is where the Game goes flat and dies.
Where the triple breaks
Try to encode an actual Game move as triples. The move is something like: take the subject of a Bach fugue, set it against a particular theorem from number theory, observe that the inversion of the theme mirrors a symmetry in the proof, and let the unresolved tension between them echo a line of Cusanus on the coincidence of opposites.
You can flail at this with triples. Bach_fugue relatedTo Theorem_X. Theme hasInversion Inversion_1. Inversion_1 mirrors Symmetry_2. And already it is gone. You have lost that the mirroring is the move — not a fact about two objects, but a structured relation that has its own internal parts, its own tension, its own time. You have lost that this entire synthesis is meant to become a single bead that a later move can pick up and set against something else. A fugue subject is itself made of intervals; a Game move is itself made of relations; and the move has to be quotable as a unit in the next move.
This is the wound I keep returning to in my own work on agent memory. You model a meeting as a clutch of triples and you instantly lose that five people were in the room, that a decision was made, that the decision caused three downstream actions, and that the whole episode can later be referred to as one thing — “the meeting where we changed direction.” So you reify. You invent auxiliary nodes. You bolt on blank nodes and statement-about-statement scaffolding until your beautiful graph is a thicket a machine can crawl and no human can read. The triple cannot hold a relation as a first-class citizen. And a Game move is a relation you must be able to hold.
Enter the metagraph
The structure that does hold it has been sitting in the literature since Basu and Blanning, who defined the metagraph as a collection of directed set-to-set mappings: edges run not from one node to one node but from a set of nodes to a set of nodes, and — this is the move that changes everything — an edge can itself be referenced as a node.
Walk the ladder. A plain graph has edges between two vertices: binary, flat. A hypergraph lets an edge embrace a whole set of vertices at once — good for “these five people were in the room” — but it has a fatal ceiling: you cannot point at a hyperedge and treat it as a node. You cannot say something about the relation. The metagraph removes the ceiling. Its metavertices contain entire subgraphs; its edges are themselves things you can name, nest, and feed back in. Relationships carry meaning and can become the subject of further reasoning. Recursion all the way down.
That recursion is the fugue. That recursion is the I Ching hexagram built of lines that are themselves readable. That recursion is the Game move that becomes a bead in the next move. Hesse’s organ, where any sounded synthesis can become a key you press in the following phrase — that is not a knowledge graph. It is, precisely and unavoidably, a metagraph.
And if you want the grammar of the edges, I’d reach for Mark Burgess’s Semantic Spacetime, which is the spine of most of what I build. Burgess argues that essentially all meaningful relations reduce to four types: similarity (this is near or like that), causation or sequence (this leads to that), containment (this is part of that), and property (this expresses that). Look back at the Game move. The fugue subject is similar to the theorem’s structure. Counterpoint unfolds as one voice leads to the next in time. A movement contains its themes. A gesture expresses serenity. Every correspondence a Castalian player draws is one of those four relations — and a metagraph whose edges are typed by those four relations, and whose edges can be promoted to nodes, is a Glass Bead Game you could actually play. I don’t think that’s an analogy. I think that’s a specification.
The deep weld: where art, math, and physics are literally the same object
Here is the part that would have delighted Hesse, because it makes his wildest claim rigorous rather than poetic.
There is a mathematician of music, Guerino Mazzola, who models musical gesture with serious mathematical machinery — topos theory, and a structure he calls the hypergesture: a gesture of gestures, a curve through a space of curves. In his framework, the move from a written score to a performed sound — from the symbolic mark on the page to the physical motion of the body that sounds it — is itself a hypergesture, and it can be described with the same Lagrangian formalism that physicists use for strings in string theory. Counterpoint, in this reading, is a hypergesture between two voices.
Sit with what that means. The relation between a symbol and the gesture that embodies it, in music, turns out to be describable by the mathematics that physics uses for the fabric of matter. Art, mathematics, and physics are not like each other here. They are, at the level of structure, the same object viewed from three doors. That is Hesse’s thesis — disciplines as dialects of one tongue — proven in a special case, in the medium he loved most.
And the shape of that proof is, once again, recursive: a gesture made of gestures, a relation about relations. Douglas Hofstadter spent Gödel, Escher, Bach circling the same strange loop — the Bach canon that modulates back to itself a key higher, the Gödel sentence that talks about its own provability, the Escher hands drawing each other. Self-reference as the engine of meaning. The metagraph’s defining trick — an edge that is also a node, a relation you can stand on — is the strange loop made into a data structure. Hesse intuited it in 1943 with glass beads. Burgess typed its edges. Mazzola welded it to physics. We finally have the database for it.
I find this genuinely thrilling, and I want to stop here, because if I stop here the essay is a lie.
The sterility, which is the whole point
Castalia produces nothing.
This is not a flaw I am importing; it is the engine of Hesse’s tragedy. In Castalia, original artistic creation is essentially forbidden. Originality is redefined as the detection of correspondences already latent in the inherited material — the I Ching again: selective, never creative. The Game preserves the memory of lessons already learned and is barred from adding to them. And so the most beautiful formal system ever imagined sits in a walled province, financed by a society it serves not at all, producing nothing useful, touching nothing.
Knecht’s Benedictine interlocutor, Father Jacobus, lands the blow. He tells the Glass Bead Game players that they have distilled a tidy world-history to their own taste, a history of ideas and art with no blood in it — no reality, no good and evil, no time. They treat the world the way a mathematician treats mathematics: only laws and formulas, no suffering, no stakes. And the unbearable irony of the book, written as Europe burned, is that the most exquisite synthesis of all human knowledge did precisely nothing to stop the bombs. Beauty, and insufficiency, in the same gesture.
So Joseph Knecht — Magister Ludi, the greatest player of his age — resigns. He walks out of Castalia to teach a single boy in the actual world, and dies almost immediately, drowned in a cold mountain lake. The supreme player abandons the supreme game because he has understood that pure knowledge with no one at stake in it is sterile.
Now look at what we are building. A writer named Jonathan Boymal put the knife in cleanly: what Castalia prized was the beauty of the connections between things — and that is exactly what large language models do, and exactly what I do when I build a knowledge graph. We are, all of us, playing the Glass Bead Game now, at planetary scale, with no Magister Ludi and the rules half-lost. We have built the organ. We can strike Bach against number theory across a billion documents in milliseconds. And the question Hesse pinned to the wall in 1943 is the question still pinned to the wall: is the synthesis wisdom, or is it only magnificent?
The metagraph gives us the structure of wisdom — context held, relations made first-class, syntheses that nest and compound. It does not give us wisdom. A perfect lattice of correspondences inside an agent’s memory, every fact linked to every fact by its proper typed edge, can still be a Castalia in a database: a sealed chamber where thought thinks about thought for an audience of no one, where nothing is at stake because nothing reaches the world. You can build a memory that connects everything and remembers nothing that matters.
Strike the keys. Then go down to the water.
Book
If this thread grabbed you, it’s the spine of my book Metagraph for AI Agents (Leanpub). The argument runs exactly along the fault line I hit above: if you want agents that reason the way people actually do, you can’t hand them a flat pile of triples — you need structures that hold context, hierarchy, time, and relations that are themselves things you can reason about. The book takes the long way there on purpose. It walks through ordinary graphs, then hypergraphs — genuinely powerful, but with one fatal ceiling: you can never point at a hyperedge and treat it as a node — and only then lets metagraphs enter, where edges connect sets to sets and any relationship can be promoted to a first-class citizen and fed back into the reasoning. Along the way it keeps coming back to the same homely failure case: model a meeting as triples and you instantly lose that five people were in the room, that a decision was made, and that the decision caused three downstream actions — so you reify, you flatten, and your knowledge graph rots into a tangle no human can read. The book is the way out of that tangle, and the structure it lands on is the one I argue here that Hesse was groping toward with glass beads.
Notes and threads, for anyone who wants to pull on them: Hesse, The Glass Bead Game / Magister Ludi (1943); Leibniz on the characteristica and mathesis universalis; Joshua Fost, “Toward the Glass Bead Game: A Rhetorical Invention” (the bead–tile–bead as RDF reading); Charles Cameron’s playable HipBone Games; Basu & Blanning on metagraphs; Mark Burgess on Semantic Spacetime and the four relation types; Guerino Mazzola on musical gesture, hypergesture, and the topos of music; Hofstadter, Gödel, Escher, Bach; and Jonathan Boymal’s “The Glass Bead Game Is Real Now” for the LLM parallel that started me writing this.
Originally published on Sovereign Agentic AI on Substack.