Optimizing Your Query
Last updated: March 28, 2025
1. Keep Your Query Under 400 Characters
For efficient processing, keep your query concise—under 400 characters. Think of it as a query for an agent performing web search, not long-form prompts. If your query exceeds the limit, you'll see this error:
Error:
{ "detail": { "error": "Query is too long. Max query length is 400 characters." } }
2. Break Your Query Into Smaller Sub-Queries
If your query is complex or covers multiple topics, consider breaking it into smaller, more focused sub-queries and sending them as separate requests. This approach improves efficiency and helps the API return more relevant results.
Bad Practice: Using a long, complex query.
Example:
Query: "Information regarding the history, financial performance, market positioning, recent developments, executive leadership, product offerings, customer demographics, strategic partnerships, mergers and acquisitions, regulatory challenges, competitor analysis, emerging market trends, technological advancements, and overall industry outlook for the company ABC and its key competitors within the industry, including recent reports, expert analyses, and predictions for future growth."
Good Practice: Breaking the query into smaller, more focused sub-queries.
Example:
Query 1: "Competitors of company ABC."
Query 2: "Financial performance of company ABC."
Query 3: "Recent developments of company ABC."
Query 4: "Latest industry trends related to ABC."