Beyond RAG - A system that understands your documents

Quick Overview

Agentic File Search, an approach that employs a three-phase strategy (Parallel Scan, Deep Dive, Backtrack) and specialized tools, overcomes the limitations of traditional RAG by enabling dynamic exploration, understanding document structure, and following cross-references, leading to more accurate answers for complex, multi-document queries.

Key Points: The standard RAG pipeline fails when documents are structured and rely on cross-references, as chunking breaks contextual relationships and makes references invisible to vector embeddings (0:23, 0:46). Agentic File Search uses a Three-Phase Strategy: Phase 1 (Parallel Scan using scanfolder()) provides a quick preview of all documents; Phase 2 (Deep Dive using parsefile()) extracts information from relevant documents; and Phase 3 (Backtrack using parsefile() again) follows cross-references to skipped documents (4:04, 5:05, 15:18). The system uses six core tools (scanfolder, previewfile, parsefile, read, grep, glob) governed by an Agent decision loop that uses Gemini 3 Flash with structured JSON output to decide which tool to use next (10:59, 12:24). The key difference is that RAG relies on fixed, pre-computed embeddings and retrieves the same chunks regardless of query nuance, while Agentic Search uses dynamic exploration that adapts to each query and follows logical paths (4:47). Parallel scanning via scanfolder is crucial because it provides the agent full context in a single API call, making it 4x faster than sequential processing (13:56, 14:25). Structured output using JSON schema prevents parsing failures and ensures predictable actions, eliminating an entire class of bugs common in unstructured text retrieval (18:17). The system is extensible, allowing users to add new tools by defining a function and updating the agent's tool dictionary and system prompt, or swap LLM providers by updating imports in agent.py (17:34, 17:47).

Context: The video contrasts the limitations of traditional Retrieval-Augmented Generation (RAG) systems, particularly when dealing with complex, interconnected documents, against a proposed Agentic File Search implementation called 'fs-explorer'. The core problem identified with RAG is that document chunking destroys the inherent structure and cross-references present in legal, technical, or research documents, leading to incomplete answers. The agentic approach aims to overcome this by dynamically exploring the document set using a set of specialized tools.

Raw markdown version of this recap