How NeuralForge uses GPU-accelerated graph algorithms via RAPIDS cuGraph to discover structure in your knowledge base.
NeuralForge maintains a directed knowledge graph where:
- Nodes represent experts, concepts, techniques, tools, datasets, models, papers, and institutions
- Edges represent relationships (18 types) with temporal validity, confidence scores, and provenance
Graph algorithms run on the GPU via cuGraph when available, with automatic networkx fallback for CPU-only environments.
PageRank scores every node by its structural importance in the graph. A node is important if it is connected to other important nodes.
PageRank is combined with topic-specific edge counting to produce authority rankings:
authority_score = pagerank(expert) * count(topic_edges(expert))
This means an expert with high PageRank AND many edges related to a specific topic ranks highest for that topic.
# Topic-specific authority ranking
curl "http://localhost:8090/api/v1/graph/authority?topic=quantization&limit=10"
# Global PageRank scores
curl "http://localhost:8090/api/v1/graph/pagerank"Expert Authority Rankings: "quantization"
Rank Expert Score Edges
---- ------ ----- -----
1 Tim Dettmers 0.042318 12
2 Elias Frantar 0.031205 8
3 Song Han 0.028901 7
# cuGraph path (GPU)
result = cugraph.pagerank(graph)
# networkx path (CPU fallback)
scores = nx.pagerank(graph, personalization=weights)The Louvain algorithm partitions the graph into communities by maximizing modularity -- groups of nodes that are more densely connected to each other than to the rest of the graph.
Discovers natural expert clusters:
- Researchers who cite each other
- Authors covering the same domain
- Institutions with shared methodologies
curl "http://localhost:8090/api/v1/graph/communities"Detected 4 communities (23 nodes total):
Community 0 (8 members):
- Geoffrey Hinton
- Yann LeCun
- Yoshua Bengio
- Ilya Sutskever
Community 1 (6 members):
- Tim Dettmers
- Elias Frantar
- Song Han
Community 2 (5 members):
- Andrej Karpathy
- Grant Sanderson
- Jeremy Howard
# cuGraph path (GPU)
partitions, modularity = cugraph.louvain(graph)
# networkx path (CPU fallback)
communities = nx.community.louvain_communities(graph.to_undirected(), seed=42)Breadth-first search walks the graph from a starting node, visiting all reachable nodes up to a specified depth.
When building context for a query, BFS traversal from matching expert/concept nodes gathers related knowledge:
"Show me everything connected to LoRA within 2 hops"
Traversals can be filtered by:
- Edge types -- only follow specific relationship types
- Temporal window -- only traverse edges valid at a given date
curl "http://localhost:8090/api/v1/graph/traverse?node_id=abc123&depth=2&edge_types=agrees_with,contradicts"result = engine.traverse(
node_id="abc123",
depth=2,
edge_types=[EdgeType.agrees_with, EdgeType.contradicts],
as_of="2025-01-01",
)
# result.nodes -- visited nodes
# result.edges -- traversed edges
# result.depth -- max depth reachedFinds the shortest directed path between two nodes in the graph.
"How is Expert A connected to Concept B?" -- traces the chain of relationships.
curl "http://localhost:8090/api/v1/graph/path?source=node_a&target=node_b"path = engine.shortest_path(source_id, target_id)
# Returns list of node IDs from source to target, or empty if no pathScans the graph for conflicting edges -- places where one expert contradicts another, or where agreement and disagreement coexist between the same nodes.
- Find all
contradictsandincompatible_withedges - Find all
agrees_withedges - Pair them when they share a common node
- If no pairs found, report standalone contradiction edges
# All contradictions
curl "http://localhost:8090/api/v1/graph/contradictions"
# Topic-filtered
curl "http://localhost:8090/api/v1/graph/contradictions?topic=quantization"Found 2 contradictions on 'quantization':
1. Contradiction between contradicts and agrees_with
Edge A: Tim Dettmers --[contradicts]--> Song Han
Edge B: Elias Frantar --[agrees_with]--> Tim Dettmers
Confidence: 0.87
2. Explicit incompatible_with relationship
Edge A: Method A --[incompatible_with]--> Method B
Confidence: 0.92
Every edge in the NeuralForge graph has valid_from and valid_to timestamps. This enables time-travel queries:
# Rebuild the graph as it existed on a specific date
engine.get_graph_as_of("2024-06-01")
# Find edges created since a date
changes = engine.find_changes_since("2025-01-01", topic="LoRA")- Knowledge evolution -- "What was the consensus on quantization in 2023?"
- Change tracking -- "What new relationships were discovered this month?"
- Supersession -- when a new paper supersedes an old one, the old edge gets a
valid_to
Every 6 hours (configurable), the discovery worker:
- Selects pairs of experts with shared topics
- Retrieves relevant chunks from Qdrant for each expert
- Sends paired excerpts to NIM for relationship classification
- Creates graph edges for relationships above the confidence floor (default 0.6)
| Relationship | Graph Edge |
|---|---|
agrees |
agrees_with |
disagrees |
contradicts |
extends |
derived_from |
unrelated |
No edge created |
# In .env
DISCOVERY_INTERVAL_HOURS=6
DISCOVERY_PAIRS_PER_RUN=20
DISCOVERY_CONFIDENCE_FLOOR=0.6| Operation | 1K nodes | 10K nodes | 100K nodes |
|---|---|---|---|
| PageRank (cuGraph) | <1ms | ~5ms | ~50ms |
| PageRank (networkx) | ~10ms | ~500ms | ~30s |
| Louvain (cuGraph) | <1ms | ~10ms | ~100ms |
| Louvain (networkx) | ~50ms | ~2s | ~120s |
Approximate. Actual performance depends on graph density and GPU model.
The crossover point where cuGraph becomes faster than networkx is typically around 1,000-5,000 nodes. Below that, networkx overhead is negligible. NeuralForge uses cuGraph by default when available, regardless of graph size, for consistency.