Large language models and retrieval-augmented generation (RAG) are widely applied in knowledge question-answering tasks. However, in knowledge-intensive domains such as agriculture, hallucination and insufficient retrieval accuracy remain challenging. To address these issues, we propose Sem-RAG, a corn planting knowledge question-answering algorithm based on fine-grained semantic retrieval enhancement. Unlike standard NaiveRAG, which retrieves only fixed-length text chunks, and GraphRAG, which relies solely on graph node connections, Sem-RAG introduces a dual-store retrieval mechanism. It constructs both a surface semantic store (chunk-level embeddings) and a fine-grained semantic store derived from Leiden-based community summaries. These community summaries do not merely shorten contexts; instead, they provide thematic-level semantic aggregation across document chunks, thereby enhancing semantic coverage and reducing noise. During retrieval, user queries are matched against the surface store to locate relevant chunks and simultaneously linked to corresponding thematic summaries in the fine-grained store, ensuring that both local details and higher-level associations are leveraged. We evaluated Sem-RAG on the corn knowledge question-answering dataset CornData. The algorithm achieved Answer-C, Answer-R, and CR scores of 94.6%, 84.6%, and 70.4%, respectively, which were 2.6%, 1.7%, and 1.6% higher than those of traditional NaiveRAG. These results demonstrate that Sem-RAG materially improves the quality and reliability of agricultural knowledge Q&A by combining dual-store retrieval with community-level semantic aggregation.
The identification of cotton diseases and pests is crucial for maintaining cotton yield and quality. However, conventional manual methods are inefficient and prone to high error rates, limiting their practicality in real-world agricultural scenarios. Furthermore, Convolutional Neural Network–Long Short-Term Memory (CNN-LSTM) models are insufficient in generating fine-grained and semantically rich image captions, particularly for complex disease and pest features. To overcome these challenges, we introduce CottonCapT6, a novel multi-task image captioning framework based on the Cross Vision Transformer (CrossViT-18-Dagger-408) and Text-to-Text Transfer Transformer (T5). We also construct a new dataset containing annotated images of seven common cotton diseases and pests to support this work. Experimental results demonstrate that CottonCapT6 achieves a Consensus-based Image Captioning Evaluation (CIDEr) score of 197.2% on the captioning task, demonstrating outstanding performance. Notably, the framework excels in providing more descriptive, coherent, and contextually accurate captions. This approach has strong potential to be deployed in cotton farms in the future, helping pest control personnel and farmers make precise judgments on cotton diseases and pests. However, its generalizability to other crops and environmental conditions remains an area for future exploration.
As one of the world’s leading cotton-producing countries, China frequently experiences severe yield reductions due to crop diseases and pest infestations, with losses often exceeding 20%. Although computer vision models can identify diseased plants, they currently fail to connect visual symptoms to the diagnostic reasoning process used by agronomists. This leads to text descriptions that ignore the biological causes of the damage. To fix this, we built Multimodal Knowledge Graph-Enhanced Cross Vision Transformer-18-Dagger-408 and Text-to-Text Transfer Transformer for Cotton Disease and Pest Image Captioning (MKG-CottonCapT6), a model that uses a local knowledge database to generate professional diagnostic reports from field images. The technical core consists of a Multimodal Knowledge Graph (MMKG) containing 14 types of entities (such as Pathogens and Control Agents) and 12 types of relations. We use a Cross Vision-Transformer-18-Dagger-408 (CrossViT) encoder to capture both the overall leaf shape and microscopic details of pests. Through a Visual Entity Grounding (VEG) module, the model maps visual features directly to specific triplets in the graph. These triplets are then turned into text sequences and fused with image data in a Text-to-Text-Transfer-Transformer (T5) decoder. To train the model, we collected a dataset of cotton images paired with expert descriptions of lesions, colors, and affected plant parts. Tests show that MKG-CottonCapT6 performs better than standard models, reaching an Information-based Metric for Image Captioning (InfoMetIC) score of 72.6%. Results prove that by using a specific alignment loss (), the model generates reports that correctly name the disease stage and recommend specific chemicals, such as Carbendazim or Triadimefon. This framework provides a practical tool for farmers to record and treat cotton diseases with high precision.
Complex agricultural question answering often requires multi-step reasoning over domain-specific knowledge and reliable retrieval of heterogeneous evidence. However, existing retrieval-augmented generation (RAG) methods usually rely on one-shot retrieval and provide limited control over whether the retrieved evidence is sufficient, accurate, and consistent for answering complex agricultural questions. To address this limitation, this paper proposes an agent-driven question-answering framework for the agricultural planting domain based on a Planning–Execution–Feedback (PEF) closed-loop mechanism. The framework decomposes complex queries into executable subtasks, performs knowledge acquisition through a knowledge-graph-guided hybrid retrieval module, and iteratively refines the reasoning process according to retrieval-quality feedback. Specifically, in the retrieval stage, a two-stage strategy is introduced to first localize candidate entities in the knowledge graph and then conduct context-enhanced dense retrieval with entity-consistency reranking, thereby reducing semantic drift and improving domain alignment. In the feedback stage, the agent evaluates the adequacy of the retrieved evidence and determines whether to continue execution, re-retrieve evidence, or replan the workflow. Experimental results on the AgroQA dataset show that the proposed method achieves 88.9%, 79.1%, and 92.6% on the Answer-C, Answer-R, and CR metrics, respectively, outperforming traditional retrieval-augmented and general large language model baselines. In addition, a three-dimensional digital human interface is implemented as an application prototype to demonstrate the feasibility of integrating the proposed framework into interactive agricultural knowledge services.