Serverless AI Agricultural Advisory System using AWS Lambda, Bedrock, DynamoDB and RAG
Shamba AI — AI-Powered Agricultural Advisory System for Smallholder Farmers
# Overview
Shamba AI is a serverless agricultural advisory platform built on AWS that helps smallholder farmers access fast, practical, and affordable farming advice using Artificial Intelligence.
The system combines Generative AI, Retrieval-Augumented Generation (RAG) , Conversation memory, Knowledge-base retrieval and Serverless cloud architecture to deliver context aware agricultural recommendations in real time.
The goal is to make reliable farming knowledge accessible to farmers who may not have immediate access to agronomists or extension officers.
This Project Matters because Agriculture supports millions of livelihoods across Kenya yet many farmers lack access to timely agricultural guidanceand can't afford professional consultancy services.
Shamba AI addresses this challenge by providing:
- Instant farming advice
- Context-aware conversations
- Knowledge-grounded responses
- Low-cost scalable infrastructure
- Cloud-native automation
The system is designed to support farmers using simple interfaces such as SMS and mobile applications.
# Architecture Overview
Shamba AI is built using a fully serverless AWS architecture.
AWS Services Used;
Amazon API Gateway — Receives incoming farmer requests
AWS Lambda — Handles application logic
Amazon DynamoDB — Stores conversation memory
Amazon Bedrock — Generates AI responses using Claude 3 Haiku
Amazon Bedrock Knowledge Base — Provides Retrieval-Augmented Generation (RAG)
Amazon S3 — Stores agricultural documents and datasets
Amazon CloudWatch — Logging, monitoring, observability, and cost awareness
# How the System Works;
Farmer sends a question through API Gateway
AWS Lambda receives the request
Conversation history is retrieved from DynamoDB
Lambda builds a context-aware prompt
Amazon Bedrock Knowledge Base retrieves relevant agricultural information
Claude 3 Haiku generates the response
If retrieval fails, fallback logic invokes the …