org.llm4s.knowledgegraph.tool

Members list

Type members

Classlikes

Agent tool integration for graph-guided question answering.

Agent tool integration for graph-guided question answering.

Wraps GraphQAPipeline as a ToolFunction that an Agent can call to query a knowledge graph using natural language. The tool accepts a question and optional configuration, executes the full QA pipeline, and returns the answer with citations.

Attributes

Example
import org.llm4s.knowledgegraph.tool.GraphQueryTool
import org.llm4s.toolapi.ToolRegistry
for {
 tool <- GraphQueryTool.toolSafe(llmClient, graphStore)
 tools = new ToolRegistry(Seq(tool))
 state <- agent.run("Who does Alice work with?", tools)
} yield state
Supertypes
class Object
trait Matchable
class Any
Self type
case class GraphQueryToolResult(answer: String, citations: Seq[String], entityCount: Int)

Result returned by the graph query tool to the agent.

Result returned by the graph query tool to the agent.

Value parameters

answer

The generated answer

citations

Sources that contributed to the answer

entityCount

Number of entities used for context

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type