Add Azure CosmosDB MongoDB vCore option for agent memory
This is pretty much an exact duplication of the current teachability code, except it uses MongoDB vCore instead of ChromaDB. Why? Because ChromaDB stores all its information in memory, so it is not ideal for long conversations or for containers/vms that delete everything on restart. This allows memories to be stored and recalled via a permanent database rather than an ephemeral one, and it is not stored in memory on the virtual machine so it will not slow down the execution of the agent workflow.
@sonichi @victordibia
Why are these changes needed?
Currently, AutoGen stores memories using ChromaDB. While easy to use and capable, ChromaDB must store information in memory, which is difficult for low-memory virtual machines like Azure WebApps or FuntionApps (they have around 500mb). These files allow AutoGen to store memories in an external vector database using Azure CosmosDB for MongoDB vCore and perform vector searches on them.
The code automatically sets up the vector databases and creates vector indexes on them.
Related issue number
Closes Issue #3066
Checks
- [ ] I've included any doc changes needed for https://microsoft.github.io/autogen/. See https://microsoft.github.io/autogen/docs/Contribute#documentation to build and test documentation locally.
- [X] I've added tests (if relevant) corresponding to the changes introduced in this PR.
- [ ] I've made sure all auto checks have passed.
I like the idea of extending to different vector DBs. Can we do it without code duplication? @thinkall does the current vector DB abstraction allow an extensible design here?
@sonichi thank you for your response. I would love to do this without any code duplication, but the original memory module has ChromaDB entangled in the code, no abstractions or interfaces at all. I had to pretty much rewrite everything from scratch.
Hi @tyler-suard-parker - it looks like things have evolved quite a bit since you sent in this valuable contribution. Think about whether you would like to update with @thinkall's suggestions or perhaps engage with us on the new 0.4 codebase. Closing for now and please reopen if you want to revive this work.
@rysweet That is the nicest closing message I have ever received on a pull request. Thank you!