Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,76 @@ result = agent.tool.elasticsearch_memory(
)
```

### MongoDB Atlas Memory

**Note**: This tool requires AWS account credentials to generate embeddings using Amazon Bedrock Titan models.

```python
from strands import Agent
from strands_tools.mongodb_memory import mongodb_memory

# Create agent with direct tool usage
agent = Agent(tools=[mongodb_memory])

# Store a memory with semantic embeddings
result = agent.tool.mongodb_memory(
action="record",
content="User prefers vegetarian pizza with extra cheese",
metadata={"category": "food_preferences", "type": "dietary"},
cluster_uri="mongodb+srv://user:[email protected]",
database_name="memory_db",
collection_name="memories",
namespace="user_123"
)

# Search memories using semantic similarity (vector search)
result = agent.tool.mongodb_memory(
action="retrieve",
query="food preferences and dietary restrictions",
max_results=5,
cluster_uri="mongodb+srv://user:[email protected]",
database_name="memory_db",
collection_name="memories",
namespace="user_123"
)

# Use configuration dictionary for cleaner code
config = {
"cluster_uri": "mongodb+srv://user:[email protected]",
"database_name": "memory_db",
"collection_name": "memories",
"namespace": "user_123"
}

# List all memories with pagination
result = agent.tool.mongodb_memory(
action="list",
max_results=10,
**config
)

# Get specific memory by ID
result = agent.tool.mongodb_memory(
action="get",
memory_id="mem_1234567890_abcd1234",
**config
)

# Delete a memory
result = agent.tool.mongodb_memory(
action="delete",
memory_id="mem_1234567890_abcd1234",
**config
)

# Use environment variables for configuration
result = agent.tool.mongodb_memory(
action="record",
content="User prefers vegetarian pizza"
# cluster_uri, database_name, etc. will be read from environment variables
)
```

## 🌍 Environment Variables Configuration

Agents Tools provides extensive customization through environment variables. This allows you to configure tool behavior without modifying code, making it ideal for different environments (development, testing, production).
Expand Down Expand Up @@ -1105,9 +1175,38 @@ The Mem0 Memory Tool supports three different backend configurations:

#### Retrieve Tool

| Environment Variable | Description | Default |
|----------------------|-------------|---------|
#### Retrieve Tool

| Environment Variable | Description | Default |
|----------------------|-------------|---------|
| RETRIEVE_ENABLE_METADATA_DEFAULT | Default setting for enabling metadata in retrieve tool responses | false |
>>>>>>> origin/main
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
>>>>>>> origin/main

Can we remove this too ^^

| RETRIEVE_ENABLE_METADATA_DEFAULT | Default setting for enabling metadata in retrieve tool responses | false |

#### MongoDB Atlas Memory Tool

| Environment Variable | Description | Default |
|----------------------|-------------|---------|
| MONGODB_ATLAS_CLUSTER_URI | MongoDB Atlas connection URI | None |
| MONGODB_DATABASE_NAME | Default database name for MongoDB operations | memory_db |
| MONGODB_COLLECTION_NAME | Default collection name for MongoDB operations | memories |
| MONGODB_NAMESPACE | Default namespace for memory isolation | default |
| MONGODB_EMBEDDING_MODEL | Bedrock model for generating embeddings | amazon.titan-embed-text-v2:0 |

#### Retrieve Tool

| Environment Variable | Description | Default |
|----------------------|-------------|---------|
| RETRIEVE_ENABLE_METADATA_DEFAULT | Default setting for enabling metadata in retrieve tool responses | false |
=======
#### Retrieve Tool

| Environment Variable | Description | Default |
|----------------------|-------------|---------|
| RETRIEVE_ENABLE_METADATA_DEFAULT | Default setting for enabling metadata in retrieve tool responses | false |
>>>>>>> origin/main
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

Choose a reason for hiding this comment

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

Looks like the conflict resolution is not done here ^^

Suggested change
>>>>>>> origin/main


#### Video Tools

Expand Down
Loading