Inspiration The idea for IQAI was born from a real and painful experience shared by our friend Ferreira, an e-commerce vendor operating in global markets.
One day, Ferreira suffered a significant financial loss after facing two critical scenarios simultaneously: on one hand, he received nearly 20 legitimate customer complaints and, overwhelmed with no resources to manually analyze each case and meet strict deadlines, he saw the resolution window expire and refunds issued automatically.
But what hurt the most was seeing the opposite happen with bad-faith buyers: dishonest customers who had already received their products in perfect condition, yet took advantage of the slow processes to open false 'item not received' disputes. Without the agility to quickly cross-reference delivery tracking, receipts, and PayPal policies, Ferreira was left completely defenseless against these abuses, accumulating financial and inventory losses.
This made us realize a critical flaw in modern digital commerce: manual dispute management is slow, unscalable, vulnerable to merchant fatigue, and completely defenseless against fraud. We were inspired to create an autonomous solution that acts as a 24/7 AI legal/financial advisor — capable of detecting bad faith, gathering evidence in seconds, and automatically defending online merchants.
What it does IQAI is an autonomous AI agent designed to revolutionize dispute and litigation management on PayPal and e-commerce platforms.
Instead of relying on rigid static rules or manual intervention, IQAI establishes a live, real-time bridge via Webhooks directly connected to the PayPal Sandbox ecosystem, evaluating incoming dispute events instantly and executing end-to-end workflows:
Real-Time Event-Driven Triggers: Listening directly to live PayPal Sandbox webhook events (CUSTOMER.DISPUTE.CREATED), ensuring zero latency between a buyer filing a complaint and the AI taking action.
Autonomous Decision-Making: Analyzes dispute reasons (e.g., non-receipt of goods, damaged items, or unauthorized transactions) using stateful logic and intelligently decides whether to Contest (CONTEST), Request Information (REQUEST_INFO), or Escalate to Human Review (ESCALATE).
Smart Tool-Calling (MCP): When evidence is required, IQAI autonomously invokes external tools to generate secure upload links for buyers/merchants to submit photo or video evidence.
Live API Integration: Interacts seamlessly with backend services to fetch transaction data and process automated defenses.
Real-Time Operator Dashboard: Provides a sleek Next.js interface for human operators to monitor live AI reasoning, dispute status, and tool activations.
How we built it IQAI was constructed using a modern, multi-agent stack tailored for speed, resilience, and autonomous execution:
Stateful Agentic Workflow (LangGraph): Built a directed decision graph that tracks case states and controls conditional branching based on the dispute context.
High-Speed Inference (Groq + Llama 3.3 70B): Leveraged Groq’s ultra-fast LPU inference engine running llama-3.3-70b-versatile to perform instant legal/financial reasoning.
Backend API & Real-Time Webhooks (FastAPI & Ngrok/Localtunnel): Engineered asynchronous FastAPI endpoints coupled with secure public tunneling to ingest live, cryptographically-valid event payloads straight from PayPal Sandbox.
Tool-Calling & Model Context Protocol (MCP): Enabled the agent to trigger external tools dynamically when evidentiary input is needed from the user.
Frontend (Next.js 15 & Tailwind CSS): Designed an interactive, dark-themed dashboard allowing judges and operators to test live scenarios with custom dispute parameters.
Challenges we ran into Bridging Sandbox Webhooks Locally: Establishing a rock-solid, low-latency tunneling pipeline (localtunnel/ngrok) to ensure live PayPal Sandbox events successfully hit our FastAPI backend without dropping payloads.
Orchestrating Stateful Tool-Calling: Ensuring the agent transitioned smoothly from pure text reasoning to triggering external tools (like generating dynamic upload URLs) required meticulous prompt engineering and state management in LangGraph.
Schema Validation & FastAPI Routing: Debugging 422 Unprocessable Entity errors during payload alignment to ensure dispute_id, order details, and reason fields passed seamlessly from the PayPal JSON schema into our Pydantic models.
Accomplishments that we're proud of True Live PayPal Integration: Successfully achieved a working end-to-end integration where a real event triggered in the PayPal Sandbox environment instantly travels through public webhooks, hits our FastAPI server, and triggers autonomous AI processing.
Sub-Second Reasoning Speed: Combined Groq with LangGraph to reduce dispute evaluation times from hours to milliseconds.
Dynamic Tool Integration: Seeing the system automatically react to live webhook payloads and render the appropriate workflow steps whenever the AI evaluates a case.
Solving a Real-World Problem: Turning a real merchant's financial pain point into a production-ready, scalable AI agent.
What we learned Agentic AI Beyond Chat: We learned that the true power of LLMs lies in action execution—using tools, managing state graphs, and reacting dynamically to live external webhook events.
Resilient Architecture: Building structured agent workflows with clear fallback nodes (like human escalation) is essential for high-stakes financial environments.
Production-Grade Tool Calling: Integrating LangGraph with FastAPI highlighted the importance of strict type safety and schema validation in agent ecosystems.
What's next for IQAI - Autonomous Litigation Agent Multi-Marketplace Integration: Expanding beyond PayPal to support Stripe, Shopify, WooCommerce, and Amazon Dispute APIs out of the box.
Automated Evidence Document Generation: Enhancing the agent to automatically extract proof of delivery (PDFs, tracking numbers from DHL/FedEx) and compile formal defense PDFs.
Predictive Fraud Scoring: Incorporating historical buyer behavior analysis to detect coordinated refund fraud rings before disputes are even filed.
Production Deployment & Pilot Program: Onboarding real e-commerce merchants (starting with sellers like Ferreira) to run IQAI in live production environments.
