/

Agricultural knowledge for sustainable farming is abundant but scattered, generic, and rarely actionable for the smallholder farmer who needs it most. The Omdena Lisbon, Portugal Chapter built a RAG-powered chatbot that retrieves verified agricultural knowledge and delivers personalized, real-time recommendations on crop selection, soil health, and irrigation. The project delivered a curated agricultural knowledge base, a retrieval-augmented chatbot pipeline, a user personalization system, and a web interface with a public API.
| Outcome | Detail |
| Knowledge Base | Agricultural data collected, cleaned, and stored in a vector database with semantic retrieval indexing |
| RAG Pipeline | LLM integrated with retrieval-augmented generation to deliver fact-grounded, hallucination-reduced responses |
| Personalization | User profile and session tracking system enabling recommendation refinement based on interaction history |
| API | REST API endpoint deployed to serve chatbot responses to external applications and integrations |
| Web Interface | Frontend application providing authenticated, user-friendly access to personalized farming guidance |
| Open Source | Full codebase released via OmdenaLore for replication and adaptation to other agricultural geographies |
Climate change, soil degradation, and water scarcity are making sustainable farming an urgent priority for landowners worldwide. Research institutions, agricultural extension services, and government bodies have produced vast bodies of knowledge covering crop selection, soil health, irrigation, and biodiversity practices. The problem is not a shortage of information.
The problem is access and relevance. Available resources are fragmented across academic papers, government portals, and regional extension documents. Generic guidance rarely accounts for a landowner’s specific soil type, climate zone, existing crop rotation, or water constraints. Field consultants can provide personalized advice, but they are expensive, geographically limited, and unavailable at the moment a farmer needs to make a decision.
This project was initiated and delivered by the Omdena Lisbon, Portugal Chapter, a local community of data scientists, NLP engineers, and machine learning practitioners who applied conversational AI to the challenge of making agricultural knowledge accessible. The team worked collaboratively across six weeks, coordinating through a shared repository and weekly deliverables.
The project operated as an open learning environment, with contributors ranging from early-career practitioners to experienced engineers mentoring on retrieval architecture and deployment. All code and notebooks were released as open-source output.

The team identified and collected high-quality agricultural data from reliable sources covering crop management, soil health, irrigation, and biodiversity practices. Raw data was cleaned, standardized, and formatted for embedding. Text was chunked into retrieval-sized segments, converted into vector embeddings, and stored in a vector database to support semantic similarity search at query time.
A retrieval-augmented generation pipeline was built around an LLM API. When a user submits a query, the system performs a semantic search to retrieve the most relevant knowledge chunks from the vector database, passing them as context to the language model. This generates responses grounded in retrieved content rather than the model’s pre-trained knowledge, reducing hallucination risk by anchoring outputs to verified source material.
A user management system was built to track profiles, session histories, and interaction patterns. Each user’s crop preferences, regional context, and past queries were stored and used to refine subsequent recommendations, shifting the chatbot from generic agricultural guidance toward advice calibrated to that user’s specific farming situation.
A REST API was developed to expose the chatbot as an accessible endpoint for external applications and agricultural platforms. A web frontend was built on top of the API, providing authenticated user access through a browser-based interface. The full system was deployed to cloud infrastructure and tested for response speed and concurrent load before release.
Before this project, a smallholder farmer or landowner seeking personalized guidance on sustainable practices had limited options: hire an agronomist, navigate fragmented online resources, or rely on informal local knowledge. None of these options provided instant, personalized, science-backed responses at the moment of need.
The delivered chatbot changed that equation. A farmer can describe their situation — soil type, region, current crops, water constraints — and receive tailored guidance on crop rotation, soil amendment, or irrigation scheduling without any prior technical knowledge or access to a specialist.
Because responses are grounded in verified agricultural sources rather than generalized model outputs, the system reduces the risk of incorrect advice on fertilizer rates or irrigation timing. The personalization layer adapts to each farmer’s context over time, making recommendations progressively more relevant with each session.
Improving the precision of the vector database retrieval step had a larger impact on response accuracy than switching to a more capable language model. When retrieved chunks matched the user query well, even a mid-tier LLM produced reliable, grounded responses — shifting the team’s focus toward embedding quality and chunking strategy rather than model selection.
Early iterations prioritized the personalization layer before the core retrieval pipeline was stable. Recommendations built on unreliable base responses compounded errors rather than improving them. The team learned to treat RAG pipeline accuracy as a prerequisite, ensuring general responses were grounded before layering in session-specific refinement.
Collecting and cleaning agricultural knowledge from heterogeneous sources took more time than any single engineering task. The quality of the knowledge base set the ceiling for every downstream component: retrieval, generation, and personalization all depended on well-structured source content. Future teams should budget significant time for curation before any modeling begins.
The team built and deployed a complete retrieval-augmented generation system connecting a curated agricultural knowledge base to an LLM API. The pipeline covered data collection, vector embedding, semantic retrieval, and response generation — anchoring outputs to retrieved source content rather than model-generated knowledge and reducing hallucination risk in a domain where incorrect guidance carries real consequences for crop health and soil.
The user management system moved the chatbot beyond static question-answering toward adaptive guidance. By tracking crop preferences, regional context, and conversation history, the system refined its recommendations with each session — becoming progressively more useful to returning users and demonstrating a personalization architecture transferable to other knowledge-intensive advisory domains.
By releasing all pipeline code and deployment configuration through OmdenaLore, Omdena’s open-source knowledge-sharing platform, the team produced a reusable starting point for any organization building agricultural advisory AI. The modular architecture separates knowledge base construction, retrieval, and frontend deployment into independent components, so future teams can adopt only the parts relevant to their use case.
The Omdena Lisbon, Portugal Chapter initiated this project to make personalized sustainable agriculture guidance accessible to landowners and smallholder farmers. A collaborative team of data scientists and NLP engineers built a retrieval-augmented generation pipeline combining a curated agricultural knowledge base, an LLM API, and a user personalization system, delivering a web-based chatbot and REST API as open-source output through OmdenaLore.