What it does
AIJajan gives an AI agent something no chatbot has: a real (sandbox) wallet and a weekly allowance — uang jajan, pocket money. The agent, Jaja, receives shopping missions from its owner ("find me hosting for my portfolio", "get me a cheap domain for my bakery") and pays for what it finds with PayPal.
But Jaja does not hold the keys to the vault. Before a single cent moves, every proposed purchase is judged by a deterministic policy engine — plain code, not the AI — against rules the owner writes in plain language:
"ask me first above $15, no subscriptions, games max $20 a month, never spend more than $40"
A deterministic parser translates those words into structured policy. Every purchase then gets one of three verdicts, each citing the rule that decided it:
- ALLOW — within the rules: Jaja pays instantly via the PayPal Payouts API.
- ASK — above the auto-allow limit: Jaja stops, explains, and waits for the owner's approval.
- BLOCK — breaks a rule (a subscription, a blown category cap, a frozen wallet): Jaja cannot pay, no matter how nicely it asks. It writes a diary complaint instead.
Why payouts, not checkout? An autonomous agent has no human sitting at a checkout page — a Checkout order capture fails with ORDER_NOT_APPROVED. So in AIJajan the policy engine is the approval layer: once it says ALLOW (or the owner approves an ASK), the payment executes server-side over the PayPal Payouts API. Top-ups of the allowance are payouts too.
The diary
After every event — a purchase, a block, a denial — Jaja writes a diary entry in its own voice (Gemini), dramatic and a little too honest about its finances. Its mood follows its balance: rich and confident at $50, theatrical at $4.43. When the balance drops under $5, Jaja composes a formal plea for a top-up ("my bank account is looking sadder than a Tamagotchi with a dead battery…"), and the owner can approve it (a real sandbox payout lands) or reject it (the diary takes it personally).
Safety rails
- Kill switch: one toggle freezes all spending instantly — the engine is checked again even when approving a stale pending purchase.
- Audit log: every verdict, payment, plea and top-up is recorded with the rule that decided it.
- The LLM only ever proposes.
evaluate()disposes.
How judges can run it
- Live demo (real mode, hosted on Render): https://aijajan.onrender.com — the hosted instance runs with live PayPal sandbox payouts and the Gemini planner/voice enabled; the header badges read
PayPal: sandbox/AI: gemini. - Mock mode (zero accounts): clone the repo,
npm install,npm start— PayPal and the AI planner are simulated deterministically; the full flow (missions, ASK approvals, subscription blocks, pleas) works. - Real sandbox mode: put a PayPal sandbox app's Client ID/Secret and a Gemini API key in
.env(see README) — purchases and top-ups then execute as real sandbox payouts, and Jaja's voice is fully Gemini-generated.
Built With
- express.js
- google-gemini
- javascript
- node.js
- paypal
- render
