A new knowledge graph system called BaryGraph treats every relationship as a first-class embedded document called a BaryEdge, rather than an edge between nodes. It also introduces recursive MetaBary triads to discover structural bridges between distant concepts. This approach addresses a key limitation of flat vector search, which treats relationships as mere proximity between points, missing cross-domain connections. By embedding relationships themselves, BaryGraph can surface analogies and bridges that standard RAG systems cannot detect. The system uses nomic-embed-text for embeddings, runs on MongoDB Community with mongot, and processes the entire English Wiktionary (6.6M documents) locally. It is available as an open-source project with a live MCP server for probing.
Background
Knowledge graphs represent entities as nodes and relationships as edges, but traditional vector search only compares entity embeddings, ignoring relational structure. Retrieval-Augmented Generation (RAG) systems often rely on flat similarity search, which cannot capture indirect connections. BaryGraph embeds relationships as separate documents to encode relational semantics directly.