-
Notifications
You must be signed in to change notification settings - Fork 185
Description
Problem Statement
Strands agents presently lacks support for MongoDB Atlas.
MongoDB Atlas is one of the most popular cloud database platforms with:
π 100+ million downloads β 25,000+ GitHub stars
π’ Massive enterprise adoption across 100+ countries π Leading document database with built-in vector search capabilities
Users who prefer MongoDB Atlas (due to familiarity with document databases and existing infrastructure) cannot use it with strands, limiting memory options and creating inconsistency in the ecosystem.
Proposed Solution
Implement MongoDBMemoryToolProvider that provides:
Core Capabilities β
Semantic Search: Vector embeddings with MongoDB Atlas Vector Search β
Document Storage: Native JSON document storage with vector capabilities
β
Atlas Integration: Full MongoDB Atlas cloud platform support β
Enterprise Ready: Multi-tenant namespaces, error handling, security β
Strands Integration: Follows existing memory tool patterns
Technical Features
- Connection Flexibility: Support for MongoDB Atlas connection strings
- Full CRUD Operations: record, retrieve, list, get, delete
- Amazon Bedrock Integration: Titan embeddings (1024-dim vectors)
- Namespace Isolation: Multi-tenant memory separation
- Environment Configuration: Flexible setup options
- Vector Search Pipeline: Native $vectorSearch aggregation support
Benefits
For Strands Platform π― Market Expansion: Tap into MongoDB's massive developer base π§ Enterprise Appeal: Support existing MongoDB infrastructure investments
π Adoption Acceleration: Remove migration barriers for MongoDB users
For Users π° Cost Efficiency: Leverage existing MongoDB Atlas infrastructure β‘ Performance: Battle-tested, globally distributed vector search π οΈ Operational Simplicity: No new systems to learn/maintain π Enterprise Features: Security, compliance, monitoring built-in π Document Flexibility: Rich metadata support with native JSON storage
Use Case
This feature enables MongoDB Atlas users to build agentic AI workflows using strands with MongoDB Atlas for Agentic AI Memory.
Customer Need: Organizations already using MongoDB Atlas want to continue leveraging MongoDB for memory storage and are interested in using strands for agentic AI applications.
Alternatives Solutions
Implementation Status
π Pull Request: #281 - Complete implementation ready for review
Implementation Highlights:
- Full mongodb_memory.py implementation (650+ lines)
- 27 comprehensive unit tests with mocking
- Complete documentation with usage examples
- Environment variable configuration support
- Follows elasticsearch_memory.py patterns exactly
- MongoDB Atlas Vector Search integration
Additional Context
Usage Example
from strands import Agent
from strands_tools.mongodb_memory import mongodb_memory
# MongoDB Atlas Connection
agent = Agent(tools=[mongodb_memory])
# Store memory with semantic embeddings
result = agent.tool.mongodb_memory(
action="record",
content="User prefers vegetarian pizza with extra cheese",
cluster_uri="mongodb+srv://user:[email protected]/?retryWrites=true&w=majority",
database_name="memory_db",
collection_name="memories",
namespace="user_123"
)
# Semantic search
result = agent.tool.mongodb_memory(
action="retrieve",
query="food preferences",
max_results=5,
cluster_uri="mongodb+srv://user:[email protected]/?retryWrites=true&w=majority",
database_name="memory_db",
collection_name="memories",
namespace="user_123"
)
# Environment variable configuration
result = agent.tool.mongodb_memory(
action="record",
content="User prefers vegetarian pizza"
# cluster_uri, database_name, etc. read from environment variables
)