GraphQuery

org.llm4s.knowledgegraph.query.GraphQuery
See theGraphQuery companion object
sealed trait GraphQuery

Algebraic data type representing structured graph query operations.

The LLM translates natural language questions into one of these query types, which are then executed against a org.llm4s.knowledgegraph.storage.GraphStore.

This approach is engine-agnostic — the same query ADT works with in-memory stores, JSON-backed stores, or future external graph database implementations.

Attributes

Example
// Find all Person nodes
val findPeople = GraphQuery.FindNodes(label = Some("Person"))
// Find neighbors of a specific node
val neighbors = GraphQuery.FindNeighbors(nodeId = "alice", maxDepth = 2)
// Find path between two nodes
val path = GraphQuery.FindPath(fromNodeId = "alice", toNodeId = "bob")
// Compose multiple queries
val composite = GraphQuery.CompositeQuery(Seq(findPeople, neighbors))
Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
In this article