The system is built using Vercel’s AI SDK for handling requests and streaming data, with an agent-based approach that manages search, extraction, and analysis. It uses Firecrawl to find and extract structured data, which is then processed through a progressive analysis system to refine and summarize results. The process follows an iterative cycle: Firecrawl’s /search API finds relevant URLs, /extract pulls structured data, and a planning function determines what to look for next. A research state tracker keeps track of findings, summaries, and progress while enforcing depth (maxDepth) and time limits to stay within Vercel’s function execution time constraint. The results stream into a live UI, showing search progress, sources, and key insights. The cycle continues until enough information is collected or limits are reached, producing a final structured summary.
This was a pretty fast built and I wanna keep iterating on it. Would love to hear your thoughts.