Skip to content

[Thank Goodness its Search] Agentic Search Performance Considerations

6 minute read
Content level: Intermediate
0

The next few series of posts with focus on Agentic Search and various use cases that you can build using Amazon OpenSearch Service.

Welcome to Thank Goodness It's Search series—your Friday fix of OpenSearch learnings, feature drops, and real-world solutions. I will keep it short, sharp, and search-focused—so you can end your week a little more knowledge on Search than you started.

Last week you were introduced to OpenSearch Agentic Search capabilities. Now let's address an important question - what is the performance impact?

Let's first understand the fundamental objectives of basic search functionality. A standard search system, whether using agents or not, must accomplish a few key tasks: query conversion (keywords to search tool syntax), result matching, relevance-based ranking, and presentation to the user. The search functionality is constrained by the available data and system capabilities. The quality of results directly depends on these underlying resources.

After the emergence of Generative AI, organizations have explored various approaches to build intelligent search experiences. Traditional search capabilities can be augmented with vector search, semantic search and multimodal features. While these enhancements help find conceptually similar matches and improve search results, they still lack the ability to provide truly intelligent query interpretation that understands the user's specific context.

Regardless of the search engine's underlying capabilities, the key to improving search quality lies in proper query interpretation - understanding user intent and context, and translating natural language queries into a format the system can process.

We learned previously that Agents serve as mechanisms for interpreting and executing specific tasks. They utilize predefined tools to simplify complex operations. While an agent can effectively manage query interpretation, this capability comes with certain performance implications.

Understanding Agentic Search Performance Implications

The use of Agentic Search impacts system performance due to its dependence on Large Language Model (LLM) calls for agent orchestration and tool selection. These LLM calls can add significant latency when searching through large information spaces. As a result, the overall search response time varies considerably based on your specific implementation and agent utilization approach.

With an online chatbots, searches are sent to the very large language models trained on the data from the World Wide Web (WWW) and typically scoped to a specific user context. The Agent works with three key inputs: 1) The user's question, 2) previous conversation context, and 3) user profile information. This could be time consuming depending on the kind and context in which the query is asked. However, even with longer response times, users generally accept the wait for an appropriate response.

But if you were to search within an external retail or financial website, you'd expect the search to return results in subsecond response time (regardless of the features or capabilities the system has). Here, the core search expectation remains the same - understand the intent and deliver the best possible results, with or without agents.

So how do we balance the need for intelligent, agent-driven search with the demand for fast response times? Let's explore the key factors affecting performance and strategies to optimize Agentic Search.

Top 5 factors impacting Agentic Search Performance

  1. Calls to LLMs & Tools accessed: Each interaction with an LLM introduces latency, which can accumulate significantly in complex queries requiring multiple calls for context understanding, tool selection, and response generation.

  2. Complexity of the Query: More complex queries require deeper analysis and must be broken down into multiple tasks, leading to multiple LLM interactions that further increase latency.

  3. Size of the Context: Larger contexts (passed to LLMs for conversation history) require more processing time, as the LLMs must analyze and interpret more tokens to generate accurate responses.

  4. Lack of parallel processing & caching mechanisms: Sequential processing of LLM calls and data retrieval can lead to increased latency, especially when multiple sources or complex agentic tasks are involved. Inadequate caching of frequent queries and responses can also result in redundant LLM calls, further impacting performance.

  5. Size and Efficiency of the LLM: Larger models, while more capable, often have longer response times compared to smaller, optimized models. The choice of LLM can significantly affect overall search performance.

Top 5 Strategies to Optimize Agentic Search Performance

  1. Optimizing the agentic search workflow: There are multiple ways to optimize the overall agentic workflow. 1/ Implement caching strategies for frequent queries and responses to reduce redundant LLM calls. 2/Breakdown the agentic tasks into smaller, manageable components that can be processed in parallel, thereby reducing overall response times. 3/Use agents selectively for queries that truly benefit from their capabilities. For straightforward queries, consider using traditional search methods to ensure quick response times.

  2. Minimize LLM Calls & tool usage: Reduce the number of interactions with LLMs by optimizing query processing and tool selection. If you know certain tools or repositories are more relevant for specific query types, prioritize their use to minimize unnecessary LLM calls.

  3. Query understanding: Break down complex queries into simpler components, identify common access patterns, filters and distinguishable keywords. Implement efficient agent orchestration strategies, categorizing & mapping queries to tasks that can be executed with and without LLMs. This streamlines task execution and minimizes redundant LLM calls.

  4. Context management: Limit the size of the context provided to the agent to essential information only. Context is either maintained in short-term memory (within the session) or long-term memory (persistent across sessions). Proper use of these memory types can help reduce the number of tokens processed in each LLM call, thereby improving response times.

  5. Optimize LLM selection & configuration: Choose smaller, efficient LLMs for tasks that do not require the full capabilities of larger models. Consider building and evaluating SLMs (Smaller Language Models) that are fine-tuned for specific tasks to balance performance and response time effectively. while this requires significant expertise in model development and evaluation, optimizing LLM selection and building purpose-built SLMs can provide the best long-term performance benefits for specific use cases.

Conclusion

Agentic Search introduces inherent performance challenges due to complex orchestration and reliance on LLM calls, but these challenges can be effectively managed with a well-architected approach. Agentic workflows should be treated first and foremost as an architectural consideration, because they define the system’s structure, control flow, state management, and integration with tools, models, and guardrails. Since agentic workflows and search patterns vary significantly across use cases, there is no universal best practice that applies to all scenarios. Instead, you must experiment to determine the optimal balance between agents, LLMs, and supporting components for their specific requirements.

By carefully optimizing the agentic search workflow—through query optimization, efficient context management, and the strategic use of fine-tuned LLMs or custom SLMs—you can improve search quality while maintaining acceptable latency and cost. As agentic search continues to evolve and remains an active area of research and development, continuous iteration and evaluation are essential to building scalable, high-performance systems.

Next Post In the next post, you will learn how to leverage different OpenSearch Agentic Search capabilities to build next-generation search solutions using various purpose-build OpenSearch agents. Stay tuned!