strands-mongodb-store
A MongoDB Vector Search MemoryStore for Strands Agents — semantic long-term agent memory using Automated Embedding: MongoDB generates the embeddings itself (via Voyage AI), so you store plain text and query with plain text — no external embedder, no vectors to manage.
pip install strands-mongodb-store
from strands import Agent
from strands.memory import MemoryManager
from strands_mongodb_store import MongoDBMemoryStore
store = MongoDBMemoryStore(
name="user-memories",
connection_string="mongodb://localhost:27017", # self-managed, or an Atlas SRV URI
database_name="agent", collection_name="memory",
model="voyage-4-lite",
)
agent = Agent(memory_manager=MemoryManager(stores=[store]))
await store.add("The user prefers dark mode", metadata={"kind": "pref"})
hits = await store.search("what theme does the user like?")
How it works
- Automated Embedding. The vector index is created with a
type: "autoEmbed"field and a Voyage model; MongoDB embeds yourcontentat index-time and your query text at query-time.addstores just{_id, content, metadata, createdAt}— no vectors in your documents. - Semantic recall via
$vectorSearch("query": <text>), ranked byvectorSearchScore, surfaced as_score. - The vector index is created automatically if absent.
Requirements
MongoDB Vector Search with Automated Embedding, on either:
- MongoDB Atlas, or
- self-managed MongoDB Community 8.2+ running the
mongotbinary (Linux; Docker / tarball / package / K8s).
Automated Embedding needs a Voyage AI API key configured on the deployment (Atlas, or mongot for Community). Models: voyage-4-lite (default), voyage-4, voyage-4-large, voyage-code-3.
The memory store (
strands-mongodb-store) is distinct from the byte storage backend (strands-mongodb-storage). Also published asstrands-store-mongodb. 0.2.0 switched from manual embeddings to Automated Embedding (breaking).
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file strands_mongodb_store-0.2.0.tar.gz.
File metadata
- Download URL: strands_mongodb_store-0.2.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aaaa83ac7ff6058c93ed30a171a7796e06f7607639b169fee5a78e34edc1fbab
|
|
| MD5 |
aaf91aa4e6f7adb8432e648984ba49d7
|
|
| BLAKE2b-256 |
4e96dd51d2eef7867aea1c90f41ae97f779d10f06577c5de8bf7537cfeaf53cc
|
File details
Details for the file strands_mongodb_store-0.2.0-py3-none-any.whl.
File metadata
- Download URL: strands_mongodb_store-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aca10e9b7914055885d6a2f5cd3becdc0854e3213fb1f5822137d6d787dcde75
|
|
| MD5 |
212ded54396ae15b28cc0eec0889cee9
|
|
| BLAKE2b-256 |
d8774d4ad8c77b8da53eb26c1a1af7a93513ca55ae11b8ba3a3ba6aa60f35ff6
|