Skip to main content

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 your content at index-time and your query text at query-time. add stores just {_id, content, metadata, createdAt} — no vectors in your documents.
  • Semantic recall via $vectorSearch ("query": <text>), ranked by vectorSearchScore, 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 mongot binary (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 as strands-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

strands_mongodb_store-0.2.0.tar.gz (4.9 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.2.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

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

Hashes for strands_mongodb_store-0.2.0.tar.gz
Algorithm Hash digest
SHA256 aaaa83ac7ff6058c93ed30a171a7796e06f7607639b169fee5a78e34edc1fbab
MD5 aaf91aa4e6f7adb8432e648984ba49d7
BLAKE2b-256 4e96dd51d2eef7867aea1c90f41ae97f779d10f06577c5de8bf7537cfeaf53cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for strands_mongodb_store-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aca10e9b7914055885d6a2f5cd3becdc0854e3213fb1f5822137d6d787dcde75
MD5 212ded54396ae15b28cc0eec0889cee9
BLAKE2b-256 d8774d4ad8c77b8da53eb26c1a1af7a93513ca55ae11b8ba3a3ba6aa60f35ff6

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

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