Skip to main content

Prerequisites

The following example requires the memorisdk library.
pip install -U memorisdk

Example

The following agent can maintain persistent memory across conversations:
from agno.agent import Agent
from agno.tools.memori import MemoriTools

agent = Agent(
    instructions=[
        "You are a memory-enhanced assistant with persistent conversation history",
        "Remember important information about users and their preferences",
        "Use stored memories to provide personalized and contextual responses",
        "Maintain conversation continuity across sessions",
    ],
    tools=[
        MemoriTools(database_connect="sqlite:///memori.db", namespace="quick-memori")
    ],
)

agent.print_response("Remember that I prefer vegetarian recipes and I'm learning to cook Italian cuisine", stream=True)

Toolkit Params

ParameterTypeDefaultDescription
database_connectOptional[str]sqlite:///agno_memori_memory.dbDatabase connection string (SQLite, PostgreSQL, etc.).
namespaceOptional[str]"agno_default"Namespace for organizing memories (e.g., “agent_v1”, “user_session”).
conscious_ingestboolTrueWhether to use conscious memory ingestion.
auto_ingestboolTrueWhether to automatically ingest conversations into memory.
verboseboolFalseEnable verbose logging from Memori.
configOptional[Dict]NoneAdditional Memori configuration.
auto_enableboolTrueAutomatically enable the memory system on initialization.
enable_search_memoryboolTrueEnable memory search functionality.
enable_record_conversationboolTrueEnable conversation recording functionality.
enable_get_memory_statsboolTrueEnable memory statistics retrieval.
allboolFalseEnable all available tools.

Toolkit Functions

FunctionDescription
search_memorySearch through stored memories using queries.
record_conversationAdd important information or facts to memory.
get_memory_statsGet statistics about the memory system.
You can use include_tools or exclude_tools to modify the list of tools the agent has access to. Learn more about selecting tools.

Developer Resources

I