What It Is
Unlike the simpler File Search tool, the Agentic Search tool employs AI to break down complex questions, perform multiple search iterations, and intelligently refine queries until it finds the most relevant and complete information. It excels at research-oriented tasks requiring deep exploration. NOTE for better results, we recommend using top models from https://huggingface.co/spaces/lmarena-ai/chatbot-arena-leaderboardComplex Query: “What are the security implications of using JWT for authentication, and how should we implement proper token validation?”
Iteration 1: Exploring JWT Security
Query: “JWT authentication security implications”
Reasoning: Need to understand security risks before implementation details
Iteration 2: Token Validation Approaches
Query: “JWT token validation best practices”
Reasoning: Initial results showed common attacks, now need implementation guidance
Iteration 3: Implementation Examples
Query: “JWT validation implementation examples”
Reasoning: Need concrete code examples after understanding theoretical concepts
Comprehensive Answer
The search process revealed that JWT security implications include token hijacking, weak signature algorithms, and sensitive data exposure. Proper implementation requires validating the signature with a secure algorithm (at least HS256), checking expiration claims, validating issuer and audience claims, and implementing proper key rotation practices…
Configuration
Basic configuration requires a query parameter and vector store IDs:Configuration Parameters
| Parameter | Description | Default | Recommended Range |
|---|---|---|---|
vector_store_ids | List of vector store IDs to search | Required | N/A |
max_num_results | Maximum number of final results to return | 5 | 3-10 |
max_iterations | Maximum number of search iterations | 10 | 5-15 |
seed_strategy | Strategy for initial seed queries | ”hybrid" | "topk”, “hybrid” |
alpha | Balance between vector and keyword search weights | 0.5 | 0.1-0.9 |
initial_seed_multiplier | Multiplier for initial seed generation | 3 | 2-5 |
enable_presence_penalty_tuning | Enable dynamic tuning of presence penalty | false | true/false |
enable_frequency_penalty_tuning | Enable dynamic tuning of frequency penalty | false | true/false |
enable_temperature_tuning | Enable dynamic tuning of temperature | false | true/false |
enable_top_p_tuning | Enable dynamic tuning of top p | false | true/false |
filters | Optional filters to narrow search results | null | Depends on use case |
Response Format
The Agentic Search tool returns a comprehensive response including:When to Use It
The Agentic Search tool is designed for complex research scenarios requiring deep exploration across multiple documents.| Recommended For | Consider Alternatives For |
|---|---|
|
|
Example Queries
Multi-faceted Research
Comparative Analysis
Technical Strategy
Complex Problem-Solving
Advanced Tuning
Seed Strategy Options
Theseed_strategy parameter determines how initial search queries are generated:
“hybrid” (default)
Combines vector and keyword search approaches for balanced results. Best for general-purpose searching across diverse document collections.
”topk”
Uses top-K retrieval, focusing on the most similar documents by vector similarity. Better for specialized document collections with consistent terminology.
Alpha Parameter Tuning
Thealpha parameter (0.0-1.0) balances vector search vs. keyword search weights:
More Keyword (0.1)Balanced (0.5)More Semantic (0.9)
- Higher values (0.7-0.9): More weight to vector semantic search, better for conceptual questions
- Middle values (0.4-0.6): Balanced approach, good for most questions
- Lower values (0.1-0.3): More weight to keyword search, better for specific technical terms
If a reranker is enabled in the system configuration, the provided alpha value is ignored and a fixed value of 0.5 is used for pre-reranking result selection only.
Initial Seed Multiplier
This parameter controls how many initial search seeds are generated:Lower (2)
More focused
Default (3)
Balanced
Higher (5)
More diverse
Dynamic Parameter Tuning
The following parameters enable dynamic adjustment of the underlying model’s parameters based on search results:Enable Presence/Frequency Penalty Tuning
Enable Presence/Frequency Penalty Tuning
Controls automatic tuning of penalties to avoid repetitive content and encourage diversity in search iterations.
- enable_presence_penalty_tuning: Dynamically adjusts presence penalty
- enable_frequency_penalty_tuning: Dynamically adjusts frequency penalty
Enable Temperature/Top-P Tuning
Enable Temperature/Top-P Tuning
Controls automatic tuning of sampling parameters to balance creativity and precision.
- enable_temperature_tuning: Dynamically adjusts temperature
- enable_top_p_tuning: Dynamically adjusts top-p sampling
Integration Examples
Tool Usage with OpenAI Models
The agentic_search tool automatically performs multiple search iterations and provides the results to the AI model in the same request. This creates an advanced RAG experience where the model can access comprehensive research without additional API calls.
GitHub Example Implementation
For a complete working example of the Agentic Search tool, check out this Python example on GitHub. This example demonstrates:- Setting up the RAG system with sample documents
- Creating and configuring the AgenticSearchTool
- Performing searches with different strategies and parameters
- Comparing results from different search approaches
- Integration with the OpenAI Agents SDK
Configuring Research Depth
For research tasks requiring different levels of depth, you can adjust the configuration:Best Practices
Ask Specific Queries
Ask Specific Queries
While the Agentic Search tool excels at complex queries, questions should still be specific and focused.Good Example:Less Effective:
Provide Context When Relevant
Provide Context When Relevant
Include relevant context in your query to help guide the search process.Good Example:Less Effective:
Monitor and Adjust Iterations
Monitor and Adjust Iterations
For critical research queries, monitor the search iterations and adjust parameters if needed.
- If iterations seem unfocused, consider reducing
initial_seed_multiplier - If iterations aren’t exploring enough aspects, try increasing
max_iterations - If results are too literal, increase
alphafor more semantic search weight
Related Tools
Think Tool
For logging thoughts and reasoning processes
File Search Tool
For direct vector store searches
When to Choose Agentic Search vs. File Search
The Agentic Search tool shines for complex, multi-faceted queries requiring deep exploration, while File Search is better for direct, factual queries when you know exactly what you’re looking for.
- Use Agentic Search when: You need comprehensive research on complex topics, comparative analysis, or multi-step problem solving.
- Use File Search when: You need quick answers to specific questions, looking up known information, or when resource constraints are a concern.