In manufacturing, healthcare, even customer support, the only good enough answer is an accurate answer. An LLM can give you a fantastically looking answer, but is it the right one? Is the data right? Is the data timely? AI trust is built on data trust, and that’s why the hard work isn’t just in training the AI model, but building the knowledge behind it.
Most GenAI systems do not preserve feedback or adjust over time. Rather than training on more data, AI needs continuous human validation and contextual input to improve. This feedback can be captured in a knowledge model, enabling effective retrieval and correlation through Knowledge Graphs.
.png?sfvrsn=a0f1d969_2)
Here are the Progressive Graph flow steps:
1. The user / Agentic AI enters their question or task request
2. The LLM analyzes and extract key potential concepts or synonyms
In the Semaphore Knowledge Model Manager, we’ll create a Task. Tasks are used as part of workflow and data governance. They are used to control what is changed in the model and ensure the production model is not modified without approval. You can think of this task as a sandbox for changes. The model manager can accept, reject and adjust concepts throughout the process.
Once the task is created, we can click into the task and start to look at our model. Semaphore also has the capability to crowdsource changes in the model. The Knowledge Review Tool (KRT) will allow us to make modifications to concepts and introduce new concepts for our SMEs to review. 
Now that we have a KRT workflow, we can access it programmatically. We will introduce writing to this task via the Java SDK. You can leverage this Progressive Graph workflow in the LangChain4j middle tier we set up in our previous blog post.
We will first take in the user’s question and analyze it using a Large Language Model (LLM). We can leverage the helpers in LangChain4j to create a prompt and submit the request to the LLM.
public interface TermExtractAssistant {
@SystemMessage(
"Extract search keywords from the users question. " +
" The response should be in RFC compliance JSON format with property searchTerms" +
" values as array of terms." +
" Example: { 'searchTerms': [] }" +
" Do not include markdown code blocks in your response. " +
" Respond only with valid JSON. Do not write an introduction or summary." +
" QUERY: {query}"
)
Result<String> chat(String question);
} This prompt is used to extract the search terms from the user’s original question and generate a JSON representation of the terms. We will use this JSON to iterate over each term to generate new concepts. A small Java class will be created to marshal the JSON.
@Getter @Setter
public class AISearchTerms {
private List<String> searchTerms;
} Now, using the LangChain4j AiServices and ChatModels, we can submit the question to the LLM and extract the terms.
public AISearchTerms getQuestionConceptsByAI(String query) {
AISearchTerms searchTerms = null;
try {
TermExtractAssistant termExtractAssistant = AiServices.builder(TermExtractAssistant.class)
.chatLanguageModel(chatLanguageModel)
.build();
Result<String> result = termExtractAssistant.chat(query);
String resultText = result.content();
LOGGER.info("Query term extract: " + resultText);
searchTerms = this.objectMapper.readValue(resultText, AISearchTerms.class);
return searchTerms;
} catch (JsonProcessingException e) {
LOGGER.error("Unable to parse search terms from LLM. ", e);
}
return searchTerms;
}
We can now move onto taking these new concepts and writing them to the Semaphore Knowledge Review Tool Task.
Semaphore comes with a Java client to interact with the Knowledge Model Manager. This client has an Ontology Editor that can be leveraged for pragmatically communicating with the knowledge model. We will first create a connection using a small bit of code.
public OEClientReadWrite getProgressiveGraphClient() throws CloudException {
OEClientReadWrite oeClient = new OEClientReadWrite();
oeClient.setKRTClient(true);
oeClient.setBaseURL(this.semaphoreConfig.getOeURL());
oeClient.setModelUri(this.semaphoreConfig.getModelTaskUri());
if (this.semaphoreConfig.getTokenRequestURL() != null && this.semaphoreConfig.getKey() != null) {
TokenFetcher tokenFetcher = new TokenFetcher(this.semaphoreConfig.getTokenRequestURL(), this.semaphoreConfig.getKey());
Token token = tokenFetcher.getAccessToken();
oeClient.setCloudToken(token);
} else {
oeClient.setHeaderToken(this.semaphoreConfig.getLocalToken());
}
return oeClient;
} The code above creates a new client with connections to the Semaphore instance and the specific model task you are trying to interact with. If you are using Semaphore in the Cloud, you will need to use the TokenFetcher to create the client. Otherwise, create a local access token via the Semaphore admin screen. With this, you can now interact with this Knowledge Review Tool task.
public void writeAiTermsToTask(AISearchTerms aiSearchTerms) throws CloudException {
OEClientReadWrite oeClient = this.connectionUtils.getProgressiveGraphClient();
try {
String modelUri = oeClient.getModelUri();
ConceptScheme conceptScheme = oeClient.getConceptSchemeByName(this.semaphoreConfig.getConceptScheme(), EN);
for (String conceptName : aiSearchTerms.getSearchTerms()) {
try {
// Create the concept with a preferred label.
List<Label> labels = Collections.singletonList(new Label(EN, conceptName));
String encodedConceptName = URLEncoder.encode(
conceptName.toLowerCase().replaceAll(" ", "-"),
StandardCharsets.UTF_8.toString());
Concept concept = new Concept(oeClient, modelUri + HASH + encodedConceptName, labels);
// Populate metadata with prompt question.
MetadataValue metadataValue = new MetadataValue(EN, query);
Map<String, Collection<MetadataValue>> metadata = Map.of("skos:note", Set.of(metadataValue));
// Write concept to KRT Task
oeClient.createConcept(conceptScheme.getUri(), concept, metadata);
} catch (OEClientException e) {
LOGGER.error(FAILED_TO_ADD_CONCEPT, e);
} catch (UnsupportedEncodingException e) {
LOGGER.error(UNABLE_TO_ENCODE_CONCEPT_NAME, e);
}
}
} catch (OEClientException e) {
LOGGER.error(ERROR_WITH_OE_CLIENT, e);
}
} We are now taking that list of search terms and generating concepts. Using the client, we grab the model URI and concept scheme we want to insert the new concepts into. We will generate a label and encoded IRI for the new concept. Additionally, we will capture the original user input to provide the SME with additional context. With this information created, we can now submit the new concept, and it will be present in the Knowledge Review Tool task.

As we see in the KRT Task we now have new concepts added. The SME can now decide to accept, reject, or merge concepts. This enables a Human-in-the-Loop workflow.

Progressive Graphs presents a dynamic, user-driven method for evolving knowledge graphs. By capturing real-time user interactions and harnessing the power of large language models (LLMs) to extract meaningful concepts, organizations can continuously refine and expand their semantic models. This approach effectively bridges the gap between static ontologies and actual user behavior, while maintaining quality and relevance through subject matter expert (SME) oversight.
Moreover, this workflow supports essential human-in-the-loop processes, enabling domain experts and governance teams to review and validate automated outputs. While automation accelerates enrichment, it can introduce issues such as incorrect terminology, outdated concepts or structural inconsistencies. Progressive Graphs mitigate these risks by combining automated intelligence with expert-led validation, ensuring the highest levels of accuracy in enhancing domain knowledge models.
As a result, hybrid search capabilities become more intuitive, context-aware and aligned with real user needs, ultimately driving better outcomes across your information retrieval systems.
Drew Wanczowski is a Principal Solutions Engineer at MarkLogic in North America. He has worked on leading industry solutions in Media & Entertainment, Publishing, and Research. His primary specialties surround Content Management, Metadata Standards, and Search Applications.
Subscribe to get all the news, info and tutorials you need to build better business apps and sites