# _devjimah

- **Event:** [Meta Global AI Developer Hackathon](https://cerebralvalley.ai/e/meta-ai-developer-hackathon)
- **When:** Oct 26, 12:00 PM – Nov 4, 9:00 PM (EST)
- **Where:** Online
- **Team:** [Abraham Jimah Zorwi](https://cerebralvalley.ai/u/_devjimah)
- **GitHub:** https://github.com/devjimah/agritrade
- **Demo video:** https://youtu.be/I8AWm-TH2cE
- **Gallery:** https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery
- **Page:** https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3133

AgriTrade is a credit and inventory ledger for cereal traders in Ghana, upgraded with an AI assistant built on Meta's Muse Spark (muse-spark-1.3) that reads photographs of handwritten credit notebooks and turns them into verified, reviewable ledger proposals.

THE PROBLEM
In Ghana's grain markets, cereal traders run their entire business on credit from a paper notebook: cash advanced to smallholder farmers before planting, bags of maize or soya owed back at harvest, and buyers who take stock on credit and pay later. A single notebook holds tens of thousands of cedis in open balances. Paper notebooks get lost, torn, or miscalculated, and busy traders—many of whom prefer speaking or writing on paper over typing into forms, or who operate in Twi—do not have time for manual data entry.

However, letting an AI write directly to a financial and stock ledger is dangerous: one hallucinated name, misread digit, or prompt injection could corrupt real money and inventory balances.

THE SOLUTION
AgriTrade bridges the paper notebook and the digital ledger using a strict "Propose -> Review -> Confirm" architecture:

1. Notebook Photo Import (Vision + Tool Calling): A trader photographs a page of their handwritten notebook. Muse Spark reads each line, searches the real database for matching farmers, buyers, open advances, and credit sales, and creates structured proposals (advances, bag repayments, credit sales, cash payments, or new farmer/customer records). It skips crossed-out or illegible rows and asks clarifying questions when names are ambiguous (e.g., when three people are named "Efua").
2. Natural Language & Twi Chat: Traders can ask questions ("who owes me the most?", "what happened this week?") or log entries via text in English or Twi, backed by 19 read and propose tools.
3. Simple (Voice-First) Mode: For traders who aren't comfortable reading or typing, a full-screen mobile mode offers a single microphone button and reads responses aloud.
4. Safety by Architecture, Not Just Prompts: The AI has zero tools that write to the ledger or move stock. Its propose_* tools only create inert AiProposal records. Proposal cards display live database targets, the exact handwritten source row, the model's rationale ("Why:"), and confidence scores. Only when the trader taps Confirm does the server execute the transaction through existing ACID MongoDB transactions with idempotency locks.

In live testing against real handwritten pages, this triple-layer defense caught an overpayment three times (flagged by the model's confidence, warned on the review card, and blocked by the ledger service) and defeated prompt-injection attempts because no confirmation tool exists for the model to call.

## More from Meta Global AI Developer Hackathon

- [Team Promptimists](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3130)
- [EveryMuse](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3131)
- [Inkling](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3132)
- [Kerem Çebi](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3134)
- [ALMOST](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3135)
- [Carryover Labs](https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3136)

---

Markdown version of https://cerebralvalley.ai/e/meta-ai-developer-hackathon/hackathon/gallery/3133. Site index for agents: https://cerebralvalley.ai/llms.txt · full text: https://cerebralvalley.ai/llms-full.txt
