Introduction to Hypergraphs: n-Body Relations in AI Episodic Memory

Standard graphs are composed of vertices linked by binary edges. A binary edge connects exactly two nodes. But real-world episodes are complex: a single meeting might involve a developer, a product owner, a specific bug ID, and a target branch.

To represent these n-body relations, Spector integrates a HyperEntityGraph (Hypergraph) structure.


The Hypergraph Advantage

A hypergraph contains hyperedges that can connect any number of nodes simultaneously.

Standard Graph: (Developer <-> Bug), (Developer <-> Branch), (Branch <-> Bug)
Hypergraph Edge: { Developer, Bug, Branch, Session_ID }

Retrieval Intersections

When the agent queries memory about a bug, Spector intersects the hyperedges:

Query: "Bug 42" -> find hyperedge -> retrieve entire meeting context: {Developer, Branch, Target}.

This preserves contextual relationships with 100% fidelity, preventing the agent from mixing up who worked on which branch.