iTrace: agentic product trust for Kenya
Inspiration
I was watching a fitness video from the US where the creator simply read the calories off a food label and trusted it. In Kenya we can't do that. We often can't even be sure the pack is genuine. The Anti-Counterfeit Authority estimates that illicit trade costs Kenya about KSh 800 billion a year (roughly 9% of GDP), that 1 in 5 products on the market is counterfeit, and that KSh 153bn in tax and 44,000 jobs are lost every year. Shoppers can't tell what's real, and brands can't see where fakes are taking their market.
What it does
iTrace is a product-trust network with two sides:
- Shoppers type or scan a product code. Three AI agents walk a graph of brands, batches, unit codes, past scans, regions and shopper reports, and return a verdict with evidence:
- verified;
- suspicious, e.g. "scanned in Mombasa then Kisumu, 699 km apart, 18 minutes apart: this code has been cloned";
- recalled;
- unknown.
The shopper also sees the product's nutrition facts and gets a one-tap, pre-written SMS to the right regulator: KEBS 20023, KEPHIS 1393, the Pharmacy and Poisons Board register, KRA Soma Label, or ACA. No account is needed.
- Brands sign in to a dashboard with a counterfeit heat map of Kenya, the share of scans failing verification per region, and the estimated monthly leakage in shillings. An agent proposes actions (field audits, retailer alerts, time-limited promotions) and nothing runs until a human approves. Brands can push batches and scans from their ERP and POS through a REST API.
Every scan feeds the graph, so the network gets smarter even for brands that haven't joined yet.
How we built it with Jac and Jaseci
- Object-Spatial Programming: the whole domain is a Jac graph.
Brand → Product → Batch → Unitforms the supply chain,Trace → Scan → Region(with a typedScannedInedge) forms the crowd network, andReport,ActionandAccountnodes complete it. Everything persists natively onroot.shared, with no external database. - Walkers as agents:
RegistryWalkerwalks the supply chain, skipping product lines that can't match.CrowdWalkerrebuilds a code's scan history and detects impossible travel.SupplyWalkercollects a brand's genuine codes for market analysis.
- byLLM:
investigate(...) by agent_llm(tools=[lookup_registry, crowd_history, official_channels])is a ReAct agent that chooses its own tools and returns a typedInvestigationobject.propose_actions(...) by agent_llm()returns typedProposedActions.- Prompts are written with
sem. - Users bring their own key (Gemini free tier by default; any LiteLLM model works). The key lives only in their browser.
- Safety rails: the LLM can never upgrade a recalled or cloned item to "verified". Regulator shortcodes come from verified tool data, never from the model. Every agent has a deterministic fallback, so the app works with no key.
- Auto-generated REST API:
walker:pub register_batchandwalker:pub ingest_scanare the brand integration endpoints.def:pubfunctions are typed RPCs for the UI. - Full-stack Jac client: the entire UI is written in Jac (
.cl.jac). That includes the animated particle-stream hero, ported from a canvas prototype into Jac. About 94% of the codebase is Jac.
Challenges we ran into
- Jac versions: our template targeted an older Jac. We migrated it to the workspace jacs conventions. Deploying on jachammer no longer had build errors but it still failed deploying because of timeline issues.
- Multi-user permissions: writes from authenticated users onto the public commons root are denied by Jaseci's access model. We stored brand accounts (salted PBKDF2 hashes and session tokens) on the commons graph instead, so shoppers and brand managers share one consistent trust network.
- Honesty about evidence: a code match doesn't prove a physical item is genuine, and none of Kenya's verification channels has a public API. We designed the agents to say what they know, say what they don't, and route people to the authority.
Accomplishments we're proud of
- An agent trace that makes the reasoning visible: you can watch walkers and tool calls happen.
- Catching cloned codes through impossible-travel detection across the crowd network.
- One graph serving both shoppers and brands, with human-in-the-loop business actions.
What we learned
Modelling the problem as a graph made the agents simple: walkers carry the evidence-gathering, and byLLM turns that evidence into typed decisions. Building the deterministic fallback first made the AI layer safe to add.
What's next
- QR camera scanning.
- Automatic SMS checks through a gateway such as Africa's Talking.
- Approved promotions pushed to retailer POS.
- Aggregating verified nutrition data into Kenya's first map of eating patterns, as public-health data in a country where lifestyle diseases cause over 40% of deaths.
Built with
Jac · Jaseci (jac-client, jac-scale) · byLLM · LiteLLM · Gemini · React (via Jac client) · Tailwind CSS
Built With
- api
- graph
- jac
- jaseci