Skip to main content

strands-mongodb-store

A MongoDB Atlas Vector Search MemoryStore for Strands Agents — semantic long-term agent memory via Atlas $vectorSearch. No external vector database.

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+srv://user:pass@cluster.mongodb.net",
    database_name="agent", collection_name="memory",
)
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

  • Semantic recall via Atlas $vectorSearch (approximate nearest-neighbor over a vector index), ranked by vectorSearchScore.
  • You bring the embeddings. Default embedder is Amazon Bedrock Titan Text v2 (1024-dim, cosine); pass any embedder callable.
  • Each add stores a document {_id, content, embedding, metadata, createdAt}; the Atlas vector index is created automatically if absent (create_index=True).

Requirements

MongoDB Atlas — Vector Search ($vectorSearch) is an Atlas feature; community/self-hosted MongoDB does not support it. For local development, use a managed store or the Postgres / DynamoDB memory stores.

The memory store (strands-mongodb-store) is distinct from the byte storage backend (strands-mongodb-storage). Also published as strands-store-mongodb.

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

strands_mongodb_store-0.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

strands_mongodb_store-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file strands_mongodb_store-0.1.0.tar.gz.

File metadata

  • Download URL: strands_mongodb_store-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.5

File hashes

Hashes for strands_mongodb_store-0.1.0.tar.gz
Algorithm Hash digest
SHA256 45b7498a63e9f3f50b36f307575dd00317f512b90880787bb4e36b48a21113d5
MD5 23d957b2f6368b55323cd54d6fc33b9c
BLAKE2b-256 b8071a6045acc22a0f20ef4cd63702292869a728aa84368b457f10a456ff8c8e

See more details on using hashes here.

File details

Details for the file strands_mongodb_store-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for strands_mongodb_store-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 789f75883d51ad2b97b83dc49acbc39d92797f629b441f3be15a555e010ce497
MD5 d49d785fec8e91c65a2158ae3bb8400b
BLAKE2b-256 11f1a1d5503c59fb0ff5c6e12669aaff8477ea4f32e0389cbd2a2764c0541a3f

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.0

2 files

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page