System architecture

AI can reason about commerce. It cannot authorize commerce.

Amana places a deterministic authority layer between AI reasoning, merchant systems, and Razorpay.

AI handles unstructured meaning and planning. Deterministic software controls truth, authority, and money.

30-second system view

Reasoning above. Authority below.

AI / untrustedDeterministic authorityExternal authority
AI / UNTRUSTED REASONING
Gemini

Interpretation + bounded planning

Buyer intent · vision · realtime voice / conversation · merchant-interface reasoning

Produces language, observations, candidate choices, and plans—not authority.
TRUST BOUNDARYAI output becomes input, never authorityUNTRUSTED OUTPUT ↓ VALIDATED APPLICATION INPUT
BOUNDED UNTRUSTED APPLICATION INPUT

TWO P0 RUNTIME COMMERCE AGENTS

AGENT 01

Safe AI Buyer

Intent → grounded product → proposal → authorization → payment

Guides the buyer journey; it does not grant authority.STRUCTURED INTENT TO CONTROL PLANE
AGENT 02

Merchant Agentization Agent

Inspect → map → test → evidence → readiness

Proposes mappings and repairs; it does not publish readiness.BOUNDED PLAN TO CONTROL PLANE
DETERMINISTIC AUTHORITY

Application code

Deterministic Commerce Control Plane

Every material transition is typed, validated, evidence-bound, and fail-closed.

Catalogue & policy

Product grounding · policy evaluation

Proposal & authority

Material hash · actor-bound approval

Evidence & readiness

Contract evidence · readiness reducer

01TransactionProposal
02AuthorizationDecision
03Execution
VALIDATED DETERMINISTIC AUTHORITY
FINAL REVALIDATIONExecution GateExactly one execution per proposal · at most one provider order
VALIDATED EXECUTION
PAYMENT PROVIDER

Razorpay Test Mode

Checkout; returns provider evidence only

PROVIDER EVIDENCECallback · webhook · API
DETERMINISTIC REDUCTION

Reconciliation

Exact merchant/account · order · amount · INR · captured payment · paid order

VERIFIED OUTCOME

Fulfilment / Refunds

Durable outbox · stable refund idempotency · bounded accounting

Gemini supplies bounded untrusted application input across the trust boundary. Both commerce agents and approved merchant interfaces feed the same deterministic control plane. Only the Execution Gate can advance to Razorpay; PostgreSQL is shared authority, not a payment step.

Authority details

Three transitions reviewers should remember.

01 / MERCHANT READINESS

Suggestions become evidence, then readiness.

  1. Approved merchant interface
  2. AI-assisted inspection / mapping
  3. Contract tests + evidence
  4. Merchant approval where required
  5. Deterministic readiness reducer
  6. Agent Commerce Manifest

The model may suggest a mapping or repair. Only deterministic logic may publish readiness.

02 / TRANSACTION AUTHORITY

Intent becomes narrow, explicit authority.

  1. TransactionProposalImmutable material intent
  2. AuthorizationDecisionApproval bound to proposal, hash, session, action, actor, and expiry
  3. ExecutionDeterministic revalidation and stable idempotent execution
03 / PAYMENT TRUTH

Provider evidence becomes a verified outcome.

  1. Checkout / callback
  2. Evidence
  3. Webhook / API reconciliation
  4. Deterministic payment reducer
  5. PAYMENT_CONFIRMED

Browser callbacks are evidence, not payment truth.

Operating principle

Useful intelligence. Narrow authority.

01

AI is useful, but untrusted

Model outputs become structured hypotheses, intent, observations, or bounded plans. They are validated before use.

02

Authority is deterministic

Application code owns grounding, readiness, policy, proposal hashing, authorization, and execution.

03

Payment truth comes from evidence

Callback, webhook, and provider API evidence is reduced against exact bindings before confirmation.

Explore the system

Move from the map to the working surfaces.