Architecture & AI models
How the platform is built
Connect
StorefrontsShopify · WooCommerce
MarketplacesAmazon · Flipkart · Meesho (CSV)
LogisticsShiprocket · couriers
Files & APICSV import · REST API
Commerce Graph
Canonical data modelProducts ↔ listings ↔ orders ↔ shipments ↔ returns, per organisation
Event & audit streamWebhooks, sync jobs, audit log
AI engines
Commerce Vision AIVLM attribute extraction, embeddings
Catalog IntelligenceGeneration, scoring, claim guard
Demand IntelligenceProbabilistic forecasting
Commerce Risk AIExplainable RTO risk
Commerce AnalyticsMargin-correct measures
Agent runtime
PlannerObjective → task plan
Policy engineT0–T3 tiers, approvals
Tool gatewayTyped, idempotent, tenant-scoped
Execution ledgerHash-chained, verifiable
Inference
Provider adaptersNVIDIA NIM · OpenAI-compatible · Triton (KServe v2)
Baseline enginesBuilt-in deterministic models — always available
Dashed boxes mark workloads designed for GPU-accelerated inference. GPU services are deployed independently and connected through server-side configuration; none are connected in this deployment unless shown as configured in the app.
Application
- Web & API: Next.js (App Router) with React and TypeScript. Route handlers under
/apishare one request wrapper for authentication, RBAC, rate limiting, CSRF origin checks, JSON-schema validation and error handling. - Database: SQLite via Node’s built-in driver for development and single-node deployments; schema and migrations are portable to PostgreSQL (DDL with row-level security provided in
db/postgres). - Object storage: local directory per organisation in this version; S3-compatible storage for production.
- Background work: a worker process runs scheduled workflows (
npm run worker).
Tenant isolation
Every tenant-owned row has org_id. Organisation context comes only from the session (membership-checked) or the API key — never from request bodies. All data access functions take the organisation as their first argument and bind it in every query. Tests assert cross-organisation reads return 404.
Engines and provider adapters
| Interface | Built-in implementation | Pluggable providers |
|---|---|---|
| Multimodal inference / product understanding | Pixel metrics, keyword classifier, colour naming | NVIDIA NIM (OpenAI-compatible chat with image input) |
| Text generation (catalog) | Grounded template generator + claim guard | NVIDIA NIM, any OpenAI-compatible endpoint (vLLM, TGI…) |
| Embeddings / matching | Perceptual hash + feature-hashed text vectors | Triton Inference Server (KServe v2 HTTP) |
| Predictive inference | Statistical forecaster; logistic risk baseline | Triton (planned for trained models) |
| Agent orchestration | Rule-based planner + policy runtime | LLM planner (planned) behind the same policy layer |
| Response evaluation | Schema validation, banned-claim guard, listing scorer | Offline evaluation sets (planned) |
Configuring AI providers
Keys are read only on the server. They are never sent to the browser and never logged. The app shows a provider as “configured” when its variables are set and “verified” only after a successful call.
# NVIDIA NIM — hosted (build.nvidia.com) or self-hosted container NIM_BASE_URL=https://integrate.api.nvidia.com/v1 NVIDIA_API_KEY=nvapi-... NIM_VISION_MODEL=<vision-language model id> NIM_TEXT_MODEL=<instruction model id> # Any OpenAI-compatible endpoint (e.g. vLLM on your own GPU) OPENAI_COMPAT_BASE_URL=http://gpu-host:8000/v1 OPENAI_COMPAT_API_KEY=... OPENAI_COMPAT_TEXT_MODEL=<model id> # NVIDIA Triton (KServe v2): model with BYTES input "text" and FP32 output TRITON_URL=http://triton:8000 TRITON_EMBEDDING_MODEL=text_embedder
GPU inference services are deployed independently of the web application (separate host or Kubernetes node pool) and reached over the network, so they can scale to zero when idle.
Agent runtime
- Tool registry: each tool has an owning agent, a tier (T0–T3) and an optional external provider.
- Policy: T0/T1 run automatically; T2 runs automatically only if the agent’s policy is “auto-run reversible”; T3 always creates an approval (admin/owner).
- Execution: tasks are persisted with status, attempts, duration and an idempotency key (unique per organisation).
- Ledger: every event is stored with
hash = SHA-256(prev_hash | kind | run | task | payload | time).GET /api/agents/ledger/verifyrecomputes the chain.