When and how to use Fast 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.

Overview

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

Example of changing to Fast 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 Fast Mode enabled:

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

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

Advantages of using Fast Mode

Fast Mode is ideal for quick data polling from changing web pages or light-weight, repeated queries on web pages.

Fast mode meets the bar for most tasks our users have, but if you need more data depth, Standard Mode is an option for complex extractions.

Conclusion

AgentQL's Fast Mode is a powerful tool for quick data extraction. It's a great choice for web pages or when speed is a priority. If you need more detailed data, you can switch to Standard /mode for a more comprehensive response.