The Future of Search

November 4, 2024

TL;DR:

AI is transforming search from simple keyword queries to intelligent systems that understand user intent. This evolution includes translating plain language to SQL, using Retrieval Augmented Generation (RAG) and semantic search with vector databases for context-aware responses, and advancing toward agentic search. In agentic search, an orchestrator AI dynamically selects the best approach—keyword, semantic, or SQL—to answer complex questions effectively. These innovations are making information access more intuitive and conversational, positioning AI-powered search systems as intelligent, adaptive partners. You cam see examples of all these types of search, including agentic search, on my projects page.

How AI is Revolutionizing Search: From Simple Queries to Intelligent Agents

As evidenced by the popularity of Perplexity.ai and ChatGPT's new search function, Artificial Intelligence (AI) is fundamentally changing the way we search for information. From the days when search meant typing a few keywords into a box, we've now moved to sophisticated systems that can understand the nuances of our questions. Today, I'd like to share my journey through the evolution of AI in search, from building a plain language to SQL translator to diving into retrieval augmented generation, semantic search, and the emerging idea of agentic search.

Building a Plain Language to SQL Search Feature

One of my first big projects involving generative AI was creating a search feature that translated plain language queries into SQL statements. It was an incredibly rewarding experience that really opened my eyes to AI's potential to bridge the gap between complex technology and everyday users.

When I was a crime analyst, I often received questions about topics like calls for service, crime, and arrests. I realized that my role was largely to translate the needs of business users into SQL queries. SQL is a powerful tool that can answer almost any question if the necessary data is available in the database. Essentially, the analyst is the interface between business users and the database.

Imagine trying to figure out how many crimes have occurred this year. If you're not a database expert, you might ask, "How many crimes have we had this year?" or something more complex. My goal was to build a system that could take this plain-language question and convert it into an SQL command like this:

SELECT COUNT(id) FROM crimes WHERE YEAR(crime_date) = YEAR(GETDATE());

The AI would generate the SQL, execute it against the database, and return the answer in an easy-to-understand format. Surprisingly, creating this was easier than I anticipated, and I was impressed by how well the AI produced accurate results. While it had its flaws, it was the first time I could effectively remove the analyst from the loop between the database and the end user for complex or ad-hoc questions.

Despite the technical success of this prototype, I faced a familiar challenge: no funding or organizational support to push it into production. Still, the project was an early testament to how AI could simplify complex interactions for non-technical users, giving them the ability to ask questions in a way that felt natural.

As AI continued to evolve, I found myself exploring new concepts like Retrieval Augmented Generation (RAG) and semantic search. Unlike the earlier days of keyword search, these approaches are all about understanding the context behind what users are asking, not just matching words.

At the heart of semantic search is the concept of vector databases. Think of a vector database as a way to store information in a form that captures the meaning of data rather than just the literal words. It’s like representing information in a multi-dimensional map, where similar concepts are closer together—making it easier for AI to understand and retrieve contextually relevant results. Essentially, these databases represent information in a high-dimensional vector space—a fancy way of saying they capture the meaning of words, not just their literal form. Imagine asking for information about "climate change solutions" and getting results that aren't just keyword matches, but genuinely relevant insights.

To make this work, we first need to chunk and vectorize the data—breaking it down into smaller pieces and converting each piece into a numerical representation. When a user submits a query, that query is also vectorized, allowing the system to find the chunks closest in meaning. This proximity in vector space enables the AI to understand the intent behind the question, not just the specific words used.

I've developed several RAG applications, and one of the most promising use cases is in the area of policy. Organizations often have thousands of pages of policy documents. I created a search tool that allows police officers to search and ask relevant questions about police policies, making it easier to find the information they need without having to ask a human being. Imagine the possibilities for incorporating training materials, PTO/FTO manuals, and many other types of documentation.

Agentic Search: Orchestrating User Intent

The next leap in AI search is something I find truly exciting—agentic search. Imagine a customer support system where users can ask a broad range of questions about their services, such as billing issues or technical problems. An agentic search system could determine whether the question requires a simple keyword match, a deeper semantic search, or a data-driven SQL query to provide the best response, all while keeping track of the user’s previous queries to better understand their needs. Instead of just providing answers, these systems are designed to understand the user’s intent and adapt accordingly, almost like having a conversation with an intelligent assistant that knows the best way to help.

An orchestrator AI oversees the whole process, much like a conductor leading an orchestra—making sure each component works in harmony to deliver the best possible outcome. If you ask a straightforward question, it might stick with a simple keyword search. If your query is more complex or nuanced, it shifts gears to semantic search. And if the answer lies in data, it generates an SQL query on the fly. It’s a dynamic, adaptable system that chooses the right tool for each job.

Sometimes, the orchestrator even reformulates your query to make it more precise. It might break a question down into smaller parts or paraphrase it to ensure the best results. Once it has all the information, it presents it in a conversational format—making it easier to understand and, frankly, a lot more enjoyable to interact with.

Side note: I wrote about a framework I called Agent Augmented Practice in my dissertation. The basic idea is that AI agents will help in practices like policing. They will go beyond the tools we use and actually strengthen the practice in many ways. You can read a summary of my dissertation here.

The Road Ahead

Reflecting on this journey, I’m struck by how far AI has come in such a short time, from basic keyword matching to complex intent understanding, in making information more accessible. My early project of translating natural language to SQL was just the beginning. Today, retrieval augmented generation, vector-based searches, and agentic systems are pushing the boundaries of what’s possible. There are still challenges, like securing funding and organizational buy-in, but the potential of these technologies is undeniable.

The ultimate goal is to build systems that understand not just what we’re asking, but also how to deliver the information in the most effective way. We’re getting closer to search systems that act more like partners—anticipating our needs and delivering insights with intelligence and empathy. The future of AI and search is incredibly bright, and I can’t wait to see where it takes us next.


I’d love to hear your thoughts—have you encountered any interesting use cases of AI in search, or do you have ideas for where it could go next?