Decision: Use LangGraph + Python for agent orchestration, not n8n.
Rationale: n8n executes pre-written workflow logic. SupplySafe requires agents that reason about unstructured web content and make judgment calls that cannot be pre-written as IF/THEN branches. LangGraph provides shared state, directional agent control, and full Python expressiveness. n8n provides neither.
Trade-off: Higher build complexity. LangGraph requires understanding Python async patterns, TypedDict state management, and agent graph construction. The payoff is genuine agentic capability — not simulated.
Decision: Use Groq-hosted Llama 3.3 70b as the primary LLM.
Rationale: Groq's inference speed (typically 400–800ms per call) allows the full six-supplier pipeline to complete in under 60 seconds. OpenAI GPT-4o at similar quality would be 3–5x slower per call and significantly more expensive. Groq's free tier covers all development and demo usage.
Trade-off: Groq has a 12,000 tokens-per-minute rate limit on the free tier. This was hit during early testing when large database payloads were passed to the model. Fixed by moving all deterministic logic (cascade analysis) to pure Python and only calling Groq for tasks that require genuine language reasoning.
Decision: Use Tavily API for supplier monitoring web searches.
Rationale: Tavily is purpose-built for LLM-augmented search. It returns structured results with clean content extraction, unlike raw Google Search which requires HTML parsing. Integrates natively with LangChain tool calling. Free tier covers development usage.
Trade-off: Tavily results quality varies by supplier geography. Suppliers in smaller markets with less English-language news coverage return fewer relevant results. This is a data quality limitation, not an architecture limitation.
Decision: Use FastAPI for the backend API layer.
Rationale: FastAPI provides automatic OpenAPI documentation, Pydantic data validation, and async support out of the box. The 13-endpoint API was scaffolded significantly faster than equivalent Flask or Express setups. Python consistency with the agent layer means no language context switching.
Trade-off: FastAPI's async model requires understanding of Python async/await patterns. Synchronous Supabase client calls inside async route handlers required careful handling to avoid blocking the event loop.