Expand description
Knowledge graph implementation for per-role semantic search.
Each RoleGraph is a directed graph of Nodes (concepts) and Edges
(co-occurrence relationships) built from indexed documents. An Aho-Corasick
automaton provides O(n) concept detection over document text.
§Architecture
Thesaurus (JSON)
|
v
TriggerIndex (Aho-Corasick patterns)
|
v
RoleGraph (nodes + edges + document map)
|
v
Ranked search results§Key Types
RoleGraph– the main graph structure; useRoleGraph::newfor async initTriggerIndex– compiled Aho-Corasick automaton over thesaurus terms
Modules§
Structs§
- Graph
Stats - Statistics about the graph structure for debugging
- Role
Graph - A
RoleGraphis a graph of concepts and their relationships. - Role
Graph Sync - Wraps the
RoleGraphfor ingesting documents and isSendandSync - Serializable
Role Graph - A serializable representation of RoleGraph for JSON serialization/deserialization.
- Trigger
Index - Simple TF-IDF index over trigger descriptions for semantic fallback search. Used when Aho-Corasick finds no exact synonym matches.
Enums§
- Error
- Errors produced by the role-graph knowledge graph operations.
Constants§
- DEFAULT_
TRIGGER_ THRESHOLD - Default threshold for TriggerIndex relevance filtering.
Functions§
- magic_
pair - Magic pair - Cantor pairing function for edge IDs
- magic_
unpair - Magic unpair - inverse of Cantor pairing
- split_
paragraphs - Splits a block of text into individual sentences and clause fragments.