# KGraphLang

KgraphLang is a knowledge graph query language designed for LLMs.

The repo is: <https://github.com/vital-ai/kgraphlang>

Further documentation: <https://vital-ai.gitbook.io/kgraphlang>

KGraphLang can be used with Ensemble Reasoning to enable reasoning to generate knowledge graph queries and process results during inference.

The kgraphlang query can be used with KGraphService to process the query, or another implementation can be used. For KGraphService, the predicates available are mapped to KGraphService queries, which may include local caching to improve performance.

The implementation of a predicate may handle tabling or caching of data internally, or a query re-writing / optimization process may replace a predicate or set of predicates with an optimized replacement via processing the query parse AST.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vital.ai/knowledge-graph/kgraphlang.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
