Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Azure CosmosDB MongoDB vCore option for agent memory #3187

Closed
wants to merge 3 commits into from

Conversation

tyler-suard-parker
Copy link
Contributor

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

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
Copy link
Contributor

sonichi commented Jul 25, 2024

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?

@tyler-suard-parker
Copy link
Contributor Author

@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.

Copy link
Collaborator

@thinkall thinkall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we've a vectordb abstraction here https://github.com/microsoft/autogen/tree/main/autogen/agentchat/contrib/vectordb, it would be nice to update the code of teachability to leverage the vectordb abstraction, then we can support different vectordbs easily like we've done with RAG agent.

@ekzhu ekzhu changed the base branch from main to 0.2 October 2, 2024 18:27
@jackgerrits jackgerrits added the 0.2 Issues which were filed before re-arch to 0.4 label Oct 4, 2024
@rysweet rysweet added the awaiting-op-response Issue or pr has been triaged or responded to and is now awaiting a reply from the original poster label Oct 10, 2024
@rysweet
Copy link
Collaborator

rysweet commented Oct 12, 2024

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 rysweet closed this Oct 12, 2024
@tyler-suard-parker
Copy link
Contributor Author

@rysweet That is the nicest closing message I have ever received on a pull request. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.2 Issues which were filed before re-arch to 0.4 awaiting-op-response Issue or pr has been triaged or responded to and is now awaiting a reply from the original poster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants