AthelaPerk commited on
Commit
fb0e934
·
verified ·
1 Parent(s): d0eb5f0

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +67 -138
README.md CHANGED
@@ -1,3 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # Mnemo: Semantic-Loop Memory
2
 
3
  > *Named after Mnemosyne, Greek goddess of memory*
@@ -7,6 +23,10 @@
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
  [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
9
 
 
 
 
 
10
  ---
11
 
12
  ## 🏆 Benchmarks vs mem0
@@ -38,6 +58,12 @@
38
 
39
  ## 🚀 Quick Start
40
 
 
 
 
 
 
 
41
  ```python
42
  from mnemo import Mnemo
43
 
@@ -51,40 +77,29 @@ m.add("Team meeting every Tuesday at 2pm")
51
 
52
  # Search (0.27ms average!)
53
  results = m.search("notification preferences")
54
- print(results)
55
 
56
- # With feedback learning
57
- m.feedback("notification preferences", "mem_001", relevance=0.9)
58
- # Future searches now boosted based on feedback
59
  ```
60
 
61
  ---
62
 
63
  ## 🧠 Architecture
64
 
65
- Mnemo uses a **Semantic-Loop Memory** architecture:
66
-
67
  ```
68
  ┌─────────────────────────────────────────────────────────────┐
69
  │ MNEMO │
70
  ├─────────────────────────────────────────────────────────────┤
71
- │ │
72
  │ Query → [Intent Detection] → [Multi-Strategy Retrieval] │
73
-
74
- ▼ ▼
75
- ┌──────────────┐ ┌─────────────────────────┐
76
- Parse Semantic BM25 Graph
77
- Intent │ │ (50%) │ (30%) │ (20%) │ │
78
- └──────────────┘ └─────────────────────────┘
79
- │ │
80
- ▼ ▼
81
- │ ┌──────────────┐ ┌──────────────┐ │
82
- │ │ Knowledge │◄───────►│ Feedback │ │
83
- │ │ Graph │ │ Loop │ │
84
- │ └──────────────┘ └──────────────┘ │
85
- │ │ │
86
- │ [Learns & Improves] │
87
- │ │
88
  └─────────────────────────────────────────────────────────────┘
89
  ```
90
 
@@ -99,85 +114,43 @@ Mnemo uses a **Semantic-Loop Memory** architecture:
99
 
100
  ---
101
 
102
- ## 🔧 Installation
103
-
104
- ```bash
105
- pip install mnemo-memory
106
- ```
107
-
108
- Or from source:
109
- ```bash
110
- git clone https://github.com/yourusername/mnemo
111
- cd mnemo
112
- pip install -e .
113
- ```
114
-
115
- ### Dependencies
116
- ```
117
- faiss-cpu
118
- networkx
119
- rank_bm25
120
- numpy
121
- ```
122
-
123
- ---
124
-
125
- ## 📖 Advanced Usage
126
 
127
- ### Query with Intent Detection
128
 
129
  ```python
130
  from mnemo import Mnemo
131
 
132
- m = Mnemo()
133
- m.add("Cardiovascular disease affects the heart and blood vessels")
134
-
135
- result = m.search("What is heart disease?")
136
- print(result['intent']) # 'factual'
137
- print(result['results']) # Retrieved memories
138
- ```
139
-
140
- ### Feedback Learning
141
-
142
- ```python
143
- # Record what was helpful
144
- m.feedback(
145
- query="heart disease",
146
- memory_id="med_001",
147
- relevance=0.9 # Very relevant
148
  )
149
 
150
- m.feedback(
151
- query="heart disease",
152
- memory_id="tech_001",
153
- relevance=-0.5 # Not relevant
154
- )
155
 
156
- # Future searches automatically adjusted
157
- ```
 
 
158
 
159
- ### Knowledge Graph
 
160
 
161
- ```python
162
- # Entities are automatically extracted and linked
163
- m.add("Dr. Smith at Mayo Clinic studies cardiac diseases")
164
-
165
- # Query relationships
166
- graph = m.get_knowledge_graph()
167
- neighbors = graph.get_neighbors("Dr. Smith")
168
  ```
169
 
170
- ### System Stats
171
 
172
  ```python
173
- stats = m.get_stats()
174
- print(stats)
175
- # {
176
- # 'vector_store': {'size': 100, 'searches': 50},
177
- # 'knowledge_graph': {'entities': 45, 'relations': 23},
178
- # 'cache': {'hit_rate': '34.5%'},
179
- # 'retrieval': {'strategy_wins': {'semantic': 30, 'keyword': 15, 'graph': 5}}
180
- # }
181
  ```
182
 
183
  ---
@@ -191,7 +164,7 @@ Mnemo was designed with **EU AI Act Article 10** compliance in mind:
191
  - ✅ **No external API calls** - Data never leaves your infrastructure
192
  - ✅ **Traceable reasoning** - Understand why results were returned
193
 
194
- *From the team behind [NRA-19](https://github.com/yourusername/nra-19), the medical AI bias detection benchmark.*
195
 
196
  ---
197
 
@@ -208,38 +181,11 @@ Mnemo was designed with **EU AI Act Article 10** compliance in mind:
208
 
209
  ---
210
 
211
- ## 📊 Detailed Benchmarks
212
-
213
- Tested on 5 documents, 15 queries:
214
-
215
- ### Latency
216
- ```
217
- Ingestion:
218
- mem0: 31.1ms avg per document
219
- Mnemo: 0.8ms avg per document
220
- Winner: Mnemo (39x faster)
221
-
222
- Search:
223
- mem0: 5.73ms avg (p50: 5.17ms, p99: 8.21ms)
224
- Mnemo: 0.27ms avg (p50: 0.25ms, p99: 0.36ms)
225
- Winner: Mnemo (21x faster)
226
- ```
227
-
228
- ### Retrieval Strategy Distribution
229
- ```
230
- Mnemo retrieval wins by strategy:
231
- Semantic: 50 (77%)
232
- Keyword: 15 (23%)
233
- Graph: 0 (0%)
234
- ```
235
-
236
- ---
237
-
238
  ## 🗺️ Roadmap
239
 
240
- - [ ] Sentence-transformers integration for real embeddings
241
- - [ ] Persistent storage backends (SQLite, PostgreSQL)
242
- - [ ] Multi-user / tenant support
243
  - [ ] REST API server
244
  - [ ] LangChain integration
245
  - [ ] LlamaIndex integration
@@ -247,31 +193,14 @@ Mnemo retrieval wins by strategy:
247
 
248
  ---
249
 
250
- ## 🤝 Contributing
251
-
252
- Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md).
253
-
254
- ---
255
-
256
  ## 📜 License
257
 
258
- MIT License - see [LICENSE](LICENSE).
259
 
260
  ---
261
 
262
- ## 🙏 Acknowledgments
263
 
264
- - Named after **Mnemosyne** (Μνημοσύνη), Greek goddess of memory and mother of the Muses
265
- - Architecture inspired by research in cognitive memory systems
266
- - Built for the open-source AI community
267
-
268
- ---
269
-
270
- ## 📬 Contact
271
-
272
- - GitHub Issues for bugs/features
273
- - Discussions for questions
274
-
275
- ---
276
 
277
  *Mnemo: Memory that learns.*
 
1
+ ---
2
+ license: mit
3
+ library_name: mnemo
4
+ tags:
5
+ - memory
6
+ - retrieval
7
+ - rag
8
+ - semantic-search
9
+ - knowledge-graph
10
+ - faiss
11
+ - bm25
12
+ language:
13
+ - en
14
+ pipeline_tag: feature-extraction
15
+ ---
16
+
17
  # Mnemo: Semantic-Loop Memory
18
 
19
  > *Named after Mnemosyne, Greek goddess of memory*
 
23
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
24
  [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
25
 
26
+ ## 🎮 Try the Demo
27
+
28
+ 👉 [**Live Demo on HuggingFace Spaces**](https://huggingface.co/spaces/AthelaPerk/mnemo)
29
+
30
  ---
31
 
32
  ## 🏆 Benchmarks vs mem0
 
58
 
59
  ## 🚀 Quick Start
60
 
61
+ ```bash
62
+ git clone https://huggingface.co/AthelaPerk/mnemo-memory
63
+ cd mnemo-memory
64
+ pip install -r requirements.txt
65
+ ```
66
+
67
  ```python
68
  from mnemo import Mnemo
69
 
 
77
 
78
  # Search (0.27ms average!)
79
  results = m.search("notification preferences")
80
+ print(results[0].content) # "User prefers dark mode..."
81
 
82
+ # Feedback learning
83
+ m.feedback("notification preferences", results[0].id, relevance=0.9)
 
84
  ```
85
 
86
  ---
87
 
88
  ## 🧠 Architecture
89
 
 
 
90
  ```
91
  ┌─────────────────────────────────────────────────────────────┐
92
  │ MNEMO │
93
  ├─────────────────────────────────────────────────────────────┤
 
94
  │ Query → [Intent Detection] → [Multi-Strategy Retrieval] │
95
+ │ │
96
+ ┌─────────────┴─────────────┐
97
+ Semantic │ BM25 │ Graph │ │
98
+ 50% 30%20%
99
+ └─────────────┬─────────────┘
100
+
101
+ [Feedback Loop]
102
+ (Learns & Improves)
 
 
 
 
 
 
 
103
  └─────────────────────────────────────────────────────────────┘
104
  ```
105
 
 
114
 
115
  ---
116
 
117
+ ## 📖 API Reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
 
119
+ ### Basic Usage
120
 
121
  ```python
122
  from mnemo import Mnemo
123
 
124
+ m = Mnemo(
125
+ embedding_dim=384, # BGE-small compatible
126
+ semantic_weight=0.5, # Weight for semantic search
127
+ bm25_weight=0.3, # Weight for keyword search
128
+ graph_weight=0.2 # Weight for graph traversal
 
 
 
 
 
 
 
 
 
 
 
129
  )
130
 
131
+ # Add memory
132
+ mem_id = m.add("content", metadata={"key": "value"})
 
 
 
133
 
134
+ # Search
135
+ results = m.search("query", top_k=5)
136
+ for r in results:
137
+ print(r.id, r.score, r.content)
138
 
139
+ # Feedback
140
+ m.feedback("query", mem_id, relevance=0.9) # -1 to 1
141
 
142
+ # Stats
143
+ print(m.get_stats())
 
 
 
 
 
144
  ```
145
 
146
+ ### SearchResult Object
147
 
148
  ```python
149
+ result.id # Memory ID
150
+ result.content # Memory content
151
+ result.score # Combined score
152
+ result.strategy_scores # {'semantic': 0.5, 'bm25': 0.3, 'graph': 0.1}
153
+ result.metadata # Original metadata
 
 
 
154
  ```
155
 
156
  ---
 
164
  - ✅ **No external API calls** - Data never leaves your infrastructure
165
  - ✅ **Traceable reasoning** - Understand why results were returned
166
 
167
+ *From the team behind NRA-19 medical AI benchmark.*
168
 
169
  ---
170
 
 
181
 
182
  ---
183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  ## 🗺️ Roadmap
185
 
186
+ - [ ] Sentence-transformers integration
187
+ - [ ] Persistent storage (SQLite, PostgreSQL)
188
+ - [ ] Multi-user support
189
  - [ ] REST API server
190
  - [ ] LangChain integration
191
  - [ ] LlamaIndex integration
 
193
 
194
  ---
195
 
 
 
 
 
 
 
196
  ## 📜 License
197
 
198
+ MIT License
199
 
200
  ---
201
 
202
+ ## 🙏 Etymology
203
 
204
+ Named after **Mnemosyne** (Μνημοσύνη), the Greek goddess of memory and mother of the nine Muses. In Greek mythology, she was one of the Titans and personified memory itself.
 
 
 
 
 
 
 
 
 
 
 
205
 
206
  *Mnemo: Memory that learns.*