Inspiration

The idea started with a simple farming problem: sometimes you have a crop in front of you, something looks wrong, and there is nobody to ask.

We experienced this ourselves when we planted apples. There were moments when we needed a simple answer, but the internet connection was unreliable and finding someone with the right agricultural knowledge was not always easy. You can look at a plant changing over a few days and know something is wrong, but knowing what to do next is a different problem.

We started thinking about farmers facing the same situation every day. An extension officer may be far away, mobile data may be unreliable, and searching online for an answer may not be practical when you are standing in the field.

That led us to one question:

Can useful agricultural AI work even when the internet doesn't?

That became ShambaIQ.

What it does

ShambaIQ is an on-device agricultural AI assistant for farmers and extension officers.

A farmer can ask questions about crops and get practical guidance from agricultural knowledge stored locally on the device. It can work without relying on a cloud AI API or a continuous internet connection.

ShambaIQ also supports English and Kiswahili because agricultural advice is more useful when people can ask questions in a language they are comfortable with.

The system uses retrieval-augmented generation (RAG) so answers are grounded in a local collection of agricultural guides rather than asking a language model to simply guess.

We also make an important distinction between information that is available offline and information that requires a live connection. We don't want the system inventing weather, prices, or other information it does not actually have.

How we built it

We built ShambaIQ as a fully local application using Python, a lightweight local language model, and a local RAG pipeline.

The application consists of:

  • A lightweight web interface for asking crop questions
  • A local Python API
  • A local language model running through Ollama
  • A RAG pipeline for retrieving relevant agricultural guidance
  • A local document corpus containing agricultural resources
  • English and Kiswahili language handling
  • An offline-first service worker and cached frontend

Our knowledge base includes agricultural material from sources such as KALRO, FAO, ILRI and agricultural weather resources.

The most important design constraint was the hardware. We did not want to build something that only works on a powerful development machine. The challenge is designed around an 8 GB RAM laptop with integrated graphics, so we have been profiling memory usage and throughput and optimizing the system around commodity hardware.

The result is a system where the model, retrieval pipeline and agricultural knowledge can all run locally without sending a farmer's question to a cloud AI service.

Challenges we ran into

The biggest challenge was getting useful AI to run within tight hardware limits.

A model that feels fast on a modern development machine can behave very differently on an 8 GB laptop. Memory usage, model size, retrieval overhead and inference speed all matter.

We also had to deal with the practical challenges of building an offline application: caching, local model availability, document retrieval and making sure the interface still behaves correctly when there is no network connection.

Language was another challenge. Translating agricultural terminology into Kiswahili is not simply a matter of translating individual words. The answer still needs to sound natural and remain agriculturally useful.

Finally, we had to balance accuracy with speed. A larger model may produce better answers, but if it is too slow or consumes too much memory, it is not useful on the hardware we are targeting.

Accomplishments that we're proud of

We are proud that ShambaIQ can provide agricultural guidance using a completely local AI pipeline instead of depending on a cloud API.

We are especially proud of combining:

  • Local language-model inference
  • RAG over agricultural knowledge
  • Offline-first application design
  • Kiswahili support
  • Source-aware answers
  • A practical African agriculture use case

We also built the system around measurable constraints rather than assuming that "local AI" automatically means efficient. We are using the ADTC profiler to measure throughput, memory usage and thermal behaviour on the target class of hardware.

Most importantly, we built ShambaIQ around a problem we understand: getting useful agricultural information when connectivity, money, or access to an expert cannot be taken for granted.

What we learned

We learned that building AI for constrained hardware requires thinking about the entire system, not just the model.

Model selection, quantization, retrieval, document size, prompts, memory usage and application design all affect the final experience.

We also learned that offline AI is not simply a smaller version of cloud AI. The constraints force you to be much more deliberate about what information you keep locally, what the model needs to know, and what should only be provided when a connection is available.

Most importantly, we learned that a technically impressive model is not enough. For an agricultural assistant, the answer has to be understandable, practical and trustworthy.

What's next for ShambaIQ

The next step is to improve the model's agricultural accuracy and Kiswahili responses while continuing to reduce memory usage and improve inference speed.

We want to expand the local agricultural knowledge base, improve support for more crops and livestock, and eventually support additional African languages.

We also want to make ShambaIQ more useful beyond a laptop — including lightweight pathways through USSD, SMS and other low-bandwidth interfaces.

Our long-term goal is simple:

Make useful agricultural intelligence available wherever a farmer needs it, not only where there is a good internet connection.

Built With

Share this project:

Updates