GraphQueryTranslator

org.llm4s.knowledgegraph.query.GraphQueryTranslator
class GraphQueryTranslator(llmClient: LLMClient, graphStore: GraphStore)

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

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def translate(question: String): Result[GraphQuery]

Translates a natural language question into a structured graph query.

Translates a natural language question into a structured graph query.

Value parameters

question

The natural language question

Attributes

Returns

Right(query) on success, Left(error) on failure