PrologTools

class PrologTools(prologResult: PrologProjectionResult, prologSchema: PrologSchema, entityNames: Map<String, String> = emptyMap())

Prolog tools that can be invoked by an LLM to query a knowledge base.

Parameters

prologResult

Prolog facts from projection

prologSchema

Schema with predicate mappings and rules

entityNames

Mapping of entity IDs to human-readable names

Constructors

Link copied to clipboard
constructor(prologResult: PrologProjectionResult, prologSchema: PrologSchema, entityNames: Map<String, String> = emptyMap())

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun checkFact(query: String): String

Check if a specific fact is true.

Link copied to clipboard

List all known entities with their names. Use this to find the correct entity name to use in queries.

Link copied to clipboard

List available predicates in the knowledge base.

Link copied to clipboard

Query the Prolog knowledge base. Returns all matching results with variable bindings.

Link copied to clipboard

Show sample facts from the knowledge base. Helps understand the structure and available data.