Spaces:
Running
Running
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -2,118 +2,87 @@
|
|
| 2 |
title: Mnemo v2 - AI Memory System
|
| 3 |
emoji: π§
|
| 4 |
colorFrom: purple
|
| 5 |
-
colorTo:
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 5.9.1
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
| 11 |
-
short_description:
|
| 12 |
tags:
|
| 13 |
- memory
|
| 14 |
- ai-memory
|
| 15 |
- llm-memory
|
| 16 |
-
- memory-system
|
| 17 |
- semantic-memory
|
| 18 |
-
- long-term-memory
|
| 19 |
-
- conversational-memory
|
| 20 |
-
- chatbot-memory
|
| 21 |
-
- agent-memory
|
| 22 |
-
- rag
|
| 23 |
-
- retrieval
|
| 24 |
-
- semantic-search
|
| 25 |
-
- vector-search
|
| 26 |
-
- embeddings
|
| 27 |
- sentence-transformers
|
| 28 |
- faiss
|
| 29 |
- hnsw
|
| 30 |
- temporal-decay
|
| 31 |
-
- langchain
|
| 32 |
-
- llamaindex
|
| 33 |
- mem0
|
| 34 |
-
- memgpt
|
| 35 |
-
- zep
|
| 36 |
- mcp
|
| 37 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
---
|
| 39 |
|
| 40 |
-
# π§ Mnemo v2 - Enhanced Memory for LLMs
|
| 41 |
|
| 42 |
-
|
| 43 |
|
| 44 |
-
## β¨
|
| 45 |
|
| 46 |
-
| Feature |
|
| 47 |
-
|---------|-------------
|
| 48 |
-
| **
|
| 49 |
-
| **
|
| 50 |
| **Temporal Decay** | Ebbinghaus forgetting curve (configurable half-life) |
|
| 51 |
-
| **
|
| 52 |
-
| **
|
| 53 |
-
| **Multi-User** |
|
|
|
|
| 54 |
|
| 55 |
## π Quick Start
|
| 56 |
|
| 57 |
-
|
| 58 |
-
|
|
|
|
|
|
|
| 59 |
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
# Add memories
|
| 63 |
-
memory.add("User prefers Python for backend development", importance=0.9)
|
| 64 |
-
memory.add("Meeting with team every Monday at 10am")
|
| 65 |
-
|
| 66 |
-
# Search with relevance scoring
|
| 67 |
-
results = memory.search("What programming language does the user prefer?")
|
| 68 |
-
for r in results:
|
| 69 |
-
print(f"{r['content']} (relevance: {r['relevance_score']:.2f})")
|
| 70 |
-
```
|
| 71 |
-
|
| 72 |
-
## π Architecture
|
| 73 |
|
| 74 |
```
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
## π§ Configuration
|
| 90 |
-
|
| 91 |
-
```python
|
| 92 |
-
memory = MnemoV2(
|
| 93 |
-
decay_half_life_days=7.0, # Memory decay rate
|
| 94 |
-
similarity_weight=0.4, # Weight for semantic similarity
|
| 95 |
-
recency_weight=0.3, # Weight for recency
|
| 96 |
-
frequency_weight=0.3, # Weight for access frequency
|
| 97 |
-
update_threshold=0.85, # Similarity for UPDATE vs ADD
|
| 98 |
-
max_memories_per_user=10000 # Auto-pruning limit
|
| 99 |
-
)
|
| 100 |
```
|
| 101 |
|
| 102 |
-
##
|
| 103 |
|
| 104 |
-
| Metric |
|
| 105 |
-
|--------|-------
|
| 106 |
-
|
|
| 107 |
-
|
|
| 108 |
-
|
|
| 109 |
-
|
|
| 110 |
-
| Deduplication | None | Auto UPDATE detection |
|
| 111 |
|
| 112 |
-
## π
|
| 113 |
|
| 114 |
-
- **
|
| 115 |
-
- **
|
| 116 |
|
| 117 |
-
## License
|
| 118 |
|
| 119 |
-
MIT License
|
|
|
|
| 2 |
title: Mnemo v2 - AI Memory System
|
| 3 |
emoji: π§
|
| 4 |
colorFrom: purple
|
| 5 |
+
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 5.9.1
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
| 11 |
+
short_description: AI memory with semantic embeddings & temporal decay
|
| 12 |
tags:
|
| 13 |
- memory
|
| 14 |
- ai-memory
|
| 15 |
- llm-memory
|
|
|
|
| 16 |
- semantic-memory
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
- sentence-transformers
|
| 18 |
- faiss
|
| 19 |
- hnsw
|
| 20 |
- temporal-decay
|
|
|
|
|
|
|
| 21 |
- mem0
|
|
|
|
|
|
|
| 22 |
- mcp
|
| 23 |
+
- rag
|
| 24 |
+
- retrieval
|
| 25 |
+
- embeddings
|
| 26 |
+
- vector-search
|
| 27 |
+
- zerogpu
|
| 28 |
---
|
| 29 |
|
| 30 |
+
# π§ Mnemo v2 - Enhanced Memory System for LLMs
|
| 31 |
|
| 32 |
+
Production-ready memory layer for AI applications with **real semantic embeddings**, **O(log n) vector search**, and **temporal decay**.
|
| 33 |
|
| 34 |
+
## β¨ Features
|
| 35 |
|
| 36 |
+
| Feature | Description |
|
| 37 |
+
|---------|-------------|
|
| 38 |
+
| **Semantic Embeddings** | `sentence-transformers/all-MiniLM-L6-v2` (384 dimensions) |
|
| 39 |
+
| **Vector Search** | FAISS HNSW index with O(log n) complexity |
|
| 40 |
| **Temporal Decay** | Ebbinghaus forgetting curve (configurable half-life) |
|
| 41 |
+
| **Relevance Scoring** | Composite: 40% similarity + 30% recency + 30% frequency |
|
| 42 |
+
| **Smart Deduplication** | Automatic UPDATE detection for similar memories |
|
| 43 |
+
| **Multi-User** | Full user_id scoping with per-user indices |
|
| 44 |
+
| **ZeroGPU** | Dynamic H200 GPU allocation for fast inference |
|
| 45 |
|
| 46 |
## π Quick Start
|
| 47 |
|
| 48 |
+
1. **Load Examples**: Click "Load Examples" to populate test memories
|
| 49 |
+
2. **Search**: Ask semantic queries like "What are the user's preferences?"
|
| 50 |
+
3. **Add**: Store new memories with importance weights and tags
|
| 51 |
+
4. **Manage**: List, delete, or clear memories
|
| 52 |
|
| 53 |
+
## π¬ Architecture
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
```
|
| 56 |
+
Query β Sentence-Transformer β 384-dim Embedding
|
| 57 |
+
β
|
| 58 |
+
βΌ
|
| 59 |
+
FAISS HNSW Index
|
| 60 |
+
(M=32, efSearch=50)
|
| 61 |
+
β
|
| 62 |
+
βΌ
|
| 63 |
+
Relevance Scoring
|
| 64 |
+
ββ 40% Similarity
|
| 65 |
+
ββ 30% Recency (decay)
|
| 66 |
+
ββ 30% Frequency
|
| 67 |
+
β
|
| 68 |
+
βΌ
|
| 69 |
+
Ranked Results
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
```
|
| 71 |
|
| 72 |
+
## π Performance
|
| 73 |
|
| 74 |
+
| Metric | Value |
|
| 75 |
+
|--------|-------|
|
| 76 |
+
| Search Latency (GPU) | ~15-30ms |
|
| 77 |
+
| Embedding Dimensions | 384 |
|
| 78 |
+
| Index Type | HNSW Flat |
|
| 79 |
+
| Decay Half-Life | 7 days (configurable) |
|
|
|
|
| 80 |
|
| 81 |
+
## π Related
|
| 82 |
|
| 83 |
+
- **MCP Server**: [AthelaPerk/mnemo-mcp](https://huggingface.co/spaces/AthelaPerk/mnemo-mcp)
|
| 84 |
+
- **Inspired by**: [mem0](https://mem0.ai)
|
| 85 |
|
| 86 |
+
## π License
|
| 87 |
|
| 88 |
+
MIT License - free for commercial use.
|