Market Intelligence Agent: Hybrid RAG with Autonomous Routing
What I built
Standard LLMs like ChatGPT can't access real-time competitor pricing or internal strategy documents. Product teams needed a single interface to answer both 'What's our Q3 strategy?' (internal docs) and 'What's Tesla's current stock price?' (live data) without switching tools or getting outdated information.
Build a unified AI interface that synthesizes proprietary internal knowledge with live external market intelligence, routing queries intelligently without manual intervention.
What I did
Engineered a hybrid RAG system with autonomous routing: (1) Intent classifier analyzes each query to determine if it needs internal docs or live data, (2) Internal path uses vector embeddings + Supabase for company knowledge, (3) External path triggers Tavily API for real-time web search, (4) GPT-4 synthesizes final answer with appropriate context. Instrumented production telemetry to measure real costs: $0.26/query average across 7 test runs.
What came out of it
Delivered zero-latency intelligence tool combining internal + external knowledge. Production metrics prove economic viability: $0.26/query enables 10,000+ monthly queries at $2,600/month. Autonomous routing eliminates user friction—no manual source selection required. Real telemetry data became foundation for Block 7's ROI calculator, proving $1.17M annual value for 50-person teams.
01Artifacts
02Evidence still missing
STACK · React · Node.js · Express · OpenAI · Tavily Search API · Vector Embeddings · pgvector