org.llm4s.knowledgegraph.query
Members list
Type members
Classlikes
A citation tracking which graph element contributed to the answer.
A citation tracking which graph element contributed to the answer.
Value parameters
- nodeId
-
The ID of the contributing node
- nodeLabel
-
The label of the contributing node
- property
-
The specific property that was cited
- relationship
-
Optional relationship that connected this information
- value
-
The cited value
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Configuration for the graph-guided question answering pipeline.
Configuration for the graph-guided question answering pipeline.
Value parameters
- includeCitations
-
Whether to track and return source citations
- maxContextEdges
-
Maximum number of edges to include in LLM context
- maxContextNodes
-
Maximum number of nodes to include in LLM context
- maxHops
-
Maximum number of hops for graph traversal during context gathering
- rankingAlgorithm
-
Which ranking algorithm to use (when useRanking is true)
- temperature
-
LLM temperature for answer generation (lower = more deterministic)
- useRanking
-
Whether to use graph ranking algorithms to prioritize entities
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Graph-guided question answering pipeline.
Graph-guided question answering pipeline.
Uses graph structure to provide rich context for LLM answers. The pipeline follows the pattern: identify entities -> traverse for context -> rank entities -> generate answer.
Multi-hop traversal follows relationship chains to gather evidence beyond direct neighbors. Citations track which nodes and edges contributed to the answer.
Value parameters
- config
-
Pipeline configuration
- graphStore
-
The graph store containing the knowledge graph
- llmClient
-
The LLM client for entity identification and answer generation
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Result of graph-guided question answering.
Result of graph-guided question answering.
Value parameters
- answer
-
The generated answer text
- citations
-
Sources that contributed to the answer
- entities
-
Key entities identified in the question and used for context
- queryResult
-
The raw graph query result used for context
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Algebraic data type representing structured graph query operations.
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
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Attributes
- Companion
- trait
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
GraphQuery.type
Executes GraphQuery operations against a GraphStore.
Executes GraphQuery operations against a GraphStore.
This component bridges the structured query ADT with the engine-agnostic storage layer, translating each query variant into the appropriate GraphStore and GraphEngine calls.
Value parameters
- graphStore
-
The graph store to query against
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Result of executing a graph query.
Result of executing a graph query.
Value parameters
- edges
-
The edges returned by the query (relationships between result nodes)
- nodes
-
The nodes returned by the query
- paths
-
Ordered paths found (for path queries)
- summary
-
A human-readable summary of the result
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
GraphQueryResult.type
Translates natural language questions into structured GraphQuery operations using an LLM.
Translates natural language questions into structured GraphQuery operations using an LLM.
The translator provides the LLM with a summary of the graph's schema (node labels, relationship types, sample properties) so it can generate appropriate query operations.
Value parameters
- graphStore
-
The graph store whose schema is used as context
- llmClient
-
The LLM client to use for translation
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Graph ranking algorithms for entity importance scoring.
Graph ranking algorithms for entity importance scoring.
Provides PageRank, betweenness centrality, closeness centrality, and degree centrality implementations that operate on the immutable Graph data structure.
These scores are used by GraphQAPipeline to prioritize which entities to include in LLM context when the result set exceeds context limits.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
GraphRanking.type
An entity identified from the user's question and matched to a graph node.
An entity identified from the user's question and matched to a graph node.
Value parameters
- confidence
-
Matching confidence score (0.0 to 1.0)
- mention
-
The text mention from the question
- nodeId
-
The matched node ID in the graph
- nodeLabel
-
The label of the matched node
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
A generated native query string for a specific graph query language.
A generated native query string for a specific graph query language.
Value parameters
- explanation
-
Optional human-readable explanation of what the query does
- language
-
The target query language
- queryString
-
The generated query string
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Generates native graph query strings (Cypher, Gremlin, SPARQL) from natural language or structured GraphQuery operations using an LLM.
Generates native graph query strings (Cypher, Gremlin, SPARQL) from natural language or structured GraphQuery operations using an LLM.
This is an extension point for graph databases that support native query languages. The primary query path uses GraphQueryExecutor against the GraphStore trait; this generator provides an alternative for engines where native queries are more efficient.
Value parameters
- llmClient
-
The LLM client to use for query generation
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- trait
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
QueryLanguage.type
Available graph ranking algorithms for entity prioritization.
Available graph ranking algorithms for entity prioritization.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Attributes
- Companion
- trait
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
RankingAlgorithm.type