Skip to main content

Agno memory and toolkit integration backed by MuBit memory engine

Project description

mubit-agno

Agno memory and toolkit integration backed by the MuBit memory engine.

Installation

pip install mubit-agno[agno]

Quick Start

Memory DB — Persistent Agent Memory

Use MubitMemoryDb as the database backend for Agno's built-in memory system:

from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.memory.v2.memory import Memory
from mubit_agno import MubitMemoryDb

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

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

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",
    )],
)

# Agent can now call mubit_remember, mubit_recall, mubit_reflect,
# mubit_get_context, mubit_checkpoint, mubit_diagnose, mubit_memory_health
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 agno.memory.v2.memory import Memory
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"),
    memory=Memory(db=mubit.as_memory_db()),
    tools=[mubit.as_toolkit()],
)

# MAS coordination
mubit.register_agent("researcher", role="researcher",
                      read_scopes=["fact", "lesson"],
                      write_scopes=["trace", "lesson"])
mubit.checkpoint("Phase 1", "Research complete")
mubit.record_outcome("task-1", "success", rationale="All sources verified")
strategies = mubit.surface_strategies()

Extended Features

The MubitAgnoMemory wrapper provides full MAS capabilities:

  • Context: get_context(query) — pre-assembled memory context
  • Reflection: reflect() — extract lessons from evidence
  • Lessons: lessons() — list and filter learned lessons
  • Checkpoints: checkpoint(label, snapshot) — durable snapshots
  • Outcomes: record_outcome(ref, outcome) — RL-style feedback
  • 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) — exact reference storage
  • Dereference: dereference(ref_id) — fetch archived content
  • 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mubit_agno-0.5.2.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mubit_agno-0.5.2-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file mubit_agno-0.5.2.tar.gz.

File metadata

  • Download URL: mubit_agno-0.5.2.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for mubit_agno-0.5.2.tar.gz
Algorithm Hash digest
SHA256 35b402df853569f04cbe908bb2b6f3b02bfb33a702c2eb06e0610b047f24c349
MD5 454cf809e8489f43663fc29f9006f5da
BLAKE2b-256 14bf17ec6fb9d19e6c3a6cb5e2222140dbd965b3908582de88f38f81f1f64298

See more details on using hashes here.

File details

Details for the file mubit_agno-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: mubit_agno-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for mubit_agno-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3874492b6b42950319e4b4c9a495f77d22fec4611d6c75c118e05550a9a6747e
MD5 a3e8196c095b60b673d07da612e2f72c
BLAKE2b-256 a3c37192658086060a7f5af10cb6a38bd256dc04f18ba7457f549952d4126e48

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page