Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mneno.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Installation

Install Mneno using pip:
pip install mneno

Basic Usage

Here is a simple example of how to use Mneno to add memories and search through them.
from mneno import MemoryClient

# Initialize the client (defaults to in-memory storage)
client = MemoryClient()

# Add memories
client.add(
    "The user is building Mneno, a Python SDK for explainable AI memory.",
    memory_type="semantic",
    importance=0.9,
    tags=["project", "mneno"],
)

client.add(
    "User prefers lightweight Python-first SDKs.",
    memory_type="preference",
    importance=0.85,
)

# Search memories
results = client.search("What is the user building?")

for result in results:
    print(f"Content: {result.memory.content}")
    print(f"Score: {result.score.total}")
    print(f"Reasons: {result.score.reasons}")

Build Context for Prompts

Mneno can help you build the perfect context for your LLM prompts, ensuring you stay within a token budget.
# Build a context package with a 50-token budget
context = client.build_context("What is the user building?", budget=50)

print(context.text)

# See why items were included
for item in context.included:
    print(f"Included: {item.memory_id} (Reason: {item.reason})")

Next Steps

Scoring

Learn how Mneno ranks memories.

Compaction

Prevent context rot with auto-compaction.

Storage

Configure persistent storage.

Providers

Integrate with embeddings and rerankers.