Skip to main content

crewai-memory-dynamodb

An Amazon DynamoDB StorageBackend for CrewAI's unified Memory — hierarchical scopes, categories, metadata filters, importance/recency, and native vector search via DynamoDB SearchVectors. No external vector database.

pip install crewai-memory-dynamodb
from crewai import Crew
from crewai.memory import Memory
from crewai_memory_dynamodb import DynamoDBMemoryBackend

backend = DynamoDBMemoryBackend(table_name="crewai-memory", dimensions=3072)   # match your embedder
memory = Memory(storage=backend)                                               # CrewAI does LLM analysis, scoping, scoring
crew = Crew(agents=[...], tasks=[...], memory=memory)

memory.remember("The customer prefers email over phone", scope="/customers/acme", categories=["preference"])
memory.recall("how should we contact acme?", scope="/customers")

Or register it once for every Crew(memory=True):

from crewai.memory.storage.factory import set_memory_storage_factory
set_memory_storage_factory(lambda spec: DynamoDBMemoryBackend("crewai-memory", dimensions=3072))

How it works

  • One table: PK = scope path, SK = record id, plus a by_id GSI and a vector index on embedding (cosine, dimensions) whose search schema declares PK as an inline filter. Auto-created (PAY_PER_REQUEST); the vector index can only be declared at creation, so use a new table to change dimensions.
  • search runs native SearchVectors once per concrete scope under the requested prefix (DynamoDB allows only equality on a string search-schema attribute), merges by similarity (1 - distance), then applies categories / metadata_filter / min_score on the candidates (oversampled ×3 when filtering).
  • Scope tree, category counts, list_records, delete(older_than=...), reset, touch_records are query/scan based — sized for agent-memory volumes.
  • dimensions must equal the Memory embedder's output size (CrewAI default text-embedding-3-large = 3072; Bedrock Titan v2 = 1024).

Requires boto3>=1.43.78 and a region where DynamoDB vector search is available. Permissions: DescribeTable, CreateTable, GetItem, PutItem, DeleteItem, BatchWriteItem, Query, Scan, SearchVectors.

Docs: https://skamalj.github.io/agentstate-reducer/ · part of crewai-memory

License

MIT

Release files for crewai-memory-dynamodb 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crewai-memory-dynamodb 0.1.1
File Size Uploaded
crewai_memory_dynamodb-0.1.1.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for crewai-memory-dynamodb 0.1.1
File Interpreter ABI Platform
crewai_memory_dynamodb-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.7 kB

Release files / crewai_memory_dynamodb-0.1.1.tar.gz

Download URL crewai_memory_dynamodb-0.1.1.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f43c6124ff503fbfd7b22e8a927c3bfaa72b8801327f2339203fb5a987ffe1e8
BLAKE2b-256 checksum
How to use checksums
c4274060a5656adb2df16e931d3d883b1430f6a9d36bcdfd28a00c366467f27e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / crewai_memory_dynamodb-0.1.1-py3-none-any.whl

Download URL crewai_memory_dynamodb-0.1.1-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
992564648e46c16f9483b6c9593cf12c4959a008c390ba3c014b54adf35baaa2
BLAKE2b-256 checksum
How to use checksums
ccc0787a098a606e41e0f793e0310417032119263fed22fc7ea570b4d8856e17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release 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