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 aby_idGSI and a vector index onembedding(cosine,dimensions) whose search schema declaresPKas an inline filter. Auto-created (PAY_PER_REQUEST); the vector index can only be declared at creation, so use a new table to changedimensions. searchruns nativeSearchVectorsonce per concrete scope under the requested prefix (DynamoDB allows only equality on a string search-schema attribute), merges by similarity (1 - distance), then appliescategories/metadata_filter/min_scoreon the candidates (oversampled ×3 when filtering).- Scope tree, category counts,
list_records,delete(older_than=...),reset,touch_recordsare query/scan based — sized for agent-memory volumes. dimensionsmust equal theMemoryembedder's output size (CrewAI defaulttext-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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| crewai_memory_dynamodb-0.1.0.tar.gz | 5.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| crewai_memory_dynamodb-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.6 kB
Release files / crewai_memory_dynamodb-0.1.0.tar.gz
| Download URL | crewai_memory_dynamodb-0.1.0.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a688958223b0fbde536ca70a789a821e13b15e470422025edc68b5c5d621d8e
|
|
BLAKE2b-256 checksum How to use checksums |
0c7af9df6373b553ac0625bfcf52fad12c9a9e8968d060e23637f292a1aa373f
|
| 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.0-py3-none-any.whl
| Download URL | crewai_memory_dynamodb-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
75695b0392ef2703dd541ccb70ebfe9b8c7b2fb8044145c9f85981eaf6eb9eec
|
|
BLAKE2b-256 checksum How to use checksums |
13ea4e67a92e122ba82b4940668567835431d2030c0f13bd46b508da44a10a9c
|
| 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}
|