Skip to main content

mubit-crewai

CrewAI memory backend backed by MuBit.

This adapter provides a class that satisfies CrewAI's crewai.memory.storage.backend.StorageBackend protocol (verified against crewai>=1.14.6,<2), routing all memory operations through MuBit's control plane. Also includes an extended MubitCrewMemory class with MAS coordination helpers and the outcome-attribution loop.

Install

pip install mubit-crewai[crewai]

Basic usage

Drop-in StorageBackend

from mubit_crewai import MubitStorage
from crewai import Crew
from crewai.memory import Memory

storage = MubitStorage(api_key="mbt_...", session_id="crew-run-1")
crew = Crew(
    agents=[...],
    memory=Memory(storage=storage),
)

Extended MuBit features

from mubit_crewai import MubitCrewMemory, extract_entry_ids

memory = MubitCrewMemory(api_key="mbt_...", session_id="crew-run-1")
crew = Crew(agents=[...], memory=memory.as_crew_memory())

# Extended:
context = memory.get_context("What do we know about the customer?")
memory.checkpoint("Finished research phase")
memory.handoff("researcher", "writer", "Here are the findings...")

Outcome-attribution loop (v0.7.0)

Close the recall -> act -> credit loop so the entries that helped get reinforced, and process rewards land per step:

result = memory.recall("How did we resolve the last billing dispute?")
entry_ids = extract_entry_ids(result)       # reference_ids of recalled evidence
# ... the crew acts on the recalled context ...
memory.record_outcome(
    "task-123", "success",
    entry_ids=entry_ids,                     # credit the entries that helped
    verified_in_production=True,             # boost lessons confirmed in live use
)
memory.record_step_outcome("plan", outcome="success")  # per-step process reward

StorageBackend interface

Implements the full StorageBackend protocol — save, search, delete, update, get_record, list_records, get_scope_info, list_scopes, list_categories, count, reset, plus async asave/asearch/adelete.

Method MuBit mapping
save(records) control.ingest (intent from categories, idempotency keyed by record id)
search(query_embedding, ...) control.query, returns (MemoryRecord, score) tuples
delete(...) / reset() local-index delete / control.delete_run

A legacy save(value, metadata, agent_id) / search(query, limit, score_threshold) shim is retained for older callers.

Intent inference

The memory_type metadata key maps to MuBit intents:

memory_type MuBit intent
short_term trace
long_term lesson
entity fact

MuBit extension methods

  • remember() / recall() — direct write/read (idempotent writes, citations on recall)
  • get_context() — assembled context retrieval
  • checkpoint() — save memory state snapshot
  • record_outcome() — outcome feedback for tasks (with entry_ids + verified_in_production)
  • record_step_outcome() — per-step process reward
  • learned() — persist a confirmed lesson
  • surface_strategies() — strategy clusters from lessons
  • register_agent() — MAS agent registration
  • handoff() — agent-to-agent handoff
  • diagnose() — failure-path lesson surfacing

Module helpers extract_entry_ids(result) and extract_citations(result) are re-exported for closing the attribution loop on a recall() result.

Config

Parameter Default Purpose
endpoint http://127.0.0.1:3000 MuBit HTTP endpoint
api_key "" MuBit API key
session_id "default" Session/run scope
agent_id "crewai" Default agent ID

For tests, inject mubit_client directly.

Development

PYTHONPATH=sdk/python/mubit-sdk/src:integrations/python \
python3 -m unittest integrations.python.mubit_crewai.tests.test_storage -v

License

Apache-2.0

Metadata

Release files for mubit-crewai 0.6.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 mubit-crewai 0.6.0
File Size Uploaded Provenance Actions
mubit_crewai-0.6.0.tar.gz 15.9 kB Without provenance Details for mubit_crewai-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mubit-crewai 0.6.0
File Interpreter ABI Platform Actions
mubit_crewai-0.6.0-py3-none-any.whl Python 3 none any Details for mubit_crewai-0.6.0-py3-none-any.whl

Total release size: 25.9 kB

Release files / mubit_crewai-0.6.0.tar.gz

Download URL mubit_crewai-0.6.0.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2c48bb1dd718646253dd9b58a81d85d29cf1b755e13bb6b6166230cb8ddabf8c
BLAKE2b-256 checksum
How to use checksums
e818a472c193974caa75cf2b23ad6364316df811c3d1c06e26822e66fe3f2419
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / mubit_crewai-0.6.0-py3-none-any.whl

Download URL mubit_crewai-0.6.0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d36039fad056751362ddf3fd28b926773e93dc7eee02f250e3f90a67878dc7e
BLAKE2b-256 checksum
How to use checksums
44808008b09e98410733383ee1a59db8772a6cd824c8842d1f1b1f1ba8be37e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Security for mubit-crewai 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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