How to retrieve, combine & query your saved results with SQL
Quick methods for accessing and analyzing your automatically stored results from anywhere.
When you run a survey at Expected Parrot the results are automatically stored at your Coop account where you can view, share and export them at any time. You can also retrieve them at your workspace to analyze them locally using a variety of built-in methods for working with results.
Below we share some quick examples of methods for retrieving multiple sets of results at once, combining them, and analyzing them with SQL queries. This can be useful when you are re-running an experiment with different AI agents and/or language models, or want to compare fresh responses over time.
Retrieving saved results
When you run an EDSL survey, details about the survey job and results are displayed in your workspace while the job is running (you can also hide this output by passing verbose=False
):
When the job is completed the results are automatically stored at your Coop account, where you can view, organize, share and export them (a link to Results is in the job status details shown above):
You can retrieve stored results at any time by passing the unique identifier to the pull
method:
You can also give the results a unique alias, if desired:
This allows you to retrieve by alias instead:
Multiple results
If you want to retrieve several sets of results at once you can use the list
method to identify and select them. For example, say you reran the survey above multiple times with different models:
You can then specify which results to retrieve, e.g., the 3 most recent:
The page
specifies which set of 10 objects to look back to (1 by default, the most recent page) and page_size
specifies how many objects to return (10 by default). If you want to search results by survey job status or description instead you can call the method on Jobs
(all parameters are optional):
Once you’ve identified the relevant jobs or results you can use the fetch methods for instantiating the results. These are equivalent:
This returns a list of results objects. You can combine them to analyze them together (the columns must be identical):
Methods for analyzing results
Now all of the methods for working with results are available to us. For example, you can use the sql
method to run queries on the combined results:
If you want to share an analysis, or a notebook of code for reproducing it, you can post that to Coop as well:
Please see our docs for more examples of analytical methods and instructions for getting started. If you don’t see a method that you need, please post a message at our Discord channel or send us an email to request it.