Skip to content

[FEATURE] mongodb atlas memory toolΒ #282

@ayanray089

Description

@ayanray089

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
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions