| title | Intelligent Pathfinding Guide |
|---|---|
| description | Semantic pathfinding finds paths that are not just shortest, but most relevant to your query and graph semantics. |
| type | guide |
| status | stable |
Semantic pathfinding finds paths that are not just shortest, but most relevant to your query and graph semantics.
Finds shortest path weighted by:
- Edge weights
- Node type compatibility
- Query relevance
POST /api/pathfinding/semantic-path
Content-Type: application/json
{
"startId": 123,
"endId": 456,
"query": "machine learning projects"
}Response:
{
"path": [123, 234, 345, 456],
"cost": 3.2,
"relevance": 0.87,
"explanation": "Found path with 3 hops"
}Explores graph prioritizing nodes matching your query:
POST /api/pathfinding/query-traversal
Content-Type: application/json
{
"startId": 123,
"query": "artificial intelligence",
"maxNodes": 50
}Returns most relevant nodes, sorted by query match.
Explores local neighborhood without query context:
POST /api/pathfinding/chunk-traversal
Content-Type: application/json
{
"startId": 123,
"maxNodes": 50
}Finds similar nodes based on:
- Node type similarity
- Local structure
- Attribute similarity
{
"maxLength": 10,
"maxExplored": 1000,
"edgeWeightFactor": 0.4,
"semanticWeightFactor": 0.4,
"typeWeightFactor": 0.2
}edgeWeightFactor: How much edge weights matter (0.0-1.0)semanticWeightFactor: How much query relevance matterstypeWeightFactor: How much type compatibility matters
Find research papers related to query:
query: "neural networks"
→ Traverses to ML papers, AI researchers, related projects
Find critical dependencies:
query: "authentication security"
→ Paths weighted by security relevance
Explore related concepts:
query: "quantum computing"
→ Discovers related papers, researchers, applications
- Semantic Path: O(V log V) with semantic weighting
- Query Traversal: O(V + E) with relevance pruning
- Chunk Traversal: O(k * degree) for k nodes
Typical performance:
- 10K nodes: <100ms
- 100K nodes: <1s
- 1M nodes: <5s (with limits)
- Set appropriate limits: maxLength and maxExplored prevent long searches
- Use query context: More specific queries = better results
- Choose right algorithm:
- Semantic Path: When you know start and end
- Query Traversal: When exploring by topic
- Chunk Traversal: When exploring local structure
- Combine with filters: Use schema to filter node types first
- Cache results: Common paths can be cached
See API documentation for complete examples and frontend integration.