Daejeon, July 27–31
Small language models hold promise for digital humanities in the interests of explainable, ethical, and sustainable practice. In the past two years, the availability of models that can run on laptop computers rather than requiring datacenters has permitted refined customization of models on specific datasets, mitigated privacy concerns, and represents a significant step in reducing resource consumption (Zhang 2025). Research into minimizing the footprint of generative AI models is an ethical imperative for digital humanities scholars in the face of rapidly expanding dependencies on data centers, depleting environmental resources, exploited labor, and manufactured dependencies on "black box" software built on unknowable assemblages of text and media (Berry 2023; Regilme 2024). Investigating how to enhance small models with structured humanities data may be one way of addressing the call for humanities research practice to intervene and improve AI technologies (Hämäläinen 2024).
With intentions to make a "black box" technology explainable to ourselves, and find out if we can design a minimal and efficient small-scale language model system, we began a project in 2025 called "DigitAI" (named for our "Digit" program at Penn State Behrend). DigitAI began as an experiment to supply a small-scale language model with Retrieval Augmented Generation (RAG)–giving it query access to a structured "ground truth" knowledge base derived from the XML structure of the TEI P5 Guidelines. Preparing our RAG has involved parsing the TEI Guidelines (available as a complete XML document in P5.xml from the TEI Guidelines repository and updated with each new release of the Guidelines) in a context-aware manner, stored and accessed in information "chunks" based on the text content of XML element nodes. We launched our project with these primarily educational goals in view:
Our small-scale project can be built on a multi-core Mac or Windows laptop computer. We want to be able to swap out open-source models as the available resources change, but maintain XML scripts as a RAG resource readily queried via XPath processing initiated from Python. If our current design succeeds, we anticipate connecting it with multiple XML projects to assist in finding information, discovering inconsistencies, and answering questions in natural language about the data, enhanced by the ability to execute XPath.
Last year at DH2025 Lisbon, we presented our first learning experiments with the DigitAI RAG model (Fisher, Bills, Beshero-Bondar 2025). However, the original model posed a problem of "code bloat": We had prepared a knowledge graph in neo4j to store carefully parsed content from the TEI Guidelines. The preparation of the RAG resource in 2025 involved a complex XSLT transformation of the TEI P5.xml document into neo4j's graph structure–converting every possible relationship of the paragraphs of the TEI Guidelines chapters and their associated encoding schema definitions of elements, model classes, and attribute definitions. By the time of the DH2025 conference in Lisbon, our team had prepared an incomplete RAG resource storing relationships of chapter paragraphs to elements and attributes and encoding examples discussed, but lacking detail from the element and attribute specifications. This attempt made an abstracted and bloated version of the original XML document because we were writing XSLT both to:Last year at DH2025 Lisbon, we presented our first learning experiments with the DigitAI RAG model (Fisher, Bills, Beshero-Bondar 2025). However, the original model posed a problem of "code bloat": We had prepared a knowledge graph in neo4j to store carefully parsed content from the TEI Guidelines. The preparation of the RAG resource in 2025 involved a complex XSLT transformation of the TEI P5.xml document into neo4j's graph structure–converting every possible relationship of the paragraphs of the TEI Guidelines chapters and their associated encoding schema definitions of elements, model classes, and attribute definitions. By the time of the DH2025 conference in Lisbon, our team had prepared an incomplete RAG resource storing relationships of chapter paragraphs to elements and attributes and encoding examples discussed, but lacking detail from the element and attribute specifications. This attempt made an abstracted and bloated version of the original XML document because we were writing XSLT both to:
Our preliminary efforts did not provide reliable results to queries and we had concerns about whether and how reliably information was pulled from our RAG resource. It seems likely to us that our model was relying on word embeddings to translate the information it received from the incomplete graph RAG. We planned to complete the RAG Graph until we learned of a more promising method of addressing our "ground truth" TEI XML data in the fall of 2025.
Thanks to recent developments introduced by Anthropic and now widely available in the open source community, we can design a new model infrastructure that allows an LLM to deploy a Model Control Protocol (MCP) server, which permits it to address the TEI XML tree data structure directly with direct XPath queries to XML nodes. By autumn 2025 our team began reading about MCP. Our breakthrough is determining that XML data need not be restructured to be available to an AI system. Our new challenge is determining how to provide a map of the TEI P5.xml tree structure and enough example XPath scripts to retrieve relevant information about an element, attribute, or model class in the TEI. As this is an area of expertise in our team and program, we are confident that if we can teach humans to write XPath, we can script what is needed for an agentic AI system to access an XPath MCPservice (e.g. Skywork AI 2025).
We are now working to create an agentic system that may read XML directly with XPath rather than having to translate intricate XML data structures into a graph database. Developing an agentic localized model also facilitates reporting about when and what RAG resources the model is consulting as well as what XPath expressions it deploys to retrieve the information. We look forward to sharing the work and a look "under the hood" at its operations at the DH2026 conference.