AgentCart is an AI-powered shopping application that enables users to make purchases through natural-language requests while maintaining control over their spending.
It combines AI-assisted product discovery, retailer trust checks, backend-enforced spending policies, human approval workflows, and PayPal checkout to make autonomous shopping safer and more transparent.
The core idea: Let AI shop for you, but never let it spend beyond the rules you set.
-
AI-Powered Shopping: Interpret natural-language shopping requests using Groq, with Gemini fallback.
-
Product Discovery: Search for products through the Channel3 API.
-
Spending Policy Engine: Enforce monthly and per-transaction spending limits.
-
Purchase Decisions: Automatically classify purchases as
ALLOWED,NEEDS_APPROVAL, orBLOCKED. -
Retailer Trust Checks: Identify unrecognized retailers and request user acknowledgment.
-
Human-in-the-Loop Approval: Require explicit approval for purchases exceeding transaction limits.
-
PayPal Integration: Create PayPal Sandbox orders and capture payments after buyer authorization.
-
Transaction History: Maintain persistent purchase records using Turso.
-
Dashboard: Monitor spending, pending approvals, and blocked transactions.
AgentCart uses a full-stack architecture in which the frontend communicates with a backend API that coordinates AI interpretation, product discovery, spending policy enforcement, and payment processing.
| Component | Technology | Responsibility |
|---|---|---|
| Frontend | React + Vite | Shopping interface, dashboard, spending rules and approvals |
| Backend | Node.js + Express | API endpoints and purchase orchestration |
| AI Layer | Groq + Gemini | Interpret natural-language shopping requests |
| Product Discovery | Channel3 API | Search and retrieve product information |
| Policy Engine | Custom JavaScript | Evaluate budgets and purchase permissions |
| Payment | PayPal REST API | Create orders and capture payments after buyer authorization |
| Database | Turso | Persist spending rules and transaction records |
| Deployment | Vercel + Render | Host frontend and backend |
- The user enters a natural-language shopping request.
- The AI layer interprets the request and extracts shopping preferences.
- Channel3 retrieves matching products and offer information.
- The backend checks product availability, retailer trust and spending rules.
- AgentCart classifies the purchase:
ALLOWED— proceed to PayPal checkout.NEEDS_APPROVAL— pause checkout and require explicit user approval before creating the PayPal order.BLOCKED— prevent the purchase.
- For approved purchases, the backend creates a PayPal order.
- The buyer authorizes payment through PayPal.
- The backend captures the approved payment and records the confirmed transaction in Turso.
Important: Spending policies are enforced by the backend, not merely by frontend warnings or AI-generated recommendations.
AgentCart separates AI recommendations from payment authorization.
- Backend-enforced policies: Spending limits are evaluated on the server before a PayPal order can be created.
- Monthly budget protection: Completed and pending transactions are considered when evaluating available spending capacity.
- Explicit purchase approval: Transactions exceeding the per-transaction limit require a separate approval workflow.
- Approval expiry: Purchase approval requests expire after a limited time.
- Fresh product verification: Product price, availability and retailer trust are checked again before an approved order is created.
- Payment verification: PayPal order status, amount and currency are checked before capture.
- Transaction integrity: Purchase records are updated only after PayPal confirms successful capture.
Note: AgentCart is a hackathon prototype using PayPal Sandbox. It is not a production-ready financial authorization platform.
Make sure you have the following installed:
- Node.js (v20 or later)
- npm
- Git
You will also need API credentials for PayPal Sandbox, Channel3, Groq, and Gemini, along with a Turso database.
git clone https://github.com/karanthashika/AgentCart.git
cd AgentCartcd server
npm installCreate a .env file inside the server directory:
PORT=5000
CLIENT_URL=http://localhost:5173
CHANNEL3_API_KEY=your_channel3_api_key
PAYPAL_CLIENT_ID=your_paypal_client_id
PAYPAL_CLIENT_SECRET=your_paypal_client_secret
PAYPAL_BASE_URL=https://api-m.sandbox.paypal.com
GROQ_API_KEY=your_groq_api_key
GEMINI_API_KEY=your_gemini_api_key
TURSO_DATABASE_URL=your_turso_database_url
TURSO_AUTH_TOKEN=your_turso_auth_tokenReplace the placeholder values with your own credentials. Never commit your .env file or expose API secrets publicly.
Start the backend:
node server.jsOpen a second terminal:
cd client
npm installCreate a .env file inside the client directory:
VITE_API_URL=http://localhost:5000Start the frontend:
npm run devVisit:
The frontend and backend should both be running.
Note: PayPal integration uses Sandbox credentials for testing. No real-money transactions are processed.
- Application: https://agentcart-phi.vercel.app/
- Source Code: https://github.com/karanthashika/AgentCart
The application uses PayPal Sandbox for payment testing.