Skip to main content

crewai-memory-firestore

A Google Firestore StorageBackend for CrewAI's unified Memory — hierarchical scopes, categories, metadata filters, importance/recency, and native vector search via find_nearest.

pip install crewai-memory-firestore
from crewai import Crew
from crewai.memory import Memory
from crewai_memory_firestore import FirestoreMemoryBackend

backend = FirestoreMemoryBackend(project_id="my-project", collection="crewai_memory", dimensions=3072)  # match your embedder
memory = Memory(storage=backend)
crew = Crew(agents=[...], tasks=[...], memory=memory)

Or once for every Crew(memory=True): set_memory_storage_factory(lambda spec: FirestoreMemoryBackend(...)). Authentication uses Application Default Credentials.

How it works

  • One collection, one document per record (doc id = record id) with the embedding stored as a Firestore Vector.
  • search uses native find_nearest (cosine) after a scope pre-filter. A scope subtree is two queries (the exact scope, and the scope/… range) merged by similarity; score is 1 - distance. categories / metadata_filter / min_score are applied on the candidates.
  • Firestore requires a composite vector index scope ASC + embedding (flat, dims). With create_index=True (default) the backend creates it through the Admin API if missing; the build is asynchronous and vector queries fail with FAILED_PRECONDITION until it is READY (a few minutes). Needs datastore.indexes.create/list, or create it yourself and pass create_index=False:
gcloud firestore indexes composite create --collection-group=crewai_memory --query-scope=COLLECTION \
  --field-config=order=ASCENDING,field-path=scope \
  --field-config=vector-config='{"dimension":"3072","flat":"{}"}',field-path=embedding

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

License

MIT

Release files for crewai-memory-firestore 0.1.0

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-firestore 0.1.0
File Size Uploaded
crewai_memory_firestore-0.1.0.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for crewai-memory-firestore 0.1.0
File Interpreter ABI Platform
crewai_memory_firestore-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / crewai_memory_firestore-0.1.0.tar.gz

Download URL crewai_memory_firestore-0.1.0.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
355a865cd77491df8b8d720c3fff7f81d1db14c809bf5be2837a354b6369cd36
BLAKE2b-256 checksum
How to use checksums
c79cc099369d3dae150cea88b75e827ccb1ab17439d102fa7437e649507cf1f8
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_firestore-0.1.0-py3-none-any.whl

Download URL crewai_memory_firestore-0.1.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
354c727740745e81514cd48a8d8e15a71e138f3af1954c45a728e62ebacb6642
BLAKE2b-256 checksum
How to use checksums
27ca3045f1a32ab438b4c5702998d53cee3973596c266799305321452092ad0f
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.0 This release

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