Skip to main content

mubit-agno

Agno (v2) DB and toolkit integration backed by the MuBit memory engine.

Targets Agno v2's agno.db.base.BaseDb. (The pre-2.0 adapter implemented agno.memory.v2.db.base.MemoryDb, which was removed in Agno 2.0.)

Installation

pip install mubit-agno[agno]   # installs agno>=2.6,<3

Quick Start

DB — Persistent User Memory + Sessions

Use MubitAgnoDb as the db for an Agno agent. User memories persist to MuBit and sessions are mirrored as MuBit checkpoints:

from agno.agent import Agent
from agno.models.openai import OpenAIChat
from mubit_agno import MubitAgnoDb

agent = Agent(
    model=OpenAIChat(id="gpt-4o"),
    db=MubitAgnoDb(
        api_key="mbt_...",
        session_id="user-session-1",
        user_id="user-42",
    ),
    enable_user_memories=True,
)

agent.run("Remember that I prefer concise answers")
agent.run("What are my preferences?")  # Recalls from MuBit

MubitAgnoDb is a genuine BaseDb subclass: user-memory and session methods are MuBit-backed; the remaining BaseDb surfaces (metrics, evals, knowledge, culture, learnings, traces, spans) use lightweight local storage so the class is fully concrete.

Toolkit — Direct Memory Tools

Give agents LLM-callable tools for fine-grained memory control:

from agno.agent import Agent
from agno.models.openai import OpenAIChat
from mubit_agno import MubitToolkit

agent = Agent(
    model=OpenAIChat(id="gpt-4o"),
    tools=[MubitToolkit(api_key="mbt_...", session_id="research-run-1")],
)

# Tools: mubit_remember, mubit_recall, mubit_reflect, mubit_get_context,
# mubit_checkpoint, mubit_record_outcome, mubit_diagnose, mubit_memory_health.
# mubit_recall surfaces `citations` + `entry_ids` so the agent can close the
# loop with mubit_record_outcome(entry_ids=...).
agent.run("Store a lesson: always validate input before processing")
agent.run("What lessons have we learned?")

Convenience Wrapper — Full Integration

MubitAgnoMemory bundles both surfaces and adds MAS extensions:

from agno.agent import Agent
from agno.models.openai import OpenAIChat
from mubit_agno import MubitAgnoMemory

mubit = MubitAgnoMemory(api_key="mbt_...", session_id="crew-run-1", user_id="user-42")

agent = Agent(
    model=OpenAIChat(id="gpt-4o"),
    db=mubit.as_db(),
    tools=[mubit.as_toolkit()],
    enable_user_memories=True,
)

# MAS coordination
mubit.register_agent("researcher", role="researcher",
                     read_scopes=["fact", "lesson"], write_scopes=["trace", "lesson"])
mubit.checkpoint("Phase 1", "Research complete")

Closing the Attribution Loop (v0.7.0)

Recall, act, then credit the exact entries that helped — verified-in-production lessons get a ranking boost:

result = mubit.recall("deployment runbook")
entry_ids = mubit.extract_entry_ids(result, cited_only=True)  # only cited evidence
mubit.record_outcome(
    "success",
    entry_ids=entry_ids,
    verified_in_production=True,
    rationale="Followed the recalled runbook and the deploy passed",
)

# Per-step process rewards
mubit.record_step_outcome("validate-inputs", outcome="success")

Writes are idempotent: user-memory upserts thread both an upsert_key and an idempotency_key, so retried writes don't double-count reinforcement.

Extended Features

The MubitAgnoMemory wrapper provides full MAS capabilities:

  • Recall: recall(query) — evidence + citations + entry_ids
  • Context: get_context(query) — pre-assembled memory context
  • Reflection: reflect() — extract lessons from evidence
  • Lessons: lessons() / learned() / forget()
  • Checkpoints: checkpoint(label, snapshot) — durable snapshots
  • Outcomes: record_outcome(outcome, entry_ids=..., verified_in_production=...)
  • Step Outcomes: record_step_outcome(step_id) — per-step rewards
  • Strategies: surface_strategies() — pattern discovery
  • Agent Registration: register_agent(id, role, scopes) — MAS setup
  • Handoffs: handoff(from, to, content) — agent coordination
  • Feedback: feedback(handoff_id, verdict) — async evaluation
  • Archive: archive(content, kind) / dereference(ref_id)
  • Diagnostics: diagnose(error) — failure analysis
  • Health: memory_health() — quality assessment

Environment Variables

Variable Description Default
MUBIT_ENDPOINT MuBit server URL http://127.0.0.1:3000
MUBIT_API_KEY MuBit API key (empty for local dev)

License

Apache-2.0

Metadata

Release files for mubit-agno 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-agno 0.6.0
File Size Uploaded Provenance Actions
mubit_agno-0.6.0.tar.gz 21.1 kB Without provenance Details for mubit_agno-0.6.0.tar.gz

Built distribution (wheel)

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

Total release size: 35.4 kB

Release files / mubit_agno-0.6.0.tar.gz

Download URL mubit_agno-0.6.0.tar.gz
Size 21.1 kB
Tags Source
SHA-256 checksum
How to use checksums
76140ac05080abbedc4aaf4d4823ace98dc89b37a661d6d1be268a07c9f82704
BLAKE2b-256 checksum
How to use checksums
7300d2d2f48f345e6918c48cb4bba57a0ce20a36b811bff074ff228ae222fff4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

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

Download URL mubit_agno-0.6.0-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d0a78ce60ee6e8db560896f072e84f14f9d50330bff65497a558629196cbf430
BLAKE2b-256 checksum
How to use checksums
488d393416d0d3cfca15d9bfa8eff3c53f3e4745274db60c505242f3898feb1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Security for mubit-agno 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