When and how to use Standard Mode

All of AgentQL's query methods allow you to control how the data is retrieved by changing its operational mode to either 'standard' or 'fast' response times. Fast Mode is enabled by default, but you can switch to Standard Mode for a more comprehensive response.

Overview

This guide will show you how to change the mode for data queries.

Example of changing to Standard Mode

All of AgentQL's query methods allow you to specify a mode for querying, offering a choice between two modes:

  • Standard Mode: This mode ensures a thorough response that may take slightly longer.
  • Fast Mode: This mode provides quicker responses. It sacrifices some depth of analysis for speed, making it useful for cases where performance is a priority. This is the default mode.

Here's how you can utilize query_data with Standard Mode enabled:

fast_mode.py
python
query = """
{
    blog_posts {
        title
        author
    }
}
"""

async def query_example():
    data = await page.query_data(
        query=query,
        mode="standard"  # Switch to 'fast' for more fundamental data extraction
    )
    print(data)

Advantages of using Standard Mode

Standard Mode is ideal when accuracy and detailed extraction are critical or when interacting with complex web sites.

Fast Mode is beneficial when you need a quick response and can tolerate some loss in data depth and works for most usecases.

Conclusion

AgentQL's Standard Mode is a powerful tool for complex data extraction. It's a great choice for complex web pages or when data depth is a priority. For most usecases, however, Fast Mode is sufficient.