HumaraCart: A Collaborative Household Instamart Assistant

Swiggy Builders Club: Developer Program Application

Created At: 25 April, 2026
Last Edited At: 21 May, 2026
Submitted At: 27 April, 2026


The Problem

In a shared household, everyone has needs but no one has full visibility. Person 1 orders milk not knowing Person 2 already ordered it. Person 3 forgets to tell anyone they used the last of the detergent. Items get duplicated, items get missed, and the coordination happens after the fact.

The problem is not Instamart. The problem is there is no shared layer, no single view of what the household needs. Each person is ordering in isolation.


The Idea

Picture a WhatsApp group: three flatmates, one shared address. There is a fourth member in the group, HumaraCart, an AI agent.

Throughout the day, as people notice things running low, they just say it:

HumaraCart maintains a running cart for the household. No one has to remember. No one has to open Instamart. When the list feels ready, any member nudges the account holder. The account holder gets notified, opens Instamart, and places the order themselves. That is it.

This is the vision.


The Challenge

WhatsApp Business API does not natively support group bots. A bot cannot be added as a member of a WhatsApp group.


The Workaround

Each household member has a 1:1 conversation with the bot. On the backend, all members are mapped to a shared household group ID. Every addition is reflected in one unified list. Members who opt in receive the updated list after every addition.

The user experience is identical to the group vision. The difference is only under the hood. This approach works fully within the official WhatsApp Business API. No unofficial libraries. No ToS risk.


Why WhatsApp

WhatsApp is where Indian households already communicate. Any channel that requires a new app or a new habit creates drop-off before the product gets a chance. WhatsApp is not a technical convenience. It is where the user already is.


System Overview

flowchart LR
    subgraph Household
        AH[Account Holder]
        M1[Member 1]
        M2[Member 2]
        AH -->|invite link| M1 & M2
    end

    subgraph Swiggy
        Auth[OAuth Server]
        MCP[Instamart MCP Server]
        Cart[Instamart Cart]
    end

    AH -->|"① adds HumaraCart bot on WhatsApp"| Bot[HumaraCart Bot]
    M1 & M2 <-->|WhatsApp| Bot
    Bot <--> BE[Backend + AI Agent\nMCP Client]
    Bot -.->|"② sends Swiggy OAuth link"| AH
    AH -.->|"③ authorize"| Auth
    Auth <-.->|"④ code exchange → access token"| BE
    BE -.->|"⑤ authorization confirmed"| Bot
    Bot -.->|"⑥ setup complete"| AH
    BE <-->|MCP calls| MCP
    MCP <--> Cart

How It Works

Setup (done once by the account holder):

Day-to-day usage:

Ordering:

Household management:

Note: Member removal is acknowledged as a necessary feature but is beyond the scope of this demo. It will be addressed in V2.


Tech Stack

LayerChoice
BackendPython, FastAPI
Intent ClassificationLangChain (with_structured_output + Pydantic)
Agent OrchestrationLangGraph
LLMClaude Sonnet 4.6 (via ChatAnthropic)
MCP ClientSwiggy Instamart MCP (sandbox for V1; production for V2)
Swiggy APIsTBD. Depends on what is available and exposed (e.g. order tracking)
MessagingTwilio Sandbox for WhatsApp (V1); WhatsApp Business API (V2)
CacheRedis
DatabasePostgreSQL
ObservabilityLangSmith
InfrastructureDocker
HostingLocal for V1 (laptop + ngrok or cloudflared tunnelling the Twilio webhook); DigitalOcean for V2+

The backend acts as the MCP client, receiving WhatsApp messages, resolving household context, and making Instamart MCP tool calls to search products and manage the shared cart. LangChain classifies inbound messages into a typed Intent via structured-output parsing, so natural-language variants (“milk please”, “drop the detergent”) are recognised robustly. LangGraph orchestrates the stateful agent flows: routing intents to handler subgraphs, mutating cart state across nodes, and persisting via the write-through store.

Active cart state is managed using a write-through cache: every add/remove writes to both Redis and PostgreSQL simultaneously. Redis serves fast reads throughout the day; PostgreSQL is the durable backing store. At freeze, the cart is created on Instamart in a single update_cart call. Household data, member mappings, and brand preferences are persisted in PostgreSQL.


How We Plan to Use Swiggy Instamart MCP?

Our backend acts as the MCP Client. Cart creation and order management are driven by Instamart MCP tool calls.

Note: For a detailed step-by-step MCP tool call flow, see the sequence diagram here.

ToolTriggered WhenWhat It Enables
search_productsMember adds an itemFinds the right product on Instamart
update_cartAccount holder freezes the cartCreates the cart on Instamart using the item list built over WhatsApp. Incremental add/remove is unavailable per MCP docs. Cart state is owned by the backend throughout the day and synced to Instamart once at freeze
get_cartAfter update_cart succeeds at freezeFetches the confirmed cart state from Instamart to send as a summary to the account holder
checkoutV3: agent places order on household’s behalfUsed when auto-restock is enabled or account holder grants agent permission to order on approval
track_orderAfter order is placedFetches live order status for broadcast
get_ordersV2: purchase patternsEnables reorder reminders based on history

Confirmed: The Instamart MCP does not expose a shareable cart link. The account holder opens Instamart directly to check out. Their cart is already populated by the agent.


Security

Invite system Invite links are signed with a short-lived JWT encoding the household ID and an expiry. Tokens are single-use and tamper-proof. Expired or reused tokens are rejected.

Instamart OAuth The account holder links their Instamart account via OAuth. HumaraCart never handles credentials directly. It operates via an access token scoped to cart and order actions only.

Household isolation All household data is scoped to a group ID on the backend. No member can access or influence another household’s cart.

Cart control stays with the account holder The bot only builds the cart. Checkout is always a manual action by the account holder. In V1 and V2, no order is ever placed without explicit confirmation.


The Trust Arc

V1: Collaborative Cart Agent builds the cart from household inputs. Account holder reviews and checks out via Instamart. Trust is established.

V2: Household Intelligence

V3: Auto-Order (opt-in) Routine items can be set to auto-order for users who have explicitly granted the agent permission. Fully opt-in and item-specific.

Each stage earns the next. Trust is not assumed. It is built incrementally.


Why This Matters for Swiggy

Most Instamart use cases optimise for the individual user. HumaraCart treats the household as the unit, which is how grocery shopping actually works in India.

This is not a chatbot for Instamart. It is a new interface layer for how households shop.


Built on Swiggy Instamart MCP | Contact: mridubhatnagar