Skip to main content
Agno supports using MongoDB asynchronously, with the AsyncMongoDb class.
v2 Migration Support: If you’re upgrading from Agno v1, MongoDB is fully supported in the v2 migration script. See the migration guide for details.

Usage

Install the pymongo (4.9 or later, for the async client) and openai packages:
motor clients are also supported, but motor is deprecated. Use PyMongo’s async client instead.
async_mongodb_for_agent.py

Run MongoDB

Install docker desktop and run MongoDB on port 27017 using:

Params