Share via


Search and retrieval patterns

Modern agents need sophisticated search and retrieval capabilities to access and process information from diverse data sources effectively. This article examines four primary patterns for implementing search and retrieval in agent architectures: Microsoft's built-in search capabilities, structured database queries, custom semantic indexing, and hybrid multistep approaches.

Each pattern offers distinct advantages and trade-offs in terms of developer effort, control granularity, and performance characteristics. Understanding these patterns helps solution architects select the optimal approach based on their specific use cases, existing infrastructure, and performance requirements.

Key considerations covered:

The following sections detail each pattern's architecture, implementation considerations, and optimal use cases to guide your search and retrieval strategy decisions.

Built-in search capabilities

Microsoft's built-in search capabilities provide the lowest developer effort approach by using prebuilt indexes maintained by the Microsoft 365 infrastructure. These capabilities include Copilot connectors, SharePoint knowledge bases, and web search functionality.

Architecture diagram showing Microsoft's built-in search flow through Copilot connectors, SharePoint knowledge, and web search with minimal developer configuration required.

This model provides seamless integration with Microsoft 365 ecosystems but limits control over indexed properties, indexing intervals, and supported file types to platform-offered capabilities. The sequence and ranking of searches remain outside developer control, making this approach suitable for general-purpose search scenarios but potentially limiting for specialized requirements.

Note

Semantic indexes return snippets (short excerpts) of data, making them poorly suited for scenarios that require full document or comprehensive table analysis. Use cases that need information from multiple pages in long documents or several tables within spreadsheets aren't optimal for this search type.

Structured database queries

Structured query architectures use language models' ability to generate query language strings for execution against existing database systems. This approach optimizes workflows that require calculated or derived values already solved within database storage systems.

Diagram illustrating structured query flow where language models extract entities from user input and generate SQL or KQL queries for database execution.

This model excels when agents need to access structured data through established query languages including SQL, KQL, and DAX (Data Analysis Expressions). Optimized database views can further improve performance by precalculating common query patterns and simplifying data access for language models.

Note

Developers should provide comprehensive documentation and field descriptions to enable language models to create appropriate queries. While language models are fluent in query languages, they require detailed context about data structure and relationships to generate effective queries.

Custom semantic indexing

Custom semantic indexing requires developers to create externally hosted indexes with custom parsing, ranking, dictionary, and snippet size configurations. This approach provides fine-grained control over search results and enables specialized optimization for specific content types and use cases.

Architecture diagram showing custom semantic index implementation with external hosting, custom parsing, and fine-grained search result control.

Since custom semantic indexes present as external tools to Microsoft 365 hosted agents, they enable iterative reasoning loops and complex multistep search operations. This flexibility supports sophisticated search scenarios that require domain-specific optimization or specialized content processing.

Hybrid multi-turn approaches

Hybrid approaches combine structured or semantic search for initial file identification with multi-turn flows for comprehensive content analysis. This pattern provides deeper reasoning over full file content while managing performance implications of comprehensive analysis.

Diagram showing hybrid search approach using initial search to identify files followed by multi-turn flows for complete content extraction and reasoning.

Note

Multi-turn flows require extra processing time due to multiple service calls needed to generate complete responses. This approach provides completeness at the cost of response times, making it suitable for scenarios where comprehensive analysis outweighs speed requirements.

Next step

Decide how your agent interacts with external systems and performs actions beyond simple information retrieval.