| Crates.io | exo-hypergraph |
| lib.rs | exo-hypergraph |
| version | 0.1.0 |
| created_at | 2025-12-02 04:05:37.216578+00 |
| updated_at | 2025-12-02 04:05:37.216578+00 |
| description | Hypergraph substrate for higher-order relational reasoning with persistent homology and sheaf theory |
| homepage | https://ruv.io |
| repository | https://github.com/ruvnet/ruvector |
| max_upload_size | |
| id | 1961117 |
| size | 109,596 |
Hypergraph substrate for higher-order relational reasoning in the EXO-AI cognitive substrate.
This crate implements the hypergraph layer as described in the EXO-AI architecture:
HypergraphSubstrate
├── HyperedgeIndex # Efficient indexing for hyperedge queries
├── SimplicialComplex # TDA structures and Betti numbers
└── SheafStructure # Sheaf-theoretic consistency checking
use exo_hypergraph::{HypergraphSubstrate, HypergraphConfig};
use exo_core::{EntityId, Relation, RelationType};
// Create hypergraph
let config = HypergraphConfig::default();
let mut hypergraph = HypergraphSubstrate::new(config);
// Add entities
let e1 = EntityId::new();
let e2 = EntityId::new();
let e3 = EntityId::new();
hypergraph.add_entity(e1, serde_json::json!({"name": "Alice"}));
hypergraph.add_entity(e2, serde_json::json!({"name": "Bob"}));
hypergraph.add_entity(e3, serde_json::json!({"name": "Charlie"}));
// Create 3-way hyperedge (beyond pairwise!)
let relation = Relation {
relation_type: RelationType::new("collaboration"),
properties: serde_json::json!({"project": "EXO-AI"}),
};
let hyperedge_id = hypergraph.create_hyperedge(
&[e1, e2, e3],
&relation
).unwrap();
// Query topology
let betti = hypergraph.betti_numbers(2); // Get Betti numbers β₀, β₁, β₂
println!("Topological structure: {:?}", betti);
Betti numbers are topological invariants that describe the structure:
let betti = hypergraph.betti_numbers(2);
// β₀ = connected components
// β₁ = loops (currently returns 0 - stub)
// β₂ = voids (currently returns 0 - stub)
The persistent homology interface is implemented, with full algorithm to be added:
use exo_core::TopologicalQuery;
let query = TopologicalQuery::PersistentHomology {
dimension: 1,
epsilon_range: (0.0, 1.0),
};
let result = hypergraph.query(&query).unwrap();
// Returns persistence diagram (currently empty - stub)
✅ Complete:
🚧 Stub Interfaces (Complex algorithms, interfaces ready):
exo-core: Core types and traitspetgraph: Graph algorithmsdashmap: Concurrent hash mapsserde: SerializationMIT OR Apache-2.0