microsoft / autogen

A programming framework for agentic AI 🤖
https://microsoft.github.io/autogen/
Creative Commons Attribution 4.0 International
34.85k stars 5.05k forks source link

[Feature Request]: A Cache.merge() function #2791

Open kangxin opened 6 months ago

kangxin commented 6 months ago

Is your feature request related to a problem? Please describe.

I used to run an AutoGen program with cache saved on the disk on multiple machines using the following code, with data split:

with Cache.disk(cache_seed=seed) as cache:

Now, I want to run it on a single machine with all the data, which requires merging the cache from multiple machine disks. Currently, I have not found a way to do this.

If you need any further modifications or additions, please let me know.

Describe the solution you'd like

I noticed that there is a cache.db file in the .cache directory. It would be helpful if there were a function like Cache.merge([<list of cache.db file names>], seed) to generate a merged cache.db.

Additional context

No response

jtoy commented 6 months ago

Just to make it clear, is the thought to be able to move the cache between different machines? this particular use case of merging caches seems like an outlier use case, but still none the less interesting.

kangxin commented 6 months ago

Thank you for the quick reply. The answer is yes. I have an experiment with thousands of testing examples, so I need to split the data across multiple machines, each with a separate cache. Now, I want to merge these caches to perform a thorough analysis of the entire experiment. This function would be extremely helpful in this context.