TL;DS (Too Lazy; Didn't Search)

The Information Access Challenge

Traditional search engines present users with a list of links, leaving the task of sifting through multiple sources, synthesizing information, and verifying accuracy entirely to the user. This process, while familiar, is time-consuming and often frustrating. Users must click through multiple results, read lengthy articles, and piece together answers from disparate sources—all while hoping the information is current and reliable.

In 2024, OpenAI announced SearchGPT, a revolutionary approach that combines large language models with real-time web search to provide direct, cited answers instead of just links. The announcement generated significant interest in the AI community, but the product remained in limited testing with no public release timeline. This created an opportunity to explore what such a system might look like and how it could be implemented using available technologies.

An Early SearchGPT Implementation

TL;DS (Too Lazy; Didn't Search) is a full-stack application that replicates the core functionality of OpenAI's SearchGPT, built before the product became publicly available. The project demonstrates the integration of modern AI frameworks with traditional search APIs to create an intelligent search experience that provides direct answers with verifiable sources.

Rather than simply displaying search results, TL;DS employs an AI agent that actively thinks about user queries, determines what information it needs, performs targeted searches, and synthesizes findings into coherent answers with proper citations. The system operates autonomously, making decisions about when to search, what to search for, and when it has sufficient information to respond.

Agent-Based Architecture

At the core of TL;DS is a LangChain agent architecture that orchestrates the search and reasoning process. This approach represents a significant departure from simpler AI implementations that merely pass user queries to a language model. Instead, the system uses OpenAI's function calling capabilities to enable the AI to interact with external tools dynamically.

The agent has access to two primary tools: search_google for performing web searches via a self-hosted OpenSERP Docker container, and get_page_text for extracting and analyzing content from specific URLs. The AI decides when and how to use these tools based on the user's query. For complex questions, it may perform multiple searches, visit different web pages, and synthesize information from various sources before formulating its response.

This architecture allows for genuinely intelligent search behavior. When asked about a topic requiring multiple pieces of information, the agent breaks down the problem, performs targeted searches for each component, and combines the results. The system knows when it needs more information and takes initiative to gather it, mimicking the research process a human might follow.

Technical Implementation

TL;DS utilizes a carefully selected technology stack that balances modern AI capabilities with practical web development:

Backend Framework: Flask provides a lightweight Python web server that handles routing and API endpoints. The simplicity of Flask makes the codebase maintainable while offering sufficient flexibility for the application's needs.

AI Components: OpenAI's GPT-4o-mini serves as the reasoning engine, selected for its balance of speed and capability. LangChain orchestrates the agent's decision-making process, managing tool calls and conversation flow through the OpenAIFunctionsAgent pattern.

Search Infrastructure: A self-hosted OpenSERP Docker container provides Google search results. The application automatically manages the Docker container lifecycle, starting it when the server launches and cleaning it up on shutdown. This approach eliminates dependency on expensive commercial SERP APIs while maintaining functionality.

Web Scraping: BeautifulSoup handles content extraction from web pages, cleaning HTML and formatting text for the AI's consumption. The system limits extracted content to avoid token overflow while preserving enough context for accurate understanding.

Frontend Design: Tailwind CSS creates a clean, modern interface that echoes SearchGPT's aesthetic. The UI includes tabbed views for the AI's answer, raw search results, and JSON data, providing transparency into the system's operation.

The favicon caching system deserves particular mention—it extracts and stores site icons to provide visual cues for sources, with a fallback to a default icon when fetching would slow response times. This attention to detail enhances the user experience without sacrificing performance.

Intelligent Search Flow

When a user submits a query, TL;DS engages in a multi-step process that demonstrates the sophistication of agent-based AI:

  1. Query Analysis: The AI agent receives the question and evaluates what information it needs to provide a complete answer.

  2. Dynamic Search Strategy: For straightforward queries, a single search may suffice. For complex, multi-part questions, the agent formulates multiple targeted searches, each designed to gather specific information.

  3. Deep Investigation: If initial search results don't provide sufficient detail, the agent uses the get_page_text tool to extract and analyze content from the most relevant URLs.

  4. Synthesis and Citation: Once adequate information is gathered, the AI composes a coherent answer and includes hyperlinked citations pointing directly to the sources consulted.

  5. Transparent Results: Users can switch to the "Google Search" tab to view all sources the AI accessed during its research, or examine the "Raw Data" tab to inspect the JSON response structure.

This workflow occurs automatically, with the agent making all decisions about tool usage. The verbose mode in the backend provides insight into the agent's reasoning process, logging each tool call and decision for developers to observe.

User Experience Design

The interface balances simplicity with functionality. A clean search box accepts natural language queries without requiring special syntax or formatting. Response time typically ranges around 10 seconds, during which the system indicates it's thinking and working.

The tabbed results view separates concerns effectively. Users primarily see the AI's synthesized answer with inline citations, but those interested in verification can examine the raw search results. This transparency builds trust while maintaining an uncluttered interface for casual users.

Favicon integration provides visual recognition of sources, making it easier to identify familiar and authoritative websites at a glance. The system gracefully handles cases where favicons aren't available, ensuring consistent presentation.

Performance Considerations

The most significant performance bottleneck is the SERP API response time. The self-hosted OpenSERP container, while cost-effective, introduces latency compared to commercial alternatives. This 10-second response time, though acceptable for a demonstration project, represents the primary area for improvement in a production deployment.

Commercial SERP APIs would likely reduce response times significantly, bringing the experience closer to real-time. However, these services come with substantial costs that make them impractical for personal projects or demonstrations. The choice to use OpenSERP reflects a pragmatic balance between functionality and feasibility.

Context and Timing

TL;DS was developed as a technical exercise to explore agent-based AI architectures and demonstrate proficiency with modern AI frameworks. Building a SearchGPT replica before the product's public release required synthesizing knowledge from various sources about how such systems might work, including OpenAI's function calling documentation, LangChain's agent patterns, and best practices for AI-powered search.

The project showcases several valuable skills: understanding of AI agent architectures, integration of multiple technologies into a cohesive system, Docker container management, web scraping techniques, API design, and frontend development. These capabilities translate directly to building production AI applications.

Future Enhancements

Several improvements could enhance TL;DS:

Performance Optimization: Migrating to a commercial SERP API would dramatically reduce response times. Alternatively, implementing parallel searches when multiple queries are needed could improve efficiency.

Caching Layer: Storing recent search results and AI responses could speed up repeated or similar queries while reducing API costs.

Advanced Agent Capabilities: Expanding the tool set to include image search, specific date range searches, or domain-restricted searches would increase the agent's versatility.

Conversation Memory: Adding conversation context would enable follow-up questions and multi-turn research sessions.

Enhanced Citation Format: Extracting relevant snippets from sources and displaying them alongside citations would provide better context for users.

Despite these potential enhancements, TL;DS successfully demonstrates the core concept: an AI agent that actively researches topics and provides cited, synthesized answers. The implementation proves that powerful search experiences can be built with modern AI frameworks and modest infrastructure.

Open Source

TL;DS is open source and available on GitHub at github.com/andrewcampi/TLDS. The project serves as both a functional application and a learning resource for those interested in building agent-based AI systems. The codebase demonstrates practical patterns for orchestrating AI tools, managing external dependencies, and creating user-friendly AI interfaces.