Empowering farmers with artificial intelligence: a retrieval-augmented generation based large language model advisory framework
TL;DR Highlight
A RAG advisory system for farmers compared four LLMs; Mistral and Qwen2.5 performed best.
Who Should Read
A backend developer building a RAG chatbot over domain manuals who must choose an open LLM
Core Mechanics
- A RAG advisory system built on crop guides
- It processes package-of-practices documents for maize, ragi, sweet potato, cotton and groundnut.
- It answers questions on pests, diseases and fertilizer using those documents.
- A standard RAG pipeline
- Documents are semantically chunked and embedded with Amazon Titan via BedrockEmbeddings.
- Chunks are indexed in ChromaDB, and the most similar ones go into a structured prompt.
- Four LLMs compared under the same setup
- Llama3.1, Mistral, Phi3 and Qwen2.5 were judged on retrieval, lexical overlap, semantics, attribution and speed.
- Mistral and Qwen2.5 came out on top
- The paper reports they led in relevance, semantic quality and efficiency.
- Beyond accuracy: attribution and latency
- An attribution score checks how well answers follow the source documents.
- Retrieval, generation and total time were measured separately.
Evidence
- Metrics fall into five groups
- Retrieval: precision@K, recall@K, MRR, NDCG.
- Lexical overlap: BLEU and ROUGE-1/2/L.
- Semantic quality used BERTScore and faithfulness
- BERTScore precision, recall and F1, plus semantic similarity and faithfulness.
- Four LLMs were compared
- Llama3.1, Mistral, Phi3 and Qwen2.5; Mistral and Qwen2.5 performed best.
- The abstract gives no concrete numbers.
How to Apply
- Compare four models on your own docs with one prompt
- Today, pull Mistral and Qwen2.5 via Ollama and feed both the same retrieved chunks and 20 questions.
- Manually check whether answers match the source documents.
- Evaluate retrieval and generation separately
- Measure retrieval with precision@K and MRR, and generation with faithfulness.
- Tell whether a bad answer comes from retrieval or the model.
- Measure how often answers cite source chunks
- Require chunk-number citations in the prompt.
- Track the share of cited answers as an attribution metric.
- Log retrieval and generation time separately
- Record retrieval time and generation time per request.
- Compare latency whenever you swap models.
Try It
# Paste into Claude or ChatGPT (simplified version of the paper's method: grounded answers with citation checks)
You are an agricultural advisor. Answer the question using only the [Document chunks] below.
Rules:
1. End each sentence with the supporting chunk number like [1].
2. If the documents lack the answer, reply "No support in documents".
3. At the end, list the cited numbers and check whether any claim is not supported by the documents.
[Document chunks]
{{retrieved chunks with numbers}}
[Question]
{{question}}Terminology
Related Papers
FutureBench: A Renewable Framework for Evaluating Knowledge-Context Conflict in LLMs
Adding 'verify and prioritize the passage' to RAG prompts raised false-passage adoption; a knowledge-priority warning fixed it.
Faster Retrieval for Better, More Efficient RAG
Small neural nets learned query routing, hitting the same recall up to 8x faster in IVF search
Memorilla: Latent Semantic Memory for LLMs
Compressing documents into 16 memory tokens beat full-context accuracy on FactKG.
What the Author Wrote, What the Agent Reads: Silent Cue Loss in Enterprise Document Ingestion
Preserving red text and highlights in docx ingestion lifted marked-requirement F1 from 0.150 to 0.690.
Multimodal Reranking Is a System One Decision
One multiple-choice question to a VLM over 16 candidates reranks them, beating a dedicated 2B reranker.
You could have invented transformers from memory
Viewing linear, MLP and attention layers as memory stores: capacity goes ~64 to ~2,700 to over a million
Pointing AI at archives found a forgotten meteorite, lost rhinos, and more
Embedding search plus a cheap filter model surfaced unrecorded events in 400 years of archives
EmbeddingGemma 2: An open, lightweight multimodal embedding model
One open 740M model embeds text, images, audio and video into a single shared vector space
Original Abstract (Expand)
This study presents a retrieval augmented generation (RAG) based system designed to provide farmers with expert agricultural advisory services. The framework delivers context aware guidance on critical practices such as crop cultivation, pest and disease management, fertilizer application, and other agronomic practices, and compares the performance of four large language models (LLMs) in generating these recommendations. The system processes package of practices (PoP) documents for five major crops maize, ragi, sweet potato, cotton, and groundnut through semantic chunking and embedding using Amazon Titan via BedrockEmbeddings. Vector representations are indexed in ChromaDB to enable efficient similarity search for query-relevant content retrieval. Upon receiving user queries, the system retrieves the most semantically similar document chunks and incorporates them into structured prompts. Four LLMs such as Llama3.1, Mistral, Phi3, and Qwen2.5 were evaluated for their effectiveness in generating accurate agricultural recommendations. Performance was evaluated across multiple dimensions. Relevance and retrieval were assessed using precision@K, recall@K, mean reciprocal rank (MRR), and normalized discounted cumulative gain (NDCG). Lexical overlap was measured with the bilingual evaluation understudy (BLEU) and recall-oriented understudy for gisting evaluation (ROUGE-1, ROUGE-2, ROUGE-L) metrics. Semantic quality was analyzed using Bidirectional Encoder Representations from transformers score (BERTScore) precision, recall, F1, semantic similarity and faithfulness to capture contextual alignment between generated and reference responses. Source attribution was assessed through the attribution score, while efficiency was measured using retrieval time, generation time, and total time. Overall, mistral and Qwen2.5 achieved the highest performance, demonstrating superior relevance, semantic quality, and efficiency. This evaluation highlights which LLMs perform best for the agricultural domain and illustrates the potential of knowledge-grounded AI systems to democratize agricultural expertise, particularly in regions with limited access to traditional advisory services.