Skip to Content
PublicationsPublications
  • Article
  • Open Access

2 December 2026

28 Pages

Integration of Agent Skill Invocation and Ontology Collaboration as a New Lens for Knowledge Construction from Classical Texts

,
,
,
and
1
School of Information Management, Sun Yat-sen University, Guangzhou 510006, China
2
Information Research Institute, Qilu University of Technology (Shandong Academy of Sciences), Jinan 250014, China
3
School of Information Resource Management, Renmin University of China, Beijing 100872, China
*
Author to whom correspondence should be addressed.

Abstract

Motivated by the need for semantic exploration and knowledge construction from ancient Chinese books, this study uses the “Er” (儿) fascicle of the Yongle Encyclopedia as a case study to develop an intelligent Q&A platform. It investigates an integrated approach to knowledge acquisition from ancient books, semantic understanding, structured organization, and standardized representation. Specifically, a Retrieval-Augmented Generation (RAG) framework is implemented using the Yongle Encyclopedia corpus to build a domain knowledge base, supporting the traceability of sources and the reliability of outputs. Furthermore, the study adopts agent-mediated multi-skill orchestration, incorporating agent skills as core functional units. Key capabilities, including vector retrieval, visualization generation, and ontology constraints, are modularized to enable multi-tool collaboration and complex task orchestration. The system dynamically invokes model-generated scripts, external tools, and knowledge services based on the Model Context Protocol (MCP), establishing an end-to-end pipeline from raw texts to standardized knowledge graph representations. Practical application to the “Er” fascicle produces multimodal outputs such as knowledge snippet extraction, standardized triple construction, and Mermaid diagrams. These findings provide preliminary evidence for the feasibility of the proposed framework in supporting semantic normalization and knowledge services within the examined case. As a case-based feasibility study, the findings’ generalizability and the independent contribution of agent orchestration remain unverified.

1. Introduction

For a long time, semantic exploration of ancient books and knowledge organization have been core issues in the field of digital humanities. Since the 1940s, when Father Roberto Busa created the Index Thomisticus, digital humanities has increasingly incorporated computational methods into textual analysis, knowledge organization, and the structured representation of cultural heritage resources. Researchers have increasingly sought to reveal semantic relationships, knowledge structures, and contextual connections embedded in complex textual corpora. Existing approaches to the structured organization and knowledge mining of ancient books have largely relied on metadata models, ontology mappings, and other knowledge representation schemes constructed through expert knowledge. By building structured knowledge bases, they achieve the association and visualization of textual content and entities, or conduct word frequency and semantic analysis based on statistical methods. While such approaches ensure rigor in knowledge mining, when dealing with highly heterogeneous, semantically complex, and unstructured ancient manuscripts, they are constrained by the high cost of manual annotation and the rigidity of static logic representation, making it difficult to support flexible and efficient analysis of evolving knowledge structures. As a result, they often face a trade-off between semantic quality and processing efficiency.
Since late 2022, generative artificial intelligence (GenAI), represented by GPT-3.5, has provided new technological possibilities to overcome these bottlenecks, thanks to its deep semantic understanding, natural language processing, and strong generalization capabilities. It has further propelled ancient text mining from digitization toward automation and intelligence. At present, research in ancient text knowledge mining has developed along three main lines: first, heuristic extraction based on prompt engineering or linear workflows, leveraging the zero-shot learning capabilities of large language models to obtain instantaneous knowledge (C. Liu et al., 2025; Li et al., 2025; Wei et al., 2024; J. Jiang et al., 2024); second, supervised fine-tuning or foundational model training on specific corpora to enhance the model’s semantic representation ability in classical Chinese contexts (R. H. Xu et al., 2022; Chai et al., 2025; J. D. Zhang et al., 2024; Wang, 2026; J. F. Liu et al., 2023; Z. X. Zhao et al., 2025); and third, the introduction of RAG, which mitigates the hallucination problem of large models by integrating external knowledge bases (C. Liu et al., 2025; Li et al., 2025; Cao et al., 2024).
Although these approaches have advanced the intelligent development of ancient text mining and organization, they still face significant challenges in delivering highly rigorous and accurate knowledge outputs and services. On the one hand, existing integration schemes of knowledge graphs and large models often lack flexible semantic retrieval support, making it difficult to achieve precise, comprehensive, and deep retrieval of ancient knowledge instances, thus leading to lower-quality generated knowledge. On the other hand, RAG architectures implemented through tools such as LangChain and LlamaIndex are not only constrained by context-window limitations when handling dense and heterogeneous knowledge entities, but also lack strict constraints on the logic of knowledge generation, resulting in notable deficiencies in the accuracy, standardization, and computability of generated knowledge.
Knowledge mining and construction for ancient books should not be a mere accumulation of technical tools or computational power, but rather a deep integration of domain knowledge constraints and the generative flexibility of large language models. This study adopts RAG as its core, leveraging its strengths in factual grounding and long text processing, and guiding knowledge generation in large models through external authoritative knowledge bases. To address key challenges in ancient text knowledge mining, including retrieval accuracy, ontology-based semantic alignment, and traceability of the generation process, multi-strategy reranking mechanisms can be employed to optimize the precision and comprehensiveness of knowledge recall. Domain ontologies can be introduced as semantic anchors to regulate the logical framework of knowledge generation, while standardized protocols can be used to orchestrate the capabilities of multi-dimensional tools. Based on this, the study explores a RAG framework for ancient books that integrates agent skills, MCP, and ontology collaboration. This framework supports knowledge discovery of ancient books, effectively addressing a series of challenges such as semantic representation bias in existing approaches. Taking the Yongle Encyclopedia as a case study, this research examines the feasibility of the proposed framework and explores an approach for evidence-based knowledge extraction, semantic normalization, and structured knowledge construction from ancient texts.
Accordingly, this study addresses the following two research questions:
RQ1. 
How can hybrid retrieval, rank-adjusted score fusion, and evidence-aware reranking be integrated to support accurate and evidence-grounded knowledge retrieval from classical texts?
RQ2. 
How can agent-mediated multi-skill orchestration integrating MCP and domain ontology constraints enable semantic normalization and structured knowledge construction from classical texts, and to what extent can the resulting framework produce reliable and standardized knowledge outputs?
This study proposes an agent-mediated multi-skill orchestration approach that coordinates textual evidence retrieval, ontology querying, and structured knowledge generation. Within this framework, retrieved textual evidence provides the factual basis for knowledge extraction, while ontology definitions provide semantic constraints for entity typing, relation mapping, and standardized representation. This integration extends the role of ontology resources beyond supporting knowledge retrieval and interaction to participating in instance-level knowledge construction.

3. Design and Technical Implementation of an Intelligent Knowledge Construction Framework for Ancient Books

This study addresses the practical need for intelligent knowledge construction of ancient books by building an intelligent Q&A platform driven by collaborative agent skills. It aims to explore a unified workflow integrating knowledge acquisition, semantic understanding, structured organization, and standardized representation of ancient books.

3.1. Technology Selection for Ancient Text Knowledge Construction

The framework follows a task-oriented design in which textual evidence retrieval and ontology querying provide complementary inputs for structured knowledge generation. Agent-mediated multi-skill orchestration coordinates these capabilities within a unified workflow, enabling the transformation of retrieved textual knowledge into ontology-guided RDF representations. This study takes RAG technology as the core to build an intelligent knowledge construction framework for ancient books, as shown in Figure 1. Although LLMs perform excellently in general natural language processing, in the domain of ancient books, where corpora are scarce and highly specialized, they suffer from limitations such as insufficient timeliness of pretrained internal knowledge, inability to directly execute external operations, and difficulty in accessing private data. These issues lead to significant problems such as hallucinated facts and insufficient knowledge support when applied to in-depth exploration of ancient text knowledge. Compared with fine-tuning or knowledge distillation approaches that suffer from limited interpretability and uncertain benefits as models are updated frequently, RAG, through its decoupled design separating external knowledge bases from model inference and Q&A, demonstrates clear adaptive advantages in classical knowledge services. By introducing external knowledge bases, the RAG approach not only ensures traceability of knowledge construction and services, maintaining system transparency and reliability, but also better supports flexible switching of underlying models according to specific needs, enabling precise extraction and organization of ancient text knowledge. Such traceability is especially important in knowledge organization, where LLM-generated structures should retain explicit provenance and warrant information rather than presenting semantic decisions as context-free outputs (Cheng & Choi, 2025).
Figure 1. Overall Framework of Agent-Mediated and Ontology-Guided Knowledge Construction.
In addition, the study incorporates agent skills as the core capability units of the system, empowering LLMs with the ability to orchestrate cross-modal tools and execute complex tasks. In this study, an agent skill refers to a modularized, directly callable functional unit for a specific capability, such as retrieval, visualization, or ontology querying. These skills are coordinated by the LLM-based orchestration layer rather than operating as independent autonomous agents. Unlike traditional Q&A systems driven by a single model or a single knowledge source, the framework adopts an agent-mediated multi-skill orchestration mechanism, through which the LLM dynamically invokes and coordinates modularized skills according to task requirements. Through standardized encapsulation of three key capabilities—vector retrieval, visualization generation, and ontology querying—it achieves an end-to-end generation process from raw ancient text to standardized knowledge graph representation. Within this framework, the model can dynamically orchestrate model-generated scripts, externally integrated tools, and knowledge service functions based on MCP according to specific task requirements. This not only enhances the system’s adaptability to complex ancient text processing scenarios, but also provides the basis for intelligent knowledge construction and the renewed use of ancient books.

3.2. Implementation Process of the Ancient Text Intelligent Q&A Platform

Based on the above framework, this study takes the “Er” fascicle of the Yongle Encyclopedia as an example to construct an intelligent Q&A platform for ancient books. The specific technical implementation covers four layers of logic: data infrastructure design, agent skill orchestration, semantic normalization of ancient books, and knowledge services. First, the relevant content is structurally organized, transforming the original ancient text into JSON format, followed by chunking, vectorization, storage, and indexing to build vectorized knowledge that supports semantic retrieval. Second, agent skills are constructed to handle three tasks: instance knowledge retrieval, knowledge visualization generation, and ontology-based semantic constraint queries. Furthermore, these agent skills are uniformly encapsulated and collaboratively scheduled, providing ancient text knowledge and ontology-based semantic queries in the form of APIs and enabling ontology-driven semantic knowledge graph mapping. Finally, the system outputs three complementary types of results: ancient text knowledge fragments, standardized triple representations, and Mermaid visual diagrams, supporting knowledge services for ancient text research and knowledge queries. The detailed process is as follows:

3.2.1. Data Preprocessing and Vector Storage

The structured organization and semantic normalization of ancient text data enable subsequent retrieval and structured generation. Given the highly condensed semantics and unique contextual characteristics of ancient literature, traditional text embeddings often struggle to fully capture the deep semantic features of such texts. To improve the accuracy of knowledge retrieval, this study adopts a structured preprocessing strategy, parsing the original corpus into JSON-formatted data containing key metadata such as book titles, entries, source references, and volume identifiers. Through structured constraints and metadata enhancement, the semantic richness of text units is improved, supporting subsequent chunking and indexing.
In the data storage stage, the BAAI/BGE-m3 model is used for embedding, converting processed text units into high-dimensional vector representations, and constructing a high-performance local vector database based on LanceDB. Ontology classes, properties, hierarchical relations, and semantic constraints are accessed separately through the OntHub/MCP pathway described in Section 3.2.3, Section 3.2.4 and Section 3.2.5 and are introduced during structured generation to guide entity typing, relation mapping, and RDF representation. The two information paths therefore serve distinct functions: text retrieval supplies documentary evidence from the corpus, whereas ontology access supplies schema-level constraints for standardized knowledge representation.

3.2.2. Hybrid Retrieval and Evidence-Aware Reranking of Ancient Books

When handling small-scale corpora of ancient books, directly using techniques such as JSON Querying to retrieve document keywords can adequately meet the needs of extracting knowledge from ancient literature. However, as the corpus size increases and the structure of texts becomes more complex, a single document retrieval strategy faces limitations such as context window constraints and insufficient semantic representation. The processes of knowledge retrieval and recall are crucial to the quality of knowledge generation by the model and constitute the core problem and methodological essence that must be addressed in constructing knowledge from ancient books. Therefore, this study designs a retrieval mechanism that integrates sparse and dense retrieval, rank-adjusted score fusion, and evidence-aware reranking. As shown in Figure 2, the mechanism improves the relevance and evidential quality of retrieved text units through complementary lexical and semantic retrieval paths.
Figure 2. Technical framework diagram of JSON corpus hybrid indexing and multi-strategy reranking.
(1) Implementation settings. The retrieval subsystem operates on structure-aware evidence units derived from the structured JSON corpus. Records containing no more than 500 Chinese characters were retained as single evidence units. Longer records were segmented primarily at sentence boundaries, with a target chunk length of 360 characters and an overlap of 80 characters. Because sentence boundaries were preserved whenever possible, the target length was not treated as a strict upper bound. This design retains source, volume, section, entry, and textual metadata needed for subsequent retrieval and traceability.
The retrieval module employed a hybrid retrieval strategy based on BM25 and dense embeddings. BM25 was configured with k1 = 1.5 and b = 0.75, while dense representations were generated using BAAI/bge-m3 as 1024-dimensional vectors with exact cosine-similarity retrieval performed in LanceDB. Knowledge generation was performed using deepseek-ai/DeepSeek-V4.1-Flash with a temperature of 0.2 and a maximum output length of 4096 tokens, with the thinking mode disabled. The model was accessed through an OpenAI-compatible API, while LanceDB was used for vector storage and retrieval.
(2) Index construction. The study employs a hybrid approach combining keyword inverted indexes and vector semantic indexes. The inverted index relies on precise keyword matching and can effectively capture proper nouns in ancient books, such as personal names, place names, official titles, time references, and medicinal substances, thereby improving retrieval precision. BM25 sparse retrieval is employed to evaluate the relevance between specific keywords and structured text blocks based on term frequency and inverse document frequency, while preprocessed metadata fields are used for structured attribute filtering. Vector indexing, on the other hand, performs dense retrieval in a high-dimensional vector space by comparing the overall semantic similarity between query content and text blocks. This compensates for missed keyword matches caused by variant terms or synonyms and helps improve retrieval recall.
(3) Query reformulation and rank-adjusted score fusion. Before retrieval, each natural-language question is deterministically reformulated into a set of deduplicated query variants, including the original query, a cleaned core query, an entry-oriented formulation for short queries (up to 12 characters), and selected query fragments. These variants are generated directly from the original query and do not depend on documents retrieved in an initial retrieval round. For each query variant, BM25 and dense retrieval independently return up to 24 candidates, which are combined with metadata-matched candidates to form a unified pool. Missing retrieval scores contribute zero, while metadata-matched candidates remain eligible for ranking.
Candidate fusion incorporates both score magnitude and ranking information. Within each retrieval path, retrieval scores from different query variants are discounted by their ranks and accumulated, as defined in Equation (1). This aggregation favors candidates consistently retrieved across query formulations, although overlapping variants may reinforce similar evidence. Because the original retrieval scores are retained in the fusion process, this procedure is described as rank-adjusted normalized score fusion rather than standard Reciprocal Rank Fusion.
A p d = ∑ q ∈ Q ∏ d ∈ R p q s p q , d r p q , d + 10
Here, p ∈ {B,D} denotes BM25 or dense retrieval, Q is the set of distinct query variants, Rp(q) is the set of candidates retrieved for variant q under path p, sp(q,d) is the corresponding raw retrieval score, and rp(q,d) is the zero-indexed rank of candidate d. The indicator function ensures that query variants not retrieving d contribute zero to its accumulated score. For dense retrieval, sD(q,d) = max{0,1 − cosine_distance(q,d)}, so higher scores indicate greater semantic similarity.
Here, Cp denotes the union of candidates retrieved by path p across all query variants. The accumulated scores are normalized independently within each retrieval path, with zero assigned when no positive score is available.
S ^ p d = A p d max d ′ ∈ C p A p d ′ , max d ′ ∈ C p A p d ′ > 0 , 0 , otherwise .
The metadata bonus E(d) combines exact and substring matches against the entry name and source title (Equation (3)). The indicators I1–I4 represent these four matching conditions, with respective additive weights of 5.0, 3.5, 1.5, and 1.0.
E ( d )   =   5.0   I 1 ( d )   +   3.5   I 2 ( d )   +   1.5   I 3 ( d )   +   1.0   I 4 ( d )
The normalized retrieval scores and metadata bonuses are combined into the fused score S(d) (Equation (4)).
S ( d )   =   1.3   Ŝ B ( d ) + 1.2   Ŝ D ( d )   +   E ( d )
The implementation weights for the normalized BM25 and dense components were set to 1.3 and 1.2, respectively, to balance the precise lexical matching of domain-specific terms, particularly traditional Chinese medicine terminology, with semantic matching between modern-language queries and classical Chinese texts. Fusion and reranking parameters were selected using a separate development set and were fixed before evaluation on the 38-question benchmark.
(4) Evidence-aware heuristic reranking. Following candidate fusion, an evidence-aware heuristic reranking function is applied to jointly consider retrieval relevance, query coverage, and a length-based proxy for evidence-unit completeness. The fused score S(d), including metadata bonuses, is normalized over the unified candidate pool C to obtain rel(d) = S(d)/maxc∈CS(c), which serves as the relevance component in reranking. IDF-weighted query coverage measures the proportion of eligible, distinct query-term weight present in a candidate (Equation (5)); coverage is zero when no eligible terms remain.
coverage d = ∑ t ∈ T idf t ⋅ 1 t ∈ d ∑ t ∈ T idf t ,   T ≠ ∅
Here, T contains distinct, in-vocabulary terms of at least two characters from the cleaned query. The IDF weights are calculated over the indexed evidence chunks, and a term is considered covered when it occurs in the candidate’s indexed text. Coverage is set to zero when T is empty.
A capped length-based proxy is used to approximate evidence-unit completeness (Equation (6)); it does not directly assess semantic completeness.
L d = min keyword _ text d 400 ,   1
F d = rel d + 1.20 coverage d + 0.60 L d
The final reranking score F(d) combines normalized fused relevance, IDF-weighted coverage, and the length-based proxy (Equation (7)). Candidates are ranked by F(d), deduplicated by entry identifier, and the top five are passed to the generation stage subject to a total evidence budget of 4200 Chinese characters.

3.2.3. Retrieval and Reasoning Through Agent-Mediated Multi-Skill Orchestration

At the level of logical orchestration, this study innovatively introduces the functional units of an agent skill construction platform, enabling the modular encapsulation of complex prompts. Specific operations such as knowledge base retrieval, semantic matching, and visualization generation are abstracted into directly callable skills and incorporated into a unified collaborative framework. The architecture and invocation process of the OntHub Querying Skill are illustrated in Figure 3. Specifically, the platform includes the following three key types of skills:
Figure 3. MCP-Based Ontology Query Skill Framework.
(1) LanceDB Querying Skill. This skill is a script-driven skill used to access a local LanceDB vector database (knowledge base) and retrieve ancient text knowledge chunks relevant to user queries through the indexing and reranking mechanisms described in Section 3.2.2. This skill adopts a model-assisted script generation process, in which Claude Code automatically generates the corresponding skill logic based on task requirements. This involves generating and executing Python (v3.12) scripts for knowledge base retrieval, including functional modules such as vector retrieval, result filtering, and text segment return. Compared with traditional rule-based automation tools, model-assisted script generation not only improves tool construction efficiency but also enhances the system’s adaptability to new tasks and scenarios. From a methodological perspective, this skill is not only a retrieval module but also an embodiment of an implementation approach in which the model directly generates task tools; namely, large models drive code generation and execution while operating on local resources.
(2) Mermaid Diagrams Skill. This skill is a constraint-guided skill used to transform knowledge relationships, entity connections, or process structures into Mermaid code, and to visualize them on the front end via Mermaid.js rendering. This skill adopts a self-installation mode, where Claude Code automatically installs and configures other publicly available skills on the network, such as those from the Open Claw portal. Through rule-based guidance, it ensures standardization and controllability during external skill integration. Unlike model-assisted script generation, the core capability of this skill is not generated by the model in real time, but is automatically discovered, installed, integrated, and reused from the external ecosystem, and then incorporated into the orchestration system of this platform. This enables compatibility with the agent skill ecosystem and facilitates subsequent platform iteration and updates. For ancient text knowledge services, the introduction of visualization allows the system not only to return textual answers, but also to generate structured relationship graphs, entity connection diagrams, and knowledge presentation charts, thereby enhancing researchers’ understanding of knowledge structures and content in a more intuitive way.
(3) OntHub Querying Skill. The OntHub Querying Skill provides standardized access to external ontology resources through the MCP-enabled OntHub service. It retrieves the classes, properties, definitions, hierarchical relations, and domain/range constraints required for semantic alignment and structured knowledge generation. The returned ontology information serves as a schema-level constraint source and is coordinated with the instance-level textual evidence returned by the LanceDB Querying Skill. This module is implemented from the bottom up through a three-layer architecture comprising Semantic Web components, an MCP client, and FastAPI. At the lowest layer is the RDF Explorer, which internally defines a set of tools for RDF and SPARQL operations, enabling protocol-based access to both local and online ontology resources via SPARQL endpoints. The middle layer is the encapsulated MCP client, which handles skill invocation, converting semantic requests from the front end or internal system into standardized access to ontology resources. The outer layer is the MCP server built on FastAPI, which provides a unified Web API interface externally. Unlike persistent MCP services, the MCP client in this module invokes server resources on demand. It not only supports resource description, graph statistics, and native SPARQL queries, but also further enables the automatic transformation from natural language into structured query statements. This skill provides a standardized semantic constraint framework for the structured representation of ancient text instance knowledge. The LanceDB Querying Skill retrieves and returns textual facts or candidate knowledge fragments, while the OntHub Querying Skill provides conceptual definitions, hierarchies, relationships, and representation standards. These two skills are coordinated by the orchestration layer, enabling the overall retrieval-augmented architecture to extend from natural-language retrieval to ontology-constrained knowledge representation.

3.2.4. Unified Interface Encapsulation and Service for Multi-Skill Integration

To enable transparent access to multiple skills by the frontend system, the platform further constructs a unified API service layer for agent skills. This layer encapsulates the three core skills mentioned above into standardized API services, allowing them to be invoked on demand by the frontend Q&A system through a unified interface. This layer introduces value in the following aspects: (1) Unified services for heterogeneous agent skills. From an engineering perspective, this layer effectively avoids differences in technical implementation mechanisms among various skills. Heterogeneous skills are abstracted into unified API services, so the frontend does not need to perceive whether a capability comes from local script generation, external skill installation, or MCP interaction, and can process all responses as standard JSON objects; (2) Functional orchestration for ancient text knowledge construction. As the service hub for multi-skill orchestration, this layer can dynamically activate corresponding combinations of skills based on declarative requests sent from the frontend, such as instance knowledge queries and semantic graph generation; (3) A technical framework for continuous improvement and extensibility. This layer decouples technical implementation from frontend applications, providing high extensibility for adding new agent skills or replacing underlying components, thereby enabling iterative evolution of the platform. Through this layer, the frontend intelligent Q&A platform can invoke specific capabilities via declarative requests and integrate data returned from different skills into a unified knowledge generation and construction workflow.

3.2.5. Ontology Driven Intelligent Q&A Platform Collaborative Knowledge Services

At the practical interaction level, the front-end intelligent Q&A platform provides multi-path collaborative knowledge services, providing a workflow from natural-language questions to standardized semantic knowledge graphs. Specifically:
(1) Path 1: Instance knowledge retrieval and visualization generation. Users input relevant questions in natural language. The system first invokes intelligent knowledge base query capabilities to perform semantic retrieval in the local vector database, obtaining the most relevant ancient text knowledge instances, contextual content, or candidate entity relationships related to the user’s query. It then calls knowledge visualization capabilities to convert the retrieved knowledge relationships into Mermaid code and uses Mermaid.js on the front end to render and present the visualization. This forms an instance knowledge service workflow from knowledge acquisition to relationship extraction and graphical representation, supporting factual understanding at the textual level and traceability of evidence, while enhancing knowledge readability.
(2) Path 2: Ontology based semantic knowledge acquisition. Meanwhile, the system invokes ontology semantic query capabilities and accesses external ontology knowledge graphs via the MCP mechanism to obtain ontology definition information related to the current query, including available classes, attributes, semantic relationships, and their hierarchical structures. This path does not directly return factual content from ancient books but instead provides normative guidance on how knowledge should be defined and represented, supporting knowledge graph construction, semantic interoperability, and subsequent computational analysis. This knowledge service path constitutes the semantic support layer for standardized modeling in the system.
(3) Path 3: Normalized generation of semantic knowledge graphs. After obtaining instance knowledge and ontology definitions, the system enters the third path, namely knowledge fusion and standardized generation. Specifically, based on the classes and attributes returned by ontology semantic query capabilities, the platform performs semantic alignment and applies schema constraints to the ancient text knowledge retrieved from LanceDB, mapping unstructured textual knowledge into standardized knowledge graph representations, such as triples in TTL (RDF/Turtle) format. This enables the transformation from textual knowledge discovery to ontology level knowledge mapping and represents one of the core contributions of this study. Based on the above multi-skill collaborative mechanism, the platform ultimately returns three complementary types of results to users, simultaneously meeting the needs for literature evidence acquisition, semantically standardized representation, and visualized analytical presentation, demonstrating positive application value for digital humanities research on ancient books, knowledge engineering, and intelligent Q&A scenarios.

4. Intelligent Construction and Evaluation of Ancient Book Knowledge in the Yongle Encyclopedia

This study takes the “Er” fascicle of the Yongle Encyclopedia as an example to construct an intelligent Q&A platform, conducting a series of experiments on the intelligent construction of ancient book knowledge to verify, analyze, and evaluate the feasibility of the proposed technical framework. The extant volumes of the “Er” fascicle include Volumes 975, 976, 978, 980, 981, 1033, 1036, and 1037, comprising eight volumes in total and primarily documenting pediatric diseases, prescriptions, and treatment methods. These volumes specifically discuss pediatric diseases and treatment methods, recording the level of understanding and technical means in the medical field at that time regarding pediatric conditions. The eight-volume corpus contains 687 non-empty structured JSON source records. After structure-aware segmentation and aggregation, 1218 retrieval chunks were constructed, including 997 entry-level chunks and 221 aggregated chunks. Each retrieval chunk retains relevant metadata such as source, volume, section, entry, and textual content to support retrieval and provenance tracing.

4.1. Experimental Results of Intelligent Knowledge Construction in the Yongle Encyclopedia

Based on the previously designed agent-mediated multi-skill orchestration mechanism and skill invocation scheme, the evaluation experiments focus on four core dimensions. First, by utilizing the knowledge base intelligent retrieval skill (LanceDB Querying Skill) and triple extraction, the platform’s ability to identify knowledge elements in ancient books is examined. Second, by using the knowledge visualization skill (Mermaid Diagrams Skill) to generate Mermaid diagrams, the platform’s capability to reorganize and intuitively represent ancient knowledge information is assessed. Next, the ontology semantic retrieval skill (OntHub Querying Skill) is used to retrieve ontology classes and properties to support ontology-guided knowledge generation, and outputs from multiple sources are integrated to complete the standardized generation of knowledge graphs oriented toward ancient book ontologies. Through these experiments, the platform’s actual effectiveness and potential in processing semantically rich and structurally complex ancient literature are systematically evaluated, particularly in achieving the transformation from unstructured text to standardized and structured knowledge construction. The following four experiments are all presented in the form of prompt input (Question) and model output (Answer), based on the following original text from the Yongle Encyclopedia:
“Shiwei Powder treats difficulty urinating in children. Use Shiwei with the outer skin removed, Qumai, talc, and licorice, one liang each, together with a small handful of rush pith. Grind the above ingredients into powder. Take one qian per dose, add eight fen of water and one hundred grains of wheat, and decoct until reduced to five fen. Remove the residue and serve warm. Adjust the dosage according to the child’s size. (石韋散 治小兒小便不通 石韋去皮 瞿麥 滑石 甘草各一兩 燈心一小把 右為末 每服一錢 水八分 小麥一百粒 同煎五分 去滓温服 量兒大小加減)”.

4.1.1. Triplet Extraction from the Yongle Encyclopedia

Using the platform, extract the prescriptions, symptoms, as well as medicinal material names, processing methods, dosage, and administration methods related to “Shiwei Powder (石韦散),” and generate triplets. The experimental results (in Table 1) show that the intelligent Q&A platform can accurately identify and extract knowledge elements centered on the core entity “Shiwei Powder (石韦散),” covering multiple semantic dimensions such as naming categories, literature sources, and semantic interpretations. The generated results not only contain automated mappings between entities and attributes, but also provide supporting literary evidence through “annotations (注).” These extracted elements provide a basis for subsequent ontology-guided mapping to standardized entity and relation types, demonstrating the feasibility of evidence-based structured knowledge construction from ancient texts.
Table 1. Representative Results of Triplet Extraction of Prescription Knowledge from the Yongle Encyclopedia.

4.1.2. Semantic Query of Traditional Chinese Medicine Ontology

The ontology semantic retrieval capability was used to query the constructed Traditional Chinese Medicine ontology classes and properties. Experimental results (see Table 2) show that this capability, based on the MCP, effectively achieves semantic perception and association of the defined content and logical structure within the ontology knowledge base. A total of 12 core classes and 14 key properties were identified and returned, fully covering core concepts such as formulas, medicinal materials, symptoms, and processing methods. In terms of conceptual relationships, the extraction results of data properties and object properties also strictly adhere to the logical constraints defined in the ontology.
Table 2. Query Results of Traditional Chinese Medicine Ontology Classes and Properties.
From the perspective of result quality, the platform accurately extracted the core concepts and relationships of the ontology and returned the uniform resource identifiers (URIs) and labels used for their definition, facilitating subsequent instance population and forming, to some extent, a traceable evidence chain. The precise capture of specific properties such as “has medicinal material (有药材),” “has dosage(有剂量),” and “applicable to symptoms (适用于症状)” supports the system’s representation of the compatibility logic of Traditional Chinese Medicine formulas and diagnostic semantics. It verifies the accuracy and reliability of the controlled MCP query skill in semantic exchange between the platform database and the front end, and can provide reliable semantic constraints for the subsequent construction of instance knowledge mapping, graph generation, and knowledge storage that conform to domain standards and specifications.

4.1.3. Semantic Knowledge Graph Generation for Formulas

Using the OntHub Querying Skill, instance knowledge related to “Shiwei Powder (石韦散)” was transformed into standard semantic triples. Experimental results (see Table 3) show that the platform-generated graph conforms to strict Turtle triple syntax and follows the ontology knowledge representation standards of Traditional Chinese Medicine, successfully achieving automated transformation from unstructured text to linked data or semantic knowledge graphs.
Table 3. Retrieval and Generation Results of the Formula Semantic Knowledge Graph from the Yongle Encyclopedia.
The generated results use the specified namespace (data:) to assign globally unique identifiers to entities, and employ specific properties such as included medicinal materials (sidh:hasIngredient) and applicable symptoms (sidh:hasSymptom) to construct an interconnected knowledge network covering formulas, medicinal materials, diseases, dosages, and administration methods. In terms of compliance with semantic web normalization, the graph triples strictly adhere to the principle of ASCII-based identifiers and separation of semantic labels, and utilize properties such as name (sidh:hasName) to standardize the storage of Chinese literals. In response to the characteristics of vague dosage expressions and inconsistent measurement units in ancient books, the generated results do not adopt a forced numerical conversion strategy. Instead, they store quantitative or semi-quantitative information from the original literature as literals using sidh:doseValue and sidh:doseUnit, for example, “一” with “兩” (one liang) or “一” with “小把” (a small handful). However, the generated representation does not explicitly associate each dosage instance with its corresponding formula, potentially introducing ambiguity when the same medicinal substance appears in multiple formulas with different quantities. This structured representation supports the organization and publication of extracted knowledge as linked data on the Web. The case-study results indicate that this capability can effectively support knowledge generation from fragmented ancient books to standardized linked data, supporting the feasibility of transforming extracted knowledge from the examined classical texts into standardized RDF representations.
Furthermore, from the perspective of knowledge representation, ontology semantic retrieval skills and methods that directly utilize LLMs for triple extraction correspond to two different structured paths, and the differences between the two are shown in Table 4. The former belongs to knowledge modeling under schema constraints, whose core feature is the introduction of domain ontologies before or during extraction to constrain entity types and relation properties, as well as their domains and ranges, so that the extracted results can be directly mapped into a unified TTL format and aligned with existing ontology structures. The latter is closer to open information extraction, with the advantage of quickly identifying potential factual relationships from text, such as <Shi Wei Powder, ingredient, Qu Mai> (<石韋散, 成分, 瞿麥>), but such results usually lack strict constraints on predicate semantics, entity types, and relation hierarchies, and therefore require further normalization in subsequent processes such as knowledge fusion, schema unification, and graph storage.
Table 4. Comparison between ontology-driven and LLM zero-shot knowledge extraction.
For the domain of Traditional Chinese Medicine formulas, information such as formulas, medicinal materials, symptoms, preparation methods, and administration methods exhibits strong semantic hierarchy and domain dependency. If large models are directly used for triple extraction, although candidate facts can be obtained efficiently, problems such as inconsistent predicate expressions, unstable entity granularity, and mixed relation semantics are likely to occur. In contrast, after obtaining ontology definitions based on the OntHub API and then organizing the data, natural language expressions in the text such as “ingredients,” “indications,” and “decoction methods” can be mapped to predefined classes and properties in the ontology, such as sidh:Formula, sidh:MedicinalMaterial, sidh:hasIngredient, and sidh:hasAdministrationMethod, thereby improving the consistency, interpretability, and computability of knowledge representation.

4.1.4. Generate Content Visualization

Use Mermaid Diagrams Skill to graphically organize knowledge related to “Shiwei Powder” (see Figure 4). The Mermaid code is provided in Supplementary Table S4, and the corresponding diagram is shown in Figure 4. The generated result takes “Shiwei Powder” as the root node, using directed edges to represent the multidimensional semantic relationships between the formula and its therapeutic targets, herbal composition, and methods of administration. Through graph-based representation, the knowledge associations identified in the text are organized into a visual structure, making the extracted relationships easier to examine and interpret. This case illustrates how the Mermaid Diagrams Skill can transform extracted textual relationships into visual representations, providing an intuitive means of exploring knowledge from classical texts.
Figure 4. Mermaid graph TD diagram.
It should be noted that the knowledge representation and service framework developed in this study is primarily designed to preserve and organize information derived from the original text of the Yongle Encyclopedia, with an emphasis on source fidelity and traceability. Accordingly, the current implementation does not perform cross-context normalization of certain knowledge elements, such as medicinal dosages associated with different prescriptions. This distinction reflects the difference between representing what historical sources state and producing normalized interpretations of historical knowledge. As Beretta (2021) emphasizes, source-based assertions and historically interpreted information have different epistemological statuses and should be distinguished in historical knowledge modeling.

4.2. Evaluation of Intelligent Knowledge Construction for the Yongle Encyclopedia

To objectively assess the effectiveness of the proposed framework for intelligent knowledge organization of ancient books, the evaluation was designed around three complementary aspects: retrieval-grounded question answering, ontology-constrained structured generation, and the quality of final outputs.
The retrieval evaluation comprised 38 questions across five task families: factual retrieval, source-bounded enumeration, cross-document comparison, corpus-level aggregation, and multi-evidence reasoning. Six retrieval-generation conditions were compared under the same eight-volume corpus, generation model, evidence budget, and evaluation protocol. The effect of ontology constraints was examined through a separate matched structured-generation experiment, while the final outputs of the framework were further evaluated by three independent external experts. In this way, the evaluation combines automated quantitative metrics with expert qualitative assessment to examine the framework from both technical and domain-oriented perspectives.

4.2.1. Quantitative Evaluation Based on Ragas

This study introduces Ragas 0.4.3 (Es et al., 2023), a specialized evaluation framework for RAG, to quantitatively measure the quality of core processes involved in the knowledge construction experiment. The evaluation employed DeepSeek-V4.1-Flash as the LLM judge (temperature = 0, max_tokens = 8192), with BAAI/bge-m3 additionally used for embedding-based Answer Relevance assessment. The same evaluator settings were applied across all configurations. The evaluation metrics range within [0, 1], where higher values indicate better performance. The specific metrics are defined as follows:
(1) 
Faithfulness: Measures the factual consistency between generated content and the original knowledge snippets retrieved, used to assess the platform’s ability to mitigate hallucination issues when processing ancient books;
(2) 
Answer Relevance: Measures the semantic alignment between generated content and the initial query intent;
(3) 
Context Precision: Evaluates the effectiveness of the multi-strategy reranking mechanism, specifically measuring whether text segments that truly contain core knowledge points are prioritized in the retrieved sequence.
(4) 
Context Recall: Measures the extent to which the retrieved text chunks cover the evidence required to support the reference answer. A higher score indicates more complete retrieval of relevant evidence from the corpus.
The six controlled conditions were: plain LLM without retrieval (B0), weighted keyword RAG (B1), BM25-only RAG (B2), dense-only RAG (B3), hybrid retrieval without reranking (B4), and hybrid retrieval with evidence-aware reranking (B5). All experiments followed the implementation settings described in Section 3.2.2. Scores were calculated from valid metric observations without imputation. Among the evaluation questions, two generations in B0 and two metric evaluations (one each in B1 and B5) failed due to output truncation. These failures occurred across different task families and were retained in the execution logs.

4.2.2. Qualitative Evaluation Based on Expert Verification

Expert validation remains necessary because recent generative KOS studies have shown that iterative human review is critical for improving the precision and contextual appropriateness of AI-generated semantic structures (S.-J. Chen, 2025). While quantitative metrics focus on testing the logical consistency of generated content, for ancient books with extremely high documentary value, the depth and quality of knowledge construction must also rely on validation through expert judgment. Therefore, this study invites domain experts with backgrounds in ancient text collation and digital humanities research to evaluate the platform’s generated results using a five-point Likert scale. The evaluation dimensions are defined as follows:
(1) 
Textual Accuracy: Examines whether the generated entities and relationships conform to philological facts, with a focus on the rigor of variant character recognition, mapping of personal and place names, and citation traceability;
(2) 
Semantic Normativity: Assesses whether ontology mapping follows the disciplinary logic of traditional Chinese medicine or related fields, and evaluates whether the generated TTL-format linked data meets predefined ontology constraints;
(3) 
Knowledge Presentation Effectiveness: Evaluates the degree to which the visualization graph restores the unique semantics of ancient books, and whether it provides researchers with intuitive and reliable support for knowledge understanding.

4.2.3. Evaluation Results of Knowledge Construction for the Yongle Encyclopedia

This study focuses on medical prescription knowledge within the Yongle Encyclopedia, constructing a multi-dimensional evaluation task set covering knowledge retrieval, semantic graph generation, and visualization presentation. The scenarios include typical ancient text research needs of varying complexity, such as single prescription component queries, cross-document comparison, full database aggregated retrieval, and structured code generation. The evaluation results are shown in Table 5.
Table 5. Controlled comparison of retrieval-generation configurations.
Among the six configurations, B5 obtained the highest point estimates across all four automated metrics. However, no single intermediate retrieval configuration consistently outperformed the others across all metrics, indicating that the effects of different retrieval strategies varied by evaluation dimension. Nevertheless, the weighted keyword baseline (B1) remained competitive, achieving higher Context Precision and Context Recall than B4 and approaching B5 on several measures. This finding is consistent with the value of lexical matching for domain-specific expressions in classical texts, such as prescription names and medicinal terms. The following analysis therefore focuses primarily on the matched comparison between B4 and B5, which isolates the addition of the evidence-aware reranking stage within the same hybrid retrieval framework. To quantify uncertainty, paired mean differences were assessed using 10,000 bootstrap resamples of questions with valid scores under both configurations. The resulting 95% confidence intervals included zero across all four metrics, indicating that a statistically significant incremental benefit of B5 over B4 was not established in the present sample (see Supplementary Table S5 for paired mean differences and confidence interval bounds).
(1) Faithfulness Evaluation. B5 achieved the highest Faithfulness score (0.9340 ± 0.1017), slightly higher than B4 (0.9297 ± 0.1520). The difference between the reported mean Faithfulness scores was +0.0043 (0.9340–0.9297). This result indicates that the addition of evidence-aware reranking maintained a high level of factual consistency between generated answers and retrieved evidence. Across the retrieval-based configurations, Faithfulness remained relatively high, suggesting that grounding generation in retrieved classical-text evidence generally helped constrain unsupported content.
(2) Answer Relevance Evaluation. B5 achieved the highest Answer Relevance score (0.8379 ± 0.1480). Among the intermediate baselines, dense-only RAG (B3, 0.7955 ± 0.2605) outperformed BM25-only RAG (B2, 0.6687 ± 0.3663), indicating the value of semantic retrieval for classical-text question answering. Ancient Chinese expressions often differ substantially from modern query formulations, and semantically equivalent concepts may appear in variant lexical forms. Dense retrieval can therefore complement exact lexical matching by identifying passages that are semantically relevant even when surface forms differ. The competitive performance of B1 highlights the value of lexical matching for highly specific terminology in classical texts, such as prescription names and medicinal substances. In contrast, B5 integrates lexical and semantic retrieval with evidence-aware reranking, providing a broader retrieval mechanism that accommodates both precise terminology and semantic variation.
(3) Context Precision Evaluation. B5 achieved the highest Context Precision score (0.6512 ± 0.3774), compared with 0.5927 ± 0.4104 for B4. This improvement is particularly relevant to classical-text retrieval, where retrieved passages may differ considerably in evidential density even when they share similar lexical or semantic relevance. The evidence-aware reranking stage combines normalized base relevance with IDF-weighted query coverage and text completeness, thereby prioritizing evidence units that are both relevant to the query and sufficiently informative for downstream generation. The result suggests that reranking may help reduce the influence of broadly related but weakly informative passages and place evidence-bearing textual units earlier in the retrieved context, although the improvement in Context Precision was not statistically significant.
(4) Context Recall Evaluation. B5 achieved the highest Context Recall score (0.6415 ± 0.3401), compared with 0.6108 ± 0.3618 for B4. Higher context recall is particularly important for knowledge construction from classical texts because relevant evidence is often dispersed across different entries, sections, or volumes rather than concentrated in a single passage. More complete retrieval therefore increases the likelihood that the generation model receives the key evidence required to reconstruct entities, attributes, and relations without omitting important textual support. This is especially relevant to cross-document comparison, corpus-level aggregation, and multi-evidence reasoning, where missed passages may directly lead to incomplete knowledge representations. The slightly higher Context Recall score of B5 may reflect the role of evidence-aware reranking in prioritizing more relevant contextual evidence, thereby improving evidence coverage for these knowledge-intensive tasks.
(5) Comprehensive analysis of expert qualitative evaluation. The evaluation examined the quality of generated question-answering responses and structured knowledge representations from classical texts. The evaluation comprised 50 outputs, including 38 question-answering responses and 12 structured TTL outputs. The latter were generated from 12 source-text windows covering eight volumes of the Yongle Encyclopedia. Three external experts independently evaluated all 50 outputs. The experts had complementary backgrounds in classical-text scholarship/philology, traditional Chinese medicine knowledge organization/ontology engineering, and digital humanities/knowledge graphs. All cases were evaluated independently and blindly using a five-point Likert scale on three dimensions: Textual Accuracy, Semantic Normativity, and Knowledge Presentation Effectiveness. To minimize potential bias, the outputs were anonymized and presented in randomized order. The experts assessed each output based on the provided textual evidence and predefined scoring guidelines, without access to other raters’ scores. Before formal scoring, the raters completed a shared calibration exercise using examples outside the formal evaluation set; no discussion of individual formal cases was permitted during scoring.
Inter-rater reliability was estimated with a two-way random-effects, absolute-agreement model (see Table 6). ICC(2,1) reports the reliability of a single rater, whereas ICC(2,k) reports the reliability of the mean across the three raters; 95% confidence intervals were obtained by bootstrap resampling at the case level. Mean scores were 4.333 (SD = 0.808) for Textual Accuracy, 4.387 (SD = 0.588) for Semantic Normativity, and 4.407 (SD = 0.592) for Knowledge Presentation Effectiveness. The corresponding ICC(2,1) values were 0.909, 0.637, and 0.575, and the ICC(2,k) values were 0.968, 0.840, and 0.802.
Table 6. Expert evaluation scores and inter-rater reliability.
The expert scores indicate generally favorable assessments of the evaluated outputs across the three dimensions. The high Textual Accuracy score reflects the system’s ability to preserve documentary evidence and correctly represent entities and relations extracted from the source texts. The Semantic Normativity score indicates favorable expert assessments of the semantic consistency and standardization of the generated outputs. The Knowledge Presentation Effectiveness score suggests that the evaluated outputs were generally regarded as useful for presenting classical-text knowledge. Although the latter two dimensions showed greater variation among individual raters, the aggregated ICC values remained high, indicating that the overall expert judgments were sufficiently consistent.

4.2.4. Retrieval Performance Across Task Types

Retrieval performance varied across task types, with corpus-level aggregation presenting the greatest challenge. Under B5, this task family yielded a Context Precision of 0.1875 and a Context Recall of 0.1308, substantially lower than the overall results. Unlike factual retrieval or locally bounded queries, corpus-level aggregation requires relevant evidence to be identified across multiple entries, sections, or volumes. In the Yongle Encyclopedia corpus, such evidence is often dispersed rather than concentrated within a small number of highly relevant text chunks.
The current retrieval configuration returns up to five evidence chunks, subject to a total evidence budget of 4200 Chinese characters. While this setting is generally sufficient for localized factual queries, it limits evidence coverage when a task requires exhaustive enumeration or aggregation across the corpus. In addition, long natural-language queries may not always correspond directly to the entry names, source expressions, or lexical forms preserved in classical texts, which can further affect retrieval coverage. These results indicate that local relevance-oriented retrieval is better suited to focused knowledge acquisition than to exhaustive corpus-level knowledge aggregation, for which broader retrieval and hierarchical aggregation mechanisms remain necessary.

4.2.5. Ontology-Constrained Structured-Generation Validation

To examine the representational contribution of ontology access, a matched structured-generation comparison was conducted while holding the source evidence, generation model, prompts, and output format constant and varying only whether the OntHub schema was supplied. All 12 outputs in both conditions were syntactically valid Turtle. Without the schema, the generated outputs contained 109 cumulative instances of ontology vocabulary that was not defined in the supplied ontology; with the OntHub schema, this count was reduced to 0 (see Table 7). These results show that explicit ontology information substantially improves vocabulary-level schema conformity in generated RDF, supporting the use of predefined ontology terms in structured knowledge representation. For classical-text knowledge construction, the ontology provides a semantic reference for mapping extracted entities and relations to predefined categories, thereby supporting the standardized representation of knowledge graphs.
Table 7. Comparison of structured-generation results with and without ontology constraints.
Taken together, the quantitative results and case-based observations demonstrate the feasibility of integrating evidence-grounded retrieval, ontology-constrained structured generation, and knowledge visualization within the proposed multi-skill RAG framework for classical-text knowledge construction. The evaluation also reveals clear task-dependent differences: the framework performs better on focused retrieval and structured representation tasks, while corpus-level aggregation and broad evidence coverage remain more challenging. Overall, the results support the practical feasibility of the proposed framework for knowledge construction and knowledge services based on classical texts.

5. Discussion

This study proposes a RAG framework oriented toward the organization of knowledge in ancient books, supporting a shift from static description toward dynamic knowledge construction by coordinating evidence retrieval, semantic constraints, and modular skill invocation within a unified workflow.
This design is consistent with recent studies emphasizing the importance of externally grounded and traceable knowledge generation in knowledge-organization systems. Cheng and Choi (2025), for example, argue that LLM-generated semantic structures should preserve explicit provenance and warrant information rather than presenting organizational decisions as context-free outputs. In the present framework, retrieved text chunks, source metadata, ontology definitions, and structured outputs remain connected throughout the generation process, providing an evidence chain from classical-text instances to normalized knowledge representations. This extends the role of RAG beyond factual supplementation by making retrieval evidence an explicit component of the knowledge-construction process. The controlled evaluations further suggest that evidence grounding and ontology constraints contribute at different levels: retrieval primarily supports evidence-grounded generation, whereas explicit ontology access improves conformity to predefined representation schemas. Within the retrieval subsystem, B5, combining lexical matching, semantic retrieval, and evidence-aware reranking, achieved the highest observed mean scores across all four metrics. In the context of classical-text knowledge construction, this combination helps reconcile two practical requirements: the precise localization of domain-specific textual evidence and the broader recovery of semantically related knowledge instances needed for subsequent structured generation.
The role of ontology in this framework also differs from approaches that focus primarily on ontology construction or ontology-assisted retrieval. T. Chen (2026), for example, demonstrated the feasibility of integrating RAG, ontology resources, and MCP for ontology-centered retrieval and interaction in ancient book environments. The present study further incorporates ontology querying into the generation workflow itself, using retrieved classes, properties, and semantic relations as runtime constraints for mapping textual knowledge into standardized RDF representations. The ontology ablation further clarifies this role: explicit access to the OntHub schema improved vocabulary-level schema conformity in generated RDF, indicating that ontology integration primarily contributes to semantic standardization at the representation level rather than to factual grounding itself. Within the overall architecture, MCP provides standardized access to external capabilities, the skill layer supports task-oriented orchestration, and the ontology supplies explicit schema-level constraints for structured generation.
A similar distinction can be observed in relation to recent agent-based studies on classical texts. X. D. Zhao et al. (2026) combined RAG and knowledge-graph retrieval within a domain-specific agent for mathematical classics, while C. F. Xu et al. (2026) employed multiple specialized agents for task planning, retrieval, evaluation, multimodal generation, and knowledge services in local-chronicle research. Xiang et al. (2025) further discussed the convergence of knowledge graphs, RAG, and multi-agent systems for ancient Chinese medical classics. Rather than implementing multiple autonomous agents, the present framework adopts an agent-mediated multi-skill orchestration architecture, in which retrieval, visualization, and ontology-querying capabilities are modularized as callable skills and coordinated through standardized interfaces. The principal architectural distinction of this design lies in functional modularity: individual capabilities can be replaced, extended, or recombined without reconstructing the entire workflow. The evaluation also reveals several boundaries of the proposed approach.
First, the clearest retrieval limitation concerns corpus-level aggregation in classical-text knowledge construction. In the Yongle Encyclopedia, related medical knowledge may be distributed across multiple entries, sections, or volumes rather than concentrated in a single passage. Although the current local Top-k strategy performs effectively for focused evidence retrieval, it may omit relevant instances when a task requires exhaustive collection or cross-entry synthesis. This limitation reflects the inherent constraints of local relevance-oriented retrieval rather than reranking alone. Future research will further examine these aspects and explore richer corpus-level semantic associations through complementary graph-based methods.
Second, the current framework remains primarily retrieval-centered and is therefore better suited to evidence-grounded extraction and schema-constrained representation than to the discovery of highly nonlinear, multi-hop, or corpus-level relationships. Graph-oriented retrieval, including GraphRAG, represents a complementary direction for tasks requiring corpus-level relational exploration. It is discussed here as an alternative retrieval paradigm rather than as a baseline against which the present framework has demonstrated superiority.
Third, the empirical evaluation is based on eight pediatric volumes from the “Er” fascicle of the Yongle Encyclopedia, representing a relatively homogeneous medical-text scenario. Classical Chinese corpora differ substantially in genre, edition, linguistic style, knowledge density, and organizational structure. The transferability of the proposed retrieval strategy, parameter settings, ontology constraints, and skill orchestration mechanism to historical, literary, administrative, or multilingual corpora therefore remains to be validated. These limitations define the current framework as a case-based feasibility study rather than a universally validated solution for classical-text knowledge construction.
Fourth, at the knowledge representation level, reliable structured generation requires not only ontology constraints but also context-aware semantic validation. Future work could incorporate post-processing mechanisms, including syntactic validation and context-aware consistency checks, to improve the accuracy and consistency of generated knowledge representations.

6. Conclusions

This study explores the feasibility of integrating RAG, agent-mediated multi-skill orchestration, and ontology constraints for knowledge construction from classical texts. The main findings are summarized as follows:
First, by integrating MCP with an agent-mediated multi-skill orchestration mechanism, the framework supports more targeted retrieval and structured knowledge generation from complex ancient text corpora. The case-study results suggest the feasibility of this integrated approach for supporting knowledge construction from ancient literature, subject to further validation across corpora and genres.
Second, at the representation level, the framework integrates established knowledge-organization principles, particularly ontology-based semantic constraints, into the generative workflow. The matched ontology experiment indicates that explicit ontology access improves vocabulary-level schema conformity in structured RDF generation, supporting the role of ontology constraints in semantic standardization. This integration further enables ontology resources to participate in instance-level knowledge construction, rather than serving solely as tools for knowledge retrieval and interaction.
Third, the framework adopts a modular architecture that allows flexible integration with different large language models and functional components. However, the findings of this study are based on eight pediatric volumes of the Yongle Encyclopedia, and the framework’s scalability and transferability to larger and more heterogeneous ancient text corpora, as well as to different categories, editions, linguistic styles, and languages, require further systematic validation. In addition, the independent contribution of agent-mediated orchestration has not been established, as the present study did not include a direct comparison with an equivalent fixed workflow. Future research will further examine these aspects and explore the complementary use of graph-based methods for richer corpus-level semantic association and relational analysis.

Supplementary Materials

The following supporting information can be downloaded at https://www.mdpi.com/article/10.3390/publications14040085/s1. Table S1: Results of Triplet Extraction of Prescription Knowledge from the Yongle Encyclopedia; Table S2: Query Results of Traditional Chinese Medicine Ontology Classes and Properties; Table S3: Retrieval and Generation Results of the Formula Semantic Knowledge Graph from the Yongle Encyclopedia; Table S4: Visualization Coding of Formula Knowledge in the Yongle Encyclopedia; Table S5: Paired Bootstrap Comparison of B5 and B4 across Four Metrics.

Author Contributions

T.C.: Conceptualization, methodology, supervision, project administration, funding acquisition, and writing—review and editing. Z.T.: Data curation, investigation, software development, visualization, and writing—original draft. Z.L.: Methodology, software development, validation, formal analysis, and visualization. X.L.: Methodology, formal analysis, and writing—review and editing. X.Y.: Conceptualization, methodology, formal analysis, writing—original draft, and writing—review and editing. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Interdisciplinary Cultivation Project of the Fundamental Research Funds for the Central Universities of Sun Yat-sen University, titled “Research on the Construction of Ancient Book Ontology Large Language Model and Its Application in Smart Data” (Project No. 25wkjc03).

Data Availability Statement

The research materials supporting this study, including the structured corpus derived from the “Er” fascicle of the Yongle Encyclopedia, prompt sets, configuration files, agent skill scripts, evaluation materials, and implementation code, are available in an anonymized research repository at https://anonymous.4open.science/r/ontology_collaboration-E517/README.md (accessed on 22 November 2026). Additional information may be obtained from the first author, Tao Chen (chent283@mail.sysu.edu.cn), upon reasonable request.

Conflicts of Interest

Tao Chen serves as an Editorial Board Member of Publications. He was not involved in the editorial review or decision-making process for this manuscript. The other authors declare no conflict of interest.

Appendix A. English Translations of Chinese Text and Literals

Appendix A.1. Source Passage from the Yongle Encyclopedia

  • Original Chinese: 石韋散 治小兒小便不通 石韋去皮 瞿麥 滑石 甘草各一兩 燈心一小把 右為末 每服一錢 水八分 小麥一百粒 同煎五分 去滓温服 量兒大小加減
  • English translation: Shiwei Powder treats difficulty urinating in children. Use Shiwei with the outer skin removed, Qumai, talc, and licorice, one liang each, together with a small handful of rush pith. Grind the above ingredients into powder. Take one qian per dose, add eight fen of water and one hundred grains of wheat, and decoct until reduced to five fen. Remove the residue and serve warm. Adjust the dosage according to the child’s size.

Appendix A.2. Chinese Literals Retained in Structured Outputs

  • “石韋散” Shiwei Powder
  • “石韋” Shiwei
  • “瞿麥” Qumai
  • “去皮” outer skin removed
  • “小兒小便不通” difficulty urinating in children
  • “一兩” one liang
  • “一錢” one qian
  • “一小把” a small handful
  • “一” one
  • “兩” liang
  • “成分” ingredient

References

  1. Beretta, F. (2021). A challenge for historical research: Making data FAIR using a collaborative ontology management environment (OntoME). Semantic Web, 12(2), 279–294. [Google Scholar] [CrossRef] [Scilit]
  2. Bhat, S. R., Rudat, M., Spiekermann, J., & Flores-Herr, N. (2025). Rethinking chunk size for long-document retrieval: A multi-dataset analysis. arXiv, arXiv:2505.21700. [Google Scholar]
  3. Cao, J., Peng, D., Zhang, P., Shi, Y., Liu, Y., Ding, K., & Jin, L. (2024). TongGu: Mastering classical Chinese understanding with knowledge-grounded large language models. arXiv, arXiv:2407.03937. [Google Scholar]
  4. Chai, J. X., Lang, X. F., Li, H. Y., Zhou, Z. J., Ling, Y., Zhan, L. B., Hu, K. F., & Qiao, X. B. (2025). Research on lightweight large language models for ancient traditional Chinese medicine texts based on LoRA fine-tuning. Modernization of Traditional Chinese Medicine and Materia Medica-World Science and Technology, 27(3), 823–831. [Google Scholar]
  5. Chen, S.-J. (2025). Advancing thesaurus construction with generative AI: A structured approach to synonym identification and scope note development. Knowledge Organization, 52(5), 46865. [Google Scholar] [CrossRef] [Scilit]
  6. Chen, T. (2026). Research into an intelligent ontology system for ancient books driven by retrieval-augmented generation and model context protocol. Journal of Nantong University (Social Sciences Edition), 42(3), 116–132+164. [Google Scholar]
  7. Cheng, Y.-Y., & Choi, I. (2025). From editorial records to structured provenance information: Documenting warrant in knowledge organization systems using large language models. Knowledge Organization, 52(3), 39046. [Google Scholar] [CrossRef] [Scilit]
  8. da Silva Lemos, D. L., & Souza, R. R. (2024). Ontologies for semantic annotation: Proposal for an ontological multimedia reference model. Knowledge Organization, 51(8), 561–581. [Google Scholar] [CrossRef] [Scilit]
  9. Es, S., James, J., Espinosa-Anke, L., & Schockaert, S. (2023). Ragas: Automated evaluation of retrieval augmented generation. arXiv, arXiv:2309.15217. [Google Scholar]
  10. Funk, M., Hosemann, S., Jung, J. C., & Lutz, C. (2023). Towards ontology construction with language models. arXiv, arXiv:2309.09898. [Google Scholar]
  11. Giglou, H. B., D’Souza, J., & Auer, S. (2023). LLMs4OL: Large language models for ontology learning. arXiv, arXiv:2307.16648. [Google Scholar]
  12. He, L., & Cao, L. (2006). Research of building and retrieval of ancient agricultural book ontology. Data Analysis and Knowledge Discovery, 1(12), 37–39. [Google Scholar]
  13. Huang, T. J., Zhu, X. D., Liu, K., Wang, S. J., & Zhao, P. (2026). Survey on document-oriented retrieval-augmented generation. Journal of Chinese Computer Systems, 47(2), 282–297. [Google Scholar]
  14. Jafari, A. A., Ozcinar, C., & Anbarjafari, G. (2026). A lightweight modular framework for constructing autonomous agents driven by large language models: Design, implementation, and applications in AgentForge. arXiv, arXiv:2601.13383. [Google Scholar]
  15. Jiang, J., Ling, Y., Li, B., Li, P., Piao, J., & Zhang, Y. (2024). Poetry2Image: An iterative correction framework for images generated from Chinese classical poetry. arXiv, arXiv:2407.06196. [Google Scholar]
  16. Jiang, Z., Ma, X., & Chen, W. (2024). LongRAG: Enhancing retrieval-augmented generation with long-context LLMs. arXiv, arXiv:2406.15319. [Google Scholar]
  17. Kiss, C., Nagy, M., & Szilágyi, P. (2025). Max–Min semantic chunking of documents for RAG application. Discover Computing, 28, 117. [Google Scholar] [CrossRef] [Scilit]
  18. Li, J. B., Wei, T. X., Qu, W. G., Li, B., Feng, M. X., & Wang, D. B. (2025). Combining lexicon definitions and the retrieval-augmented generation of a large language model for the automatic annotation of ancient Chinese poetry. Mathematics, 13(12), 2023. [Google Scholar] [CrossRef] [Scilit]
  19. Lippolis, A. S., Saeedizade, M. J., Keskisärkkä, R., Zuppiroli, S., Ceriani, M., Gangemi, A., Blomqvist, E., & Nuzzolese, A. G. (2025). Ontology generation using large language models. arXiv, arXiv:2503.05388. [Google Scholar]
  20. Liu, C., Zhang, Q., Wang, D. B., Shen, S., Wu, M. C., Liu, L., & Su, Y. S. (2025). Research on the Extraction and Application of Ancient Books’ Restricted Domain Relation Based on Large Language Model Technology. Journal of the China Society for Scientific and Technical Information, 44(2), 200–219. [Google Scholar]
  21. Liu, J. F., Liu, C. F., Qi, Y., Liu, L., Li, B., Liu, C., & Wang, D. B. (2023). A practical exploration of AIGC-powered digital humanities research: A SikuGPT driven research of ancient poetry generation. Information Studies: Theory & Application, 46(5), 23–31. [Google Scholar]
  22. Luo, C. G., Shan, C., & Wang, S. (2007). An ontology-based approach to construct a knowledge base about rare books. Data Analysis and Knowledge Discovery, 2(4), 8–11. [Google Scholar]
  23. Park, Z. (2025). AI for KOS discovery: Refining search, recommendation, and hallucination mitigation. Knowledge Organization, 52(4), 45889. [Google Scholar] [CrossRef] [Scilit]
  24. Saeedizade, M. J., & Blomqvist, E. (2024). Navigating ontology development with large language models. In A. Meroño Peñuela, A. Dimou, R. Troncy, O. Hartig, M. Acosta, M. Alam, H. Paulheim, & P. Lisena (Eds.), The semantic web—ESWC 2024 (Vol. 14664, pp. 132–148). Lecture Notes in Computer Science. Springer. [Google Scholar] [CrossRef] [Scilit]
  25. Sonowal, H., & Sadhu, S. (2025). Structure-aware chunking for abstractive summarization of long legal documents. In Proceedings of the 1st workshop on NLP for empowering justice (pp. 171–178). Association for Computational Linguistics. [Google Scholar]
  26. Wang, D. B. (2026). XunziALLM. Available online: https://github.com/Xunzi-LLM-of-Chinese-classics/XunziALLM (accessed on 27 May 2026).
  27. Wei, Y., Xu, Y., Wei, X., Yang, S., Zhu, Y., Li, Y., Liu, D., & Wu, B. (2024). AC-EVAL: Evaluating ancient Chinese language understanding in large language models. arXiv, arXiv:2403.06574. [Google Scholar]
  28. Wu, X., & Fu, T. (2025). Comprehensive review of retrieval-augmented generation. Computer Engineering and Applications, 61(20), 19–35. [Google Scholar]
  29. Xiang, S., Lin, H., Cai, F., & Jiang, Z. (2025). Integrating knowledge graphs with ancient Chinese medicine classics: Challenges and future prospects of multi-agent system convergence. Chinese Medicine, 20, 168. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  30. Xu, C. F., Zhao, W. J., & Zhu, S. L. (2026). Research on knowledge reorganization and narrative revitalization of materials on products in local chronicles integrating workflow and AI agents. Journal of Nantong University (Social Sciences Edition), 42(1), 127–141. [Google Scholar]
  31. Xu, R. H., Wang, D. B., Liu, H., Liang, Y., & Chen, K. (2022). Automatic summarization of ZiZhi TongJian from the perspective of digital humanities based on ancient Chinese books: A case of SikuBERT pre-training model. Library Tribune, 42(12), 129–137. [Google Scholar]
  32. Yao, S., Zhao, J., Yu, D., Du, N., Shafran, I., Narasimhan, K. R., & Cao, Y. (2023, May 1–5). ReAct: Synergizing reasoning and acting in language models. 11th International Conference on Learning Representations (ICLR 2023), Kigali, Rwanda. Available online: https://openreview.net/forum?id=WE_vluYUL-X (accessed on 27 May 2026).
  33. Zhang, J. D., Yang, S. H., Liu, J. F., & Huang, Q. (2024). AIGC empowering the revitalization of ancient books on traditional Chinese medicine: Building the Huang-Di large language model. Library Tribune, 44(10), 103–112. [Google Scholar]
  34. Zhang, Q., Guan, S. P., & Xu, F. H. (2026). Research on constructing a knowledge graph for Pre-Qin canonical texts driven by AI agent technologies. Journal of Nantong University (Social Sciences Edition), 42(1), 142–154. [Google Scholar]
  35. Zhang, X. X., Li, S. Y., Shen, W., Zhang, C. K., & Wang, Y. (2022). Research on knowledge organization of Dunhuang Turpan medical literature from the perspective of digital humanities. Library and Information Service, 66(22), 28–43. [Google Scholar]
  36. Zhao, X. D., Lin, M., Tang, B. Y., Dong, J., & Bai, H. (2026). Knowledge graph and retrieval-augmented generation collaborative knowledge augmentation in mathematical ancient text domain agent. Computer Engineering and Applications, 62(4), 124–136. [Google Scholar]
  37. Zhao, Z. X., Sun, G. Y., Liu, C., & Wang, D. B. (2025). Research on machine translation of ancient books in the era of large language model. npj Heritage Science, 13, 122. Available online: https://www.nature.com/articles/s40494-025-01697-9 (accessed on 22 November 2026). [CrossRef] [Scilit]
  38. Zhou, C. Y., Chai, H. C., Chen, W. T., Guo, Z. H., Shan, R., Song, Y. Y., Xu, T. Y., Yang, Y. X., Yu, A. F., Zhang, W. M., Zheng, C. M., Zhu, J. C., Zheng, Z. Y., Zhang, Z. S., Lou, X. Y., Zhang, C. W., Fu, Z. H., Wang, J., Liu, W. W., … Zhang, W. N. (2026). Externalization in LLM agents: A unified review of memory, skills, protocols and harness engineering. arXiv, arXiv:2604.08224. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.