Inspiration Mid-market and regional commerce teams already collect rich behavioral data — page views, carts, purchases, returns, and support tickets — but a small ops, merchandising, and customer-success crew still runs the same weekly loop by hand: export CSVs, eyeball charts, guess at risk, draft reorders or retention outreach, then wait days before the next review. Every day inside that gap is a day of decisions made blind, and the cost shows up as overstock, silent churn, and prices that trail the market. We found NeuroX 1.0 on Devpost and it stood out because it rewards design maturity — reasoning loops, failure handling, and a real human control point — before production polish. That matched how we believe agentic commerce software should ship: never autonomous over money without sign-off. Lankara was born from that gap — from dashboards that only describe to an agent that decides, with a human always holding the final word.
What it does Lankara is an autonomous decision-intelligence agent that sits inside a B2B commerce platform and does the judgment-intensive analytical work ops teams currently do manually. Given a high-level goal — protect revenue, cut churn, optimize stock — it perceives the live behavioral event stream, plans which analytics tools to run, reasons over the combined evidence, and proposes a concrete, evidence-backed action. Nothing executes without a human decision at the Approval Queue.
From the merchant’s point of view, it continuously answers four high-stakes questions with evidence attached every time:
What to stock — which SKUs to reorder, and in what quantity, from live demand forecasting What to discount — which categories or SKUs are lagging and need a price or promotion change What to bundle — which products co-occur enough to justify a bundle or cross-sell Which customers to retain — which high-value accounts show early churn signals It operates entirely on the merchant side (customer success & retention, financial ops & reporting, procurement & vendor management) — never consumer-facing, never IoT. The storefront also acts as a sensor network (conversational, voice, and visual search in Sinhala, Tamil, and English), streaming structured events into Postgres so the agent gets smarter with every session.
How we built it We designed Lankara as a modular, failure-tolerant system around a LangGraph orchestrator that perceives, plans, reasons, and proposes — choosing tools at runtime rather than following a fixed script.
Agentic loop: GOAL → PERCEIVE → PLAN → REASON → PROPOSE Example: "Protect revenue in the Kandy region this month" → read the last 30 days of views, carts, orders, and tickets → plan churn scoring then segmentation → attach confidence → draft a retention campaign into the Approval Queue.
Architecture layers: presentation (storefront + Approval Queue), agent core (LangGraph), service microservices, Postgres event store, and shared ML/ops (retries, confidence scoring).
Five external tools the agent can select dynamically:
Tool Role Analytics pipelines API RFM + clustering, churn (gradient boosting), demand forecasting (SARIMA / LightGBM), basket mining (FP-Growth) Hybrid recommender (FastAPI) Collaborative + content + session signals for bundles / cross-sell Vector DB (CLIP) Visual product search / substitutes Whisper STT + NLLB Voice and multilingual goals (Sinhala, Tamil, English) Postgres event store Live behavioral stream for every loop HITL: draft → review (approve / edit / reject) → execute only after sign-off. Every override becomes preference-memory feedback so future proposals improve without ever skipping review.
Phase 2 build path: de-risked on public datasets (RetailRocket, Online Retail II, Instacart, H&M) across four sprints — event store + analytics → LangGraph tool-calling → Approval Queue → end-to-end eval — so the reasoning loop and human control point exist before any single model is optimized.
Challenges we ran into Ambiguous goals — prompts like "sales look weak" have no single correct rule. We taught the agent to either ask one targeted clarifying question or scope itself and state assumptions up front, always keeping those assumptions visible in the evidence pack. Sparse / cold-start data — new merchants lack history for confident proposals. Mitigation: blend collaborative signal with content- and session-based recommendation until enough history accumulates. Tool failures mid-loop — a brittle script would invent numbers or fail silently. We enforce a strict degradation order: retry → fall back → degrade with lower confidence → block with a clear reason — never invent. Over-trusting a single tool — the reason stage cross-checks outputs; disagreement lowers confidence before a proposal is emitted. Reviewer fatigue — rubber-stamping would defeat HITL. Evidence packs are ranked by materiality so low-impact items can batch-review while high-impact actions (price, inventory, outreach) cannot. Multilingual misreads — STT/translation errors could wrong-scope an analysis; assumptions are always stated so a misread is caught before execution. Accomplishments that we're proud of A design-first agentic loop that chooses tools at runtime — not a hard-coded pipeline dressed up as an agent. Five integrated external tools (beyond the three NeuroX requires), all genuinely optional at plan time. A real Approval Queue, not a cosmetic confirm button: price, inventory, and retention actions always need human sign-off; edits (change segment, shrink discount, delay send, swap SKUs, block channel) are first-class. Every proposal ships with its evidence pack: chart + model confidence + exact data slice — no black box. Graceful degradation that never invents numbers, and multilingual ops for Sinhala, Tamil, and English markets mainstream platforms often ignore. A Phase 2 plan that front-loads the parts hardest to fake in a demo: ambiguity handling, tool-failure recovery, and a genuine approval gate. What we learned NeuroX’s scoring rubric pushed us to think far more rigorously about ambiguity and graceful degradation than a typical hackathon timeline allows. We learned that the hard problem isn’t “more dashboards” — it’s continuous analysis with bounded, explainable decisions; that modular microservices behind an orchestrator let one tool fail without taking the whole loop down; and that HITL works only when evidence is ranked and overrides become learning signals. Quantitatively, we framed success with offline metrics such as $\mathrm{Recall}@K$ for recommendations, $\mathrm{MAPE}$ for demand forecasts, precision for churn scoring, and support/confidence lift for basket mining — so every component is measurable, not anecdotal.
What's next for TerraBytes Phase 2 executes the four-sprint plan against public datasets while the storefront’s own event stream accumulates: stand up Postgres + analytics pipelines, wire LangGraph tool-calling, ship the Approval Queue, then run unscripted end-to-end evaluation on ambiguous inputs, tool failures, and proposal quality. Beyond that, we aim to compound accuracy from every human approve/edit/reject, tighten cold-start behavior for new merchants, and demo the simple bar that is hard to fake: a goal in → tool calls reasoned by the agent itself → an evidence-backed action awaiting one human click.
Built With
- agents
- ai
- clip
- fastapi
- fp-growth
- gradient-boosting
- human-in-the-loop
- langchain
- langgraph
- lightgbm
- machine-learning
- microservices
- nllb
- postgresql
- python
- sarima
- vector-database
- whisper
Log in or sign up for Devpost to join the conversation.