~/projects/local-agri-rag
Local RAG for Nepali Agricultural Statistics
A chatbot over Nepal’s government agriculture statistics that runs on a local model. Numerical questions are answered from database records and explanatory questions from document text.
- Status
- Completed
- Context
- AI internship, Pathway Technologies, 2026
- Type
- RAG · Local LLM

01Problem
Statistical reports hold precise figures inside complex tables. An answer is only useful if each number stays attached to its crop, location and year.
02What I built
- Routed numerical questions to exact SQL lookups and explanatory questions to semantic search.
- Ran Qwen2.5:7B locally through Ollama, with the orchestration written directly instead of through a high-level RAG framework.
- Added source-page citations, and a refusal response when an answer could not be verified.
- Wrote automated checks comparing figures across district, province and national levels.
03How it works
- Question
- Router
- SQL lookup / vector search
- Qwen2.5:7B (Ollama)
- Answer with citation, or refusal
04Decisions
| Decision | Why | Trade-off |
|---|---|---|
| Scoped to one government report | Keeping every figure tied to its crop, location and year needed manual table review. | Not a general PDF tool. |
| Separate routes for numbers and explanations | Exact SQL lookups for figures, semantic search for prose. | Adds a classification step before retrieval. |
| Orchestration written directly | Control over routing, citations and refusal behaviour. | More code to own than a framework. |
| Refuse when unverified | Avoids presenting figures the source does not support. | Some questions go unanswered. |
05Result
Outcome
A working local chatbot for one report. Narrowing the scope and keeping manual table review made the numbers dependable enough to build on.
Limitations
Works on one government report, so it is not a general PDF tool. Citations make answers traceable but do not guarantee they are correct.
Stack
PythonQwen2.5:7BOllamaDoclingSQLVector searchStreamlit
06Related writing
37 Days, One Stubborn PDF, and the AI Project That Almost Broke Me on Medium.