Metadata-Version: 2.3
Name: memuri
Version: 0.1.4
Summary: 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.
License: MIT
Author: Ankhbayasgalan anhbaysgalan1@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: aioredis (>=2.0.1,<3.0.0)
Requires-Dist: asyncpg (==0.30.0)
Requires-Dist: celery (==5.5.2)
Requires-Dist: faiss-cpu (==1.11.0)
Requires-Dist: google-genai (==1.16.1)
Requires-Dist: hnswlib (>=0.7.0,<0.8.0)
Requires-Dist: hydra-core (==1.3.2)
Requires-Dist: mkdocs (==1.6.1)
Requires-Dist: mkdocstrings (==0.29.1)
Requires-Dist: openai (==1.79.0)
Requires-Dist: opentelemetry-sdk (==1.33.1)
Requires-Dist: orjson (>=3.9.10,<4.0.0)
Requires-Dist: pgvector (==0.4.1)
Requires-Dist: prometheus-client (==0.22.0)
Requires-Dist: pydantic (==2.11.4)
Requires-Dist: pydantic-settings (>=2.1.0,<3.0.0)
Requires-Dist: pymilvus (>=2.3.3,<3.0.0)
Requires-Dist: qdrant-client (>=1.7.0,<2.0.0)
Requires-Dist: redis (==6.1.0)
Requires-Dist: sentence-transformers (>=2.2.2,<3.0.0)
Requires-Dist: sqlalchemy (==2.0.41)
Requires-Dist: uvloop (==0.21.0)
Project-URL: Repository, https://github.com/username/memuri
Description-Content-Type: text/markdown

# 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

```bash
pip install memuri
```

### Basic Usage

```python
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

```python
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-3-small"
        }
    }
}

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

### Storing Chat Conversations

```python
# 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

- Check the [Quick Start](usage/quickstart.md) guide
- Learn about [Configuration](usage/configuration.md) options
- Explore [API Reference](api-reference/index.md) 
- Learn advanced patterns with [Cookbooks](cookbooks/index.md)
- View [Examples](examples/index.md) for complete solutions
- Run [Performance Tests](src/memuri/tests/README_TESTS.md) to evaluate latency
