Skip to main content

Memuri is a self‑hosted memory infrastructure for AI applications, offering a unified, pluggable SDK to persist and retrieve conversational context with sub‑second latency. It enables any AI agent or assistant to remember key information across sessions—so your apps never forget what matters, while retaining full flexibility to swap storage backends, embedding models, and retrieval strategies.

Project description

Memuri - High-Performance Memory SDK

Memuri is a pip-installable SDK for high-performance, pluggable conversational memory services. Designed for local, self-hosted deployment with sub-second latency and production-grade practices.

Key Features

  • Self-hosted: No external dependencies or licenses required
  • High Performance: Sub-100ms memory operations with Faiss and Redis caching
  • Pluggable Architecture: Swap vector databases, task queues, and LLMs without code changes
  • Production-grade: Integrated OpenTelemetry traces, health checks, and robust CI/CD
  • Memory Categories: Organize context by category (PERSONAL, TASK, QUESTION, etc.)
  • Feedback Loop: Adaptive classification based on user feedback
  • Reranking: Advanced cross-encoder reranking for more relevant results
  • Flexible Configuration: Easy configuration with environment variables, dictionary-based config, or direct settings
  • Multiple Embedding Providers: Support for OpenAI, Google Gemini, Azure, and Sentence Transformers

Getting Started

pip install memuri

Basic Usage

from memuri import Memuri

# Initialize memory with default settings
memory = Memuri()

# Add a memory item
memory.add_memory(content="John's favorite color is blue", category="PERSONAL")

# Search for relevant memories
results = memory.search_memory("What does John like?")
print(results)

Using Config Dictionary

import os
from memuri import Memuri

# Set API key in environment variable
os.environ["OPENAI_API_KEY"] = "your_api_key"

# Create config with specific provider settings
config = {
    "embedder": {
        "provider": "openai",
        "config": {
            "model": "text-embedding-ada-002"
        }
    }
}

# Initialize with config
memory = Memuri.from_config(config)

Storing Chat Conversations

# Add a conversation as memory
messages = [
    {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
    {"role": "assistant", "content": "How about sci-fi? I recommend Interstellar."},
    {"role": "user", "content": "I love sci-fi movies!"}
]

# Store the conversation with user ID
await memory.add(messages, user_id="john")

Architecture

Memuri is designed around a layered memory system:

  1. Short-Term Memory: HNSW In-Memory Index + Redis LRU Cache
  2. Long-Term Memory: Pluggable Vector Stores (pgvector, Milvus, Qdrant, Redis Vector)
  3. Memory Triggers: Category classifiers and rule engine for contextual decisions
  4. Feedback Loop: Continuous adaptation based on user interactions

Next Steps

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

memuri-0.1.0.tar.gz (41.6 kB view details)

Uploaded Source

Built Distribution

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

memuri-0.1.0-py3-none-any.whl (55.4 kB view details)

Uploaded Python 3

File details

Details for the file memuri-0.1.0.tar.gz.

File metadata

  • Download URL: memuri-0.1.0.tar.gz
  • Upload date:
  • Size: 41.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for memuri-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d12aaf8a7f782826b2d69d25eeae0b76596ac2ac5b768ee3c600ae3a09c03e24
MD5 435eaa27cce4f3f454fae1c236805ac2
BLAKE2b-256 f5d0d2438bbab5a7bb6120af3086a5c94ba4442b0022cf0fa772391d54391c1f

See more details on using hashes here.

File details

Details for the file memuri-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: memuri-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 55.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for memuri-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a88a6589db11fc8fb5fa8b7ff1246b727732e0ebc5c435f0e73665688efb92d2
MD5 2025f6bf4add59634f08c853d90b0c70
BLAKE2b-256 e647807143627477abbad1bb0da41423eb70c097a4011ce1f7e61f0c0f9651be

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