
Tanzeela Zafar, Government College University Faisalabad (Pakistan)
MS in Information Technology, Government College University Faisalabad, Pakistan. Research interests include AI in Education, educational technology, and adaptive chatbot tutors.

António Pedro Costa, Faculty of Psychology and Education Sciences, University of Porto (Portugal)
Researcher at the University of Porto and part of the team behind the qualitative analysis software webQDA. Coordinates major international conferences on research methodologies and serves as Editor-in-Chief of New Trends in Qualitative Research (NTQR).
In this article, we present a tutorial for users/researchers to create and use an AI Agent compatible with the AbductivAI model (Costa et al., 2025). The first version of the agent is available on Hugging Face. The tutorial explains how to build a Research Agent capable of collaborating with humans in the analysis of qualitative data, following the 8 phases of the AbductivAI model described in the article. This tutorial is written in an applied and pedagogical manner to be included directly in a guide, course, or platform.
Why introduce Agentic AI in qualitative analysis?
Qualitative analysis requires interpretation, sensitivity to context, reflexivity, and epistemological responsibility, which are profoundly human capacities. Recent literature shows that AI has evolved from a tool to a collaborative agent, capable of participating in reasoning, suggesting patterns, and supporting interpretative decisions (Floridi & Chiriatti, 2020; Johnson & Paulus, 2024). The article “AI as a Co-researcher in the Qualitative Research Workflow” reinforces that AI is becoming a co-researcher, directly influencing analytical and interpretative processes when properly framed as an actor in a sociomaterial network (Latour, 2005; Orlikowski & Scott, 2008). However, this collaboration is only valid if it is not confused with total delegation. So, how can AI be introduced into qualitative analysis without AI replacing the human researcher?
One possible response is to create agents with limited agency, operating within clearly defined methodological boundaries. In this framework, humans always retain the final decision (epistemic primacy), while AI supports the process but does not decide autonomously. These agents must explain their reasoning transparently, allowing for human scrutiny, and ensure fully auditable interactions with traceability and documentation of each analytical step. This approach aligns with what the article describes as Human–AI Distributed Cognition and Complementary Intelligence, emphasizing a collaboration in which AI complements, but never replaces, human interpretative capacity.
Thus, the introduction of AI into qualitative analysis without adequate safeguards can result in the loss of human agency, manifesting itself through cognitive dependence, when the researcher begins to assume that “AI knows best”; erosion of reflexivity; decontextualization of analysis; reduction of interpretive diversity; and even algorithmic colonization of categories, with the imposition of biases from the models used. The article presenting the AbductivAI model explicitly reinforces these risks, emphasizing the need for human oversight, technological reflexivity, and continuous validation of the outputs generated by AI, as advocated by several authors (Paulus et al., 2025; Lockwood, 2024).
Paradoxically, the integration of well-designed AI agents can expand human agency, provided we implement them in a controlled and methodologically conscious manner. These agents free the researcher from repetitive and operational tasks, such as segment extraction, initial code generation, systematic comparison of codings, or the production of intermediate syntheses, allowing time and cognitive energy to be invested in more complex interpretive stages. In addition, they contribute to the reinforcement of reflexivity, acting as devil’s advocates (Sarofim, 2024), questioning assumptions, revealing blind spots, and encouraging the researcher to explain and justify analytical decisions. Another benefit lies in intra-analytical triangulation, as multiple agents can be used to compare reasoning, as proposed in the AbductivAI model, which encourages the simultaneous use of multiple human coders and agents to strengthen the consistency and credibility of the analysis. Added to this is the increased transparency provided by AI, namely through the explicit recording of reasoning and thought chains (e.g., Chain-of-Thought), enabling traceability, auditing, and methodological scrutiny.
The connection with the AbductivAI model (see figure 1) is particularly evident, as it proposes an analytical process structured in eight phases that include human–agent co-coding, iterative review, final human validation, and the use of agents as second and third coders. In this context, Agentic AI, as operationalized in Research Agent, is mainly integrated into the operational phases of the analysis (phases 3 to 7), providing intensive support for the most demanding tasks but without ever replacing the interpretative, reflective, and decision-making role of the human researcher.
How to create your Agentic AI: Step by step
This study did not approach the development of the Research Agent as a purely technical task. In practice, the process was a slow one, particularly in trying to understand how an AI system could be part of qualitative analysis without reducing the interpretative role of the researcher. There are already plenty of AI assistants out there, but most of them focus on answering questions or automating tasks. Our goal was to create something different. The aim was to design an agent capable of analytical reasoning while remaining methodologically constrained within the principles of the AbductivAI model.
The first stage was to determine the role that the agent would play in the research process. Initial experiments with more “general purpose” prompts quickly produced outputs that felt too generic and, at times, too confident. The system was tuned gradually so that the agent would act less as an autonomous assistant and more as a co-researcher under human supervision. In practice this meant explicitly instructing the system not to make final interpretative decisions but rather to assist with things such as suggesting initial categories, comparing coding alternatives, finding inconsistencies, and asking reflexive questions.
The Research Agent in the Hugging Face environment was built as a relatively simple Gradio-based interface. Rather than burdening the user with a host of technical choices, the interface was divided into a few functional areas that were intended to reflect the flow of the analytical process itself. One part of the system is used to define the analytical profile or “persona” of the agent. Here the researcher can specify methodological orientation, areas of expertise, preferred analytical style, or even the theoretical perspective that informs the study. This was important as the quality of the interaction varied greatly depending on how well the role of the agent was established from the beginning.
Another part of the interface was designed to support interaction for coding. The agent analyses qualitative data and tries to explain why a particular interpretation or category is relevant instead of making ad hoc responses. The tests showed that asking the system to justify its reasoning produced more useful output than simply asking for codes. In many cases the explanation itself became analytically valuable, as it exposed assumptions, uncertainties, or possible contradictions in the interpretation process.
Actually, a simple example may help demonstrate how the interaction works. In one test session, we inserted into the coding environment an excerpt from a short interview about “feeling disconnected during online learning.” The agent produced not a single category, but a few possible interpretations, such as “student isolation,” “less engagement in the classroom,” and “digital learning fatigue.” More importantly, the system also provided a rationale for these alternatives and noted how the excerpt could be interpreted differently depending on whether the researcher prioritized emotional experience or institutional context. The type of interaction was advantageous because it promoted reflection rather than acceptance of one interpretation right away.
The use of abductive reasoning was especially important at this stage. The agent was not programmed to regard coding as a static exercise in classification; it was programmed to respond when excerpts did not fit comfortably within the already established categories. In these cases the system tries to suggest other explanations or to recommend the researcher revisit the category boundaries. This behavior was very useful in the case of ambiguous or conflicting data segments, where purely deductive approaches tended to oversimplify the interpretation. In this sense, abduction was not added as a separate feature but was integrated bit by bit into the interaction logic of the system itself.
The agent was also designed to operate at different stages of the AbductivAI workflow, specifically in the phases of co-coding, category refinement, and analytical comparison. For example, in co-coding, the researcher and the agent can each analyze the same piece of text independently and then compare their interpretations. Disagreement between the human and the system often proved more analytically productive than agreement. These divergences sometimes resulted in deeper contemplation of category definitions and revealed implicit assumptions that would otherwise have remained hidden in several testing scenarios.
Another important aspect of the development process was to restrict the system’s authority. In some cases, the model generated outputs that seemed convincing even if contextually insensitive. We needed to instruct the agent to convey uncertainty when the data poorly supports interpretations. The adjustment may seem like a small change, but it significantly altered the tone of the exchange. The agent was less directive and more dialogical, more in line with the methodological principles discussed earlier in the article.
In terms of practicality, applying the system does not necessitate any high-level skills in programming. Researchers can relate to the system’s interface by inserting extracts, questions for analysis, goals of coding, or theoretical frameworks. The system responds based on the situation in the form of recommendations, explanations, comparisons, or even reflection questions. Nevertheless, during this whole process, it is the researcher who bears the responsibility of validation, category refinement, and interpretation of findings.
The one thing that emerged during the development of the agent is that its efficiency lies not so much in automation but in the quality of the interaction that will be created between the agent and the researcher. With a poor configuration of the system, the agent creates output that is surface-level and too generic. However, with the definition of prompts, a methodological approach, and analytical goals, the agent facilitates the interaction.
Generally, the Research Agent created for the purpose of this research is not to be taken as a tool designed to substitute qualitative analysis and its interpretation, nor an attempt to automate interpretation processes. Rather, the agent is a support methodological structure that is built within the framework of the analysis process itself. It contributes towards the achievement of reflexivity, transparency, and comparative analysis without taking the main task of interpreting away from the researcher. In this way, the Research Agent implements the key ideas of the AbductivAI approach not by substituting human decision-making but by facilitating interaction with an algorithmic system.
Final Considerations
Agentic AI is particularly effective in operational and analytical support tasks that do not compromise the researcher’s interpretative autonomy, or sovereignty, so to speak. These include proposing initial codes accompanied by explanations, identifying and tracking linguistic patterns, comparing different coding versions, generating theoretical memos, playing devil’s advocate by challenging assumptions, suggesting emerging categories, and detecting inconsistencies throughout the process. However, delegating certain tasks to the agent poses a risk of losing methodological rigor and human agency. These include the final decision on categories, replacing the researcher’s full reading of the data, resolving ambiguities without human consultation, inferring cultural meanings without validation, and formulating the final interpretation of the results. These restrictions are essential to ensure the preservation of human agency and are in line with the ethical and methodological principles highlighted in the AbductivAI article.
The recommended workflow, inspired by this same model, involves a sequence in which the human formulates the research question and establishes the theoretical framework, followed by the initial creation of categories in collaboration with AI. Subsequently, the researcher defines the coding guidelines, performs co-coding on a sample with the support of the agent, iteratively refines the categories and rules, and proceeds to complete coding, again in human-AI collaboration. Finally, the researcher is solely responsible for the final validation and interpretation of the results. Overall, the use of Agentic AI, as operationalised in Research Agent, allows for the amplification of human capabilities, the strengthening of reflexivity, the promotion of auditability, and the support of triangulation processes, while always keeping the researcher at the centre of decisions. Thus, and in full accordance with the AbductivAI model, AI assumes the role of a “disciplined co-thinker” in a performative way, but never that of an analytical authority.
Note: We acknowledge the use of ChatGPT as support for writing and rewriting content in this document. The use of these Generative AI models was intended solely to complement the author’s work, not to replace, at any time, my intellectual responsibility for the scientific and conceptual decisions made throughout the writing of the text.
References
Costa, A. P., Bryda, G., Christou, P. A., & Kasperiuniene, J. (2025). AI as a Co-researcher in the Qualitative Research Workflow: Transforming Human-AI Collaboration. International Journal of Qualitative Methods, 24. https://doi.org/10.1177/16094069251383739
Floridi, L. (2023). A Unified Framework of Ethical Principles for AI. In The Ethics of Artificial Intelligence (pp. 57–66). Oxford University PressOxford. https://doi.org/10.1093/oso/9780198883098.003.0004
Johnson, C. W., & Paulus, T. M. (2024). Generating a Reflexive AI-Assisted Workflow for Academic Writing. The Qualitative Report. https://doi.org/10.46743/2160-3715/2024.7634
Latour, B. (2005). Reassembling the Social. Oxford University PressOxford. https://doi.org/10.1093/oso/9780199256044.001.0001
Lockwood, A. (2024). Human vs. Machine: A Comparative Analysis of Qualitative Coding by Humans and ChatGPT-4. https://doi.org/10.31234/osf.io/8g36r
Orlikowski, W. J., & Scott, S. V. (2008). Sociomateriality: Challenging the separation of technology, work and organization. Academy of Management Annals, 2(1), 433–474.
Paulus, T. M., Pope, E. M., & Bower, K. L. (2025). Ways That Qualitative Researchers Engage in “Technological Reflexivity”: A Meta-Synthesis. Qualitative Inquiry, 31(3–4), 305–318. https://doi.org/10.1177/10778004241231927
Sarofim, M. (2024). Devil’s advocate: exploring the potential negative impacts of artificial intelligence on the field of surgery. Journal of Medical Artificial Intelligence, 7, 7. https://doi.org/10.21037/jmai-23-158