MarginMind is an autonomous spend-optimization agent that detects SaaS waste, duplicate subscriptions, inflated vendor costs, and recoverable charges, then uses a Locus-native action layer to take profitable next steps.
Small teams leak money every month through forgotten renewals, duplicate SaaS tools, rising infra bills, and contracts nobody renegotiates. The real problem is not spotting waste. It is turning a messy expense ledger into action fast enough to save money before the next billing cycle.
MarginMind is built for that exact gap:
- it ingests startup spend data in seconds
- it estimates real monthly and annual savings
- it recommends the highest-ROI next move
- it shows how an agent can spend a little money through Locus to save much more
- CSV upload plus one-click demo data
- recurring charge detection with strict CSV validation and merchant-name normalization
- duplicate-tool detection across analytics, design, collaboration, and infra spend
- underused subscription, refund-window, pricing outlier, rising-cost, and negotiation detection
- six clearly labeled agents:
- Intake Agent
- Detection Agent
- Decision Agent
- Action Agent
- Task Escalation Agent
- Strategy Agent
- NVIDIA NIM powered business-language explanations and top-action summaries
- Locus wallet, wrapped API, Build with Locus, and Locus Tasks action planning
- founder-ready report export
- crisp demo dashboard with savings timeline and transparent agent logs
- Next.js + TypeScript + Tailwind CSS
- NVIDIA NIM for structured reasoning
- Locus-native action design for wallet-funded agent operations
- GitHub-first deployment flow to Vercel
npm install
npm run devOpen http://localhost:3000.
Create a .env.local file:
NVIDIA_NIM_API_KEY=your_nim_key
NVIDIA_NIM_MODEL=meta/llama-3.1-70b-instruct
LOCUS_API_KEY=your_locus_key
LOCUS_API_BASE=https://beta-api.paywithlocus.com/api
NEXT_PUBLIC_APP_URL=http://localhost:3000NVIDIA NIM and Locus can both run live. If LOCUS_API_KEY is missing, MarginMind automatically falls back to simulation mode for the Locus action layer.
- Open the homepage.
- Click Load sample startup spend.
- Review duplicates, overpriced tools, and refund opportunities.
- Open an opportunity card.
- Run the Strategy Agent.
- Review the Locus action path.
- Export the founder report.
- Push this repository to a public GitHub repo.
- Import the repo into Vercel.
- Add the environment variables:
NVIDIA_NIM_API_KEYNVIDIA_NIM_MODEL(optional override)LOCUS_API_KEYLOCUS_API_BASE(usehttps://beta-api.paywithlocus.com/apifor Paygentic)NEXT_PUBLIC_APP_URL
- Deploy.
The app is designed to build even if Locus keys are absent. In that case, MarginMind runs the Locus layer in an explicitly labeled simulation mode for judges. With a valid key, the dashboard uses live Locus wallet connectivity and capability checks.
This repository also includes a GitHub Actions workflow at .github/workflows/deploy-vercel.yml so future pushes to main can redeploy the app to Vercel from GitHub.
MarginMind uses NVIDIA NIM for:
- structured spend posture summaries
- action prioritization
- concise business-language explanations
- report-ready executive narrative
The integration uses the OpenAI-compatible POST /v1/chat/completions endpoint at https://integrate.api.nvidia.com. If the model returns invalid JSON, the app retries once with stricter instructions before falling back to deterministic heuristics.
MarginMind uses Locus as a central execution layer, not as a cosmetic add-on.
- Wallet model: the app frames agent actions as wallet-funded operations with allowance, max-transaction, and approval-threshold guardrails.
- Wrapped APIs: the Action Agent can justify low-cost research calls as pay-per-use operations instead of subscription tooling.
- Locus Tasks: the Task Escalation Agent only proposes human work when expected savings exceed task cost.
- Build with Locus: the app shows how the agent can deploy a renewal-monitor service from GitHub as a wallet-funded machine-economy action.
- Audit logs: every proposed action includes rationale, expected savings, estimated Locus spend, and status.
MarginMind now supports both modes:
- Live mode with
LOCUS_API_KEY: wallet balance and Locus capability checks are fetched in real time. - Simulation mode without key: action planning remains available for demo continuity.
High-cost commercial actions still remain in guarded/pending mode in this MVP to avoid accidental spends during judging.
- Live app: https://marginmind-paygentic.vercel.app
- Demo walkthrough: DEMO_SCRIPT.md
- Business framing: BUSINESS_PLAN.md
- Judges can follow the script live in-app with zero setup beyond opening the URL.
MarginMind matches the brief directly:
- it helps the user save money, not just analyze spend
- the agent recommends and prepares profitable actions
- Locus is the execution and machine-economy layer
- the demo is fast, visual, and founder-friendly
- the product clearly answers “Hack an Agent to Make You Money!”
PROJECT_OVERVIEW.mdPROBLEM_STATEMENT.mdSOLUTION_OVERVIEW.mdLOCUS_INTEGRATION.mdAGENT_ARCHITECTURE.mdDEMO_SCRIPT.mdTEAM_INFO.mdpublic/data/seed-startup-spend.csv
- live Locus wrapped API execution with provider-level approvals
- live Locus task submission and task status polling
- live Build with Locus deployment execution once public Build app write endpoints are available
- Gmail or email agent connectors for refund and negotiation outreach
- spend anomaly detection over linked bank, card, and billing feeds
- policy-aware autonomous approvals based on confidence and ROI