mnemosynth 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mnemosynth-0.1.0/LICENSE +15 -0
- mnemosynth-0.1.0/PKG-INFO +234 -0
- mnemosynth-0.1.0/README.md +182 -0
- mnemosynth-0.1.0/pyproject.toml +113 -0
- mnemosynth-0.1.0/src/mnemosynth/__init__.py +190 -0
- mnemosynth-0.1.0/src/mnemosynth/__main__.py +6 -0
- mnemosynth-0.1.0/src/mnemosynth/cli/__init__.py +1 -0
- mnemosynth-0.1.0/src/mnemosynth/cli/commands.py +527 -0
- mnemosynth-0.1.0/src/mnemosynth/core/__init__.py +19 -0
- mnemosynth-0.1.0/src/mnemosynth/core/config.py +205 -0
- mnemosynth-0.1.0/src/mnemosynth/core/types.py +240 -0
- mnemosynth-0.1.0/src/mnemosynth/engine/__init__.py +1 -0
- mnemosynth-0.1.0/src/mnemosynth/engine/contradiction.py +190 -0
- mnemosynth-0.1.0/src/mnemosynth/engine/decay.py +95 -0
- mnemosynth-0.1.0/src/mnemosynth/engine/digest.py +134 -0
- mnemosynth-0.1.0/src/mnemosynth/engine/extractor.py +138 -0
- mnemosynth-0.1.0/src/mnemosynth/engine/immune.py +177 -0
- mnemosynth-0.1.0/src/mnemosynth/engine/router.py +107 -0
- mnemosynth-0.1.0/src/mnemosynth/engine/sentiment.py +112 -0
- mnemosynth-0.1.0/src/mnemosynth/mcp/__init__.py +1 -0
- mnemosynth-0.1.0/src/mnemosynth/mcp/server.py +279 -0
- mnemosynth-0.1.0/src/mnemosynth/stores/__init__.py +5 -0
- mnemosynth-0.1.0/src/mnemosynth/stores/base.py +42 -0
- mnemosynth-0.1.0/src/mnemosynth/stores/episodic.py +213 -0
- mnemosynth-0.1.0/src/mnemosynth/stores/procedural.py +120 -0
- mnemosynth-0.1.0/src/mnemosynth/stores/semantic.py +228 -0
- mnemosynth-0.1.0/src/mnemosynth/utils/__init__.py +1 -0
- mnemosynth-0.1.0/src/mnemosynth/utils/db.py +319 -0
- mnemosynth-0.1.0/src/mnemosynth/utils/embeddings.py +53 -0
- mnemosynth-0.1.0/tests/__init__.py +0 -0
- mnemosynth-0.1.0/tests/test_config.py +108 -0
- mnemosynth-0.1.0/tests/test_contradiction.py +117 -0
- mnemosynth-0.1.0/tests/test_db.py +81 -0
- mnemosynth-0.1.0/tests/test_decay.py +58 -0
- mnemosynth-0.1.0/tests/test_extractor.py +119 -0
- mnemosynth-0.1.0/tests/test_immune.py +126 -0
- mnemosynth-0.1.0/tests/test_router.py +40 -0
- mnemosynth-0.1.0/tests/test_sentiment.py +91 -0
- mnemosynth-0.1.0/tests/test_stores.py +184 -0
- mnemosynth-0.1.0/tests/test_types.py +133 -0
mnemosynth-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mnemosynth
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Universal AI Memory Plugin — persistent, verified, hallucination-resistant memory for any LLM, agent, or coding workflow
|
|
5
|
+
Project-URL: Homepage, https://github.com/vasudevjaiswal/mnemosynth
|
|
6
|
+
Project-URL: Repository, https://github.com/vasudevjaiswal/mnemosynth
|
|
7
|
+
Project-URL: Documentation, https://github.com/vasudevjaiswal/mnemosynth#readme
|
|
8
|
+
Project-URL: Issues, https://github.com/vasudevjaiswal/mnemosynth/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/vasudevjaiswal/mnemosynth/blob/main/CHANGELOG.md
|
|
10
|
+
Author-email: Vasudev Jaiswal <vasudevjaiswal@protonmail.com>
|
|
11
|
+
Maintainer-email: Vasudev Jaiswal <vasudevjaiswal@protonmail.com>
|
|
12
|
+
License-Expression: Apache-2.0
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Keywords: agent,ai,belief-revision,cognitive,contradiction-detection,hallucination,knowledge-graph,llm,mcp,memory,rag,second-brain,vector-db
|
|
15
|
+
Classifier: Development Status :: 4 - Beta
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Intended Audience :: Science/Research
|
|
18
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
25
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
26
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
27
|
+
Classifier: Typing :: Typed
|
|
28
|
+
Requires-Python: >=3.10
|
|
29
|
+
Requires-Dist: click>=8.0
|
|
30
|
+
Requires-Dist: lancedb>=0.15
|
|
31
|
+
Requires-Dist: mcp>=1.0
|
|
32
|
+
Requires-Dist: networkx>=3.0
|
|
33
|
+
Requires-Dist: numpy>=1.24
|
|
34
|
+
Requires-Dist: pyarrow>=14.0
|
|
35
|
+
Requires-Dist: pyyaml>=6.0
|
|
36
|
+
Requires-Dist: rich>=13.0
|
|
37
|
+
Requires-Dist: scikit-learn>=1.4
|
|
38
|
+
Requires-Dist: sentence-transformers>=3.0
|
|
39
|
+
Requires-Dist: transformers>=4.40
|
|
40
|
+
Provides-Extra: dev
|
|
41
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
42
|
+
Requires-Dist: pre-commit>=3.0; extra == 'dev'
|
|
43
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
44
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
45
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
46
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
47
|
+
Provides-Extra: production
|
|
48
|
+
Requires-Dist: falkordb>=1.0; extra == 'production'
|
|
49
|
+
Requires-Dist: qdrant-client>=1.9; extra == 'production'
|
|
50
|
+
Requires-Dist: redis>=5.0; extra == 'production'
|
|
51
|
+
Description-Content-Type: text/markdown
|
|
52
|
+
|
|
53
|
+
# 🧠 Mnemosynth
|
|
54
|
+
|
|
55
|
+
**Persistent, hallucination-resistant memory for any LLM, agent, or AI workflow.**
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pip install mnemosynth
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
PyPI · Apache 2.0 · Python ≥ 3.10 · No external services required
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## The Problem
|
|
66
|
+
|
|
67
|
+
LLMs forget everything when a session ends. RAG helps — but raw retrieval doesn't verify, decay, or reason about what it stores. You get confident hallucinations, stale facts, and no audit trail.
|
|
68
|
+
|
|
69
|
+
**Mnemosynth is a cognitive memory OS, not a vector store.**
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Three-Tier Memory Model
|
|
74
|
+
|
|
75
|
+
Inspired by how the brain actually works:
|
|
76
|
+
|
|
77
|
+
| Tier | Brain Region | Backend | What It Stores |
|
|
78
|
+
|---|---|---|---|
|
|
79
|
+
| **Episodic** | Hippocampus | LanceDB (vector) | Events, conversations, timestamped history |
|
|
80
|
+
| **Semantic** | Neocortex | NetworkX (graph) | Verified facts, entity relationships |
|
|
81
|
+
| **Procedural** | Cerebellum | JSON registry | Tools, schemas, workflows |
|
|
82
|
+
|
|
83
|
+
Memories are **automatically classified** on write. No manual tagging required.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Quickstart
|
|
88
|
+
|
|
89
|
+
### Python API
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
from mnemosynth import Mnemosynth
|
|
93
|
+
|
|
94
|
+
brain = Mnemosynth()
|
|
95
|
+
|
|
96
|
+
# Store — auto-classified into episodic/semantic/procedural
|
|
97
|
+
brain.remember("User prefers Python and dark mode")
|
|
98
|
+
brain.remember("Yesterday we finalized the auth module")
|
|
99
|
+
brain.remember("Deploy with: docker compose up -d")
|
|
100
|
+
|
|
101
|
+
# Retrieve with semantic search
|
|
102
|
+
for r in brain.recall("What languages does the user prefer?"):
|
|
103
|
+
print(f"[{r.memory_type.value}] {r.content} ({r.confidence:.0%})")
|
|
104
|
+
|
|
105
|
+
# Compress relevant memories into a <150-token LLM context block
|
|
106
|
+
digest = brain.digest("Starting a new project")
|
|
107
|
+
|
|
108
|
+
# Dream: cluster episodic patterns -> promote to verified semantic facts
|
|
109
|
+
brain.dream()
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### MCP Server (Claude Desktop / Cursor / Windsurf)
|
|
113
|
+
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"mcpServers": {
|
|
117
|
+
"mnemosynth": {
|
|
118
|
+
"command": "mnemosynth",
|
|
119
|
+
"args": ["serve"]
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Everything runs locally under `~/.mnemosynth/`. No external services.
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Anti-Hallucination Engine
|
|
130
|
+
|
|
131
|
+
Mnemosynth doesn't just store — it **defends**:
|
|
132
|
+
|
|
133
|
+
- **Forgetting curve** — Ebbinghaus decay with configurable half-life; stale memories lose confidence
|
|
134
|
+
- **Contradiction detection** — Flags conflicting facts before they corrupt your context
|
|
135
|
+
- **Belief revision chains** — Deprecated facts link forward to their replacements
|
|
136
|
+
- **Corroboration scoring** — Repeated observations boost confidence
|
|
137
|
+
- **Memory immune system** — Prompt injection detection, rate limiting, quarantine
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Dream Consolidation
|
|
142
|
+
|
|
143
|
+
Run `brain.dream()` (or `mnemosynth dream`) to trigger offline consolidation:
|
|
144
|
+
|
|
145
|
+
1. **Cluster** episodic memories with HDBSCAN
|
|
146
|
+
2. **Promote** recurring patterns to verified semantic facts
|
|
147
|
+
3. **Decay** memories that haven't been accessed recently
|
|
148
|
+
|
|
149
|
+
Think of it as sleep for your AI's memory.
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## MCP Tools
|
|
154
|
+
|
|
155
|
+
| Tool | Description |
|
|
156
|
+
|---|---|
|
|
157
|
+
| `add_memory` | Store with auto-classification |
|
|
158
|
+
| `search_memory` | Semantic search across all tiers |
|
|
159
|
+
| `get_digest` | Compressed XML context block for LLM injection |
|
|
160
|
+
| `get_contradictions` | Surface conflicting facts |
|
|
161
|
+
| `run_dream` | Trigger consolidation |
|
|
162
|
+
| `forget` | Delete by ID |
|
|
163
|
+
| `get_stats` | Memory statistics |
|
|
164
|
+
| `get_provenance` | Full audit trail for any memory |
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## CLI
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
mnemosynth serve # Start MCP server
|
|
172
|
+
mnemosynth stats # Memory dashboard
|
|
173
|
+
mnemosynth search "query" # Semantic search
|
|
174
|
+
mnemosynth inspect # Browse memory tree
|
|
175
|
+
mnemosynth dream # Run consolidation
|
|
176
|
+
mnemosynth health # System diagnostics
|
|
177
|
+
mnemosynth export -o out.json # Export to JSON or Markdown
|
|
178
|
+
mnemosynth forget <ID> # Delete a memory
|
|
179
|
+
mnemosynth reset --confirm # Wipe everything
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Configuration
|
|
185
|
+
|
|
186
|
+
Override defaults at `~/.mnemosynth/config.yaml`:
|
|
187
|
+
|
|
188
|
+
```yaml
|
|
189
|
+
embedding_model: all-MiniLM-L6-v2
|
|
190
|
+
max_episodic_memories: 10000
|
|
191
|
+
max_semantic_nodes: 5000
|
|
192
|
+
|
|
193
|
+
decay:
|
|
194
|
+
half_life_days: 30.0
|
|
195
|
+
min_confidence: 0.1
|
|
196
|
+
|
|
197
|
+
dream:
|
|
198
|
+
interval_hours: 24
|
|
199
|
+
min_cluster_size: 3
|
|
200
|
+
|
|
201
|
+
digest:
|
|
202
|
+
max_tokens: 150
|
|
203
|
+
top_k: 5
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Architecture
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
Claude Desktop / Cursor / Windsurf / Python API
|
|
212
|
+
| MCP (stdio) / Python import
|
|
213
|
+
Router · Digest · Decay · Dream
|
|
214
|
+
Sentiment · Contradiction · Immune System
|
|
215
|
+
|
|
|
216
|
+
Episodic (LanceDB) · Semantic (NetworkX) · Procedural (JSON)
|
|
217
|
+
|
|
|
218
|
+
~/.mnemosynth/
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Development
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
git clone https://github.com/vasudevjaiswal/mnemosynth.git
|
|
227
|
+
cd mnemosynth/mnemosynth-core
|
|
228
|
+
pip install -e ".[dev]"
|
|
229
|
+
pytest tests/ -v
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
Built by [Vasudev Jaiswal](https://github.com/vasudevjaiswal) · Apache 2.0
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# 🧠 Mnemosynth
|
|
2
|
+
|
|
3
|
+
**Persistent, hallucination-resistant memory for any LLM, agent, or AI workflow.**
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pip install mnemosynth
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
PyPI · Apache 2.0 · Python ≥ 3.10 · No external services required
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## The Problem
|
|
14
|
+
|
|
15
|
+
LLMs forget everything when a session ends. RAG helps — but raw retrieval doesn't verify, decay, or reason about what it stores. You get confident hallucinations, stale facts, and no audit trail.
|
|
16
|
+
|
|
17
|
+
**Mnemosynth is a cognitive memory OS, not a vector store.**
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Three-Tier Memory Model
|
|
22
|
+
|
|
23
|
+
Inspired by how the brain actually works:
|
|
24
|
+
|
|
25
|
+
| Tier | Brain Region | Backend | What It Stores |
|
|
26
|
+
|---|---|---|---|
|
|
27
|
+
| **Episodic** | Hippocampus | LanceDB (vector) | Events, conversations, timestamped history |
|
|
28
|
+
| **Semantic** | Neocortex | NetworkX (graph) | Verified facts, entity relationships |
|
|
29
|
+
| **Procedural** | Cerebellum | JSON registry | Tools, schemas, workflows |
|
|
30
|
+
|
|
31
|
+
Memories are **automatically classified** on write. No manual tagging required.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Quickstart
|
|
36
|
+
|
|
37
|
+
### Python API
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from mnemosynth import Mnemosynth
|
|
41
|
+
|
|
42
|
+
brain = Mnemosynth()
|
|
43
|
+
|
|
44
|
+
# Store — auto-classified into episodic/semantic/procedural
|
|
45
|
+
brain.remember("User prefers Python and dark mode")
|
|
46
|
+
brain.remember("Yesterday we finalized the auth module")
|
|
47
|
+
brain.remember("Deploy with: docker compose up -d")
|
|
48
|
+
|
|
49
|
+
# Retrieve with semantic search
|
|
50
|
+
for r in brain.recall("What languages does the user prefer?"):
|
|
51
|
+
print(f"[{r.memory_type.value}] {r.content} ({r.confidence:.0%})")
|
|
52
|
+
|
|
53
|
+
# Compress relevant memories into a <150-token LLM context block
|
|
54
|
+
digest = brain.digest("Starting a new project")
|
|
55
|
+
|
|
56
|
+
# Dream: cluster episodic patterns -> promote to verified semantic facts
|
|
57
|
+
brain.dream()
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### MCP Server (Claude Desktop / Cursor / Windsurf)
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"mcpServers": {
|
|
65
|
+
"mnemosynth": {
|
|
66
|
+
"command": "mnemosynth",
|
|
67
|
+
"args": ["serve"]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Everything runs locally under `~/.mnemosynth/`. No external services.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Anti-Hallucination Engine
|
|
78
|
+
|
|
79
|
+
Mnemosynth doesn't just store — it **defends**:
|
|
80
|
+
|
|
81
|
+
- **Forgetting curve** — Ebbinghaus decay with configurable half-life; stale memories lose confidence
|
|
82
|
+
- **Contradiction detection** — Flags conflicting facts before they corrupt your context
|
|
83
|
+
- **Belief revision chains** — Deprecated facts link forward to their replacements
|
|
84
|
+
- **Corroboration scoring** — Repeated observations boost confidence
|
|
85
|
+
- **Memory immune system** — Prompt injection detection, rate limiting, quarantine
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Dream Consolidation
|
|
90
|
+
|
|
91
|
+
Run `brain.dream()` (or `mnemosynth dream`) to trigger offline consolidation:
|
|
92
|
+
|
|
93
|
+
1. **Cluster** episodic memories with HDBSCAN
|
|
94
|
+
2. **Promote** recurring patterns to verified semantic facts
|
|
95
|
+
3. **Decay** memories that haven't been accessed recently
|
|
96
|
+
|
|
97
|
+
Think of it as sleep for your AI's memory.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## MCP Tools
|
|
102
|
+
|
|
103
|
+
| Tool | Description |
|
|
104
|
+
|---|---|
|
|
105
|
+
| `add_memory` | Store with auto-classification |
|
|
106
|
+
| `search_memory` | Semantic search across all tiers |
|
|
107
|
+
| `get_digest` | Compressed XML context block for LLM injection |
|
|
108
|
+
| `get_contradictions` | Surface conflicting facts |
|
|
109
|
+
| `run_dream` | Trigger consolidation |
|
|
110
|
+
| `forget` | Delete by ID |
|
|
111
|
+
| `get_stats` | Memory statistics |
|
|
112
|
+
| `get_provenance` | Full audit trail for any memory |
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## CLI
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
mnemosynth serve # Start MCP server
|
|
120
|
+
mnemosynth stats # Memory dashboard
|
|
121
|
+
mnemosynth search "query" # Semantic search
|
|
122
|
+
mnemosynth inspect # Browse memory tree
|
|
123
|
+
mnemosynth dream # Run consolidation
|
|
124
|
+
mnemosynth health # System diagnostics
|
|
125
|
+
mnemosynth export -o out.json # Export to JSON or Markdown
|
|
126
|
+
mnemosynth forget <ID> # Delete a memory
|
|
127
|
+
mnemosynth reset --confirm # Wipe everything
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Configuration
|
|
133
|
+
|
|
134
|
+
Override defaults at `~/.mnemosynth/config.yaml`:
|
|
135
|
+
|
|
136
|
+
```yaml
|
|
137
|
+
embedding_model: all-MiniLM-L6-v2
|
|
138
|
+
max_episodic_memories: 10000
|
|
139
|
+
max_semantic_nodes: 5000
|
|
140
|
+
|
|
141
|
+
decay:
|
|
142
|
+
half_life_days: 30.0
|
|
143
|
+
min_confidence: 0.1
|
|
144
|
+
|
|
145
|
+
dream:
|
|
146
|
+
interval_hours: 24
|
|
147
|
+
min_cluster_size: 3
|
|
148
|
+
|
|
149
|
+
digest:
|
|
150
|
+
max_tokens: 150
|
|
151
|
+
top_k: 5
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Architecture
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
Claude Desktop / Cursor / Windsurf / Python API
|
|
160
|
+
| MCP (stdio) / Python import
|
|
161
|
+
Router · Digest · Decay · Dream
|
|
162
|
+
Sentiment · Contradiction · Immune System
|
|
163
|
+
|
|
|
164
|
+
Episodic (LanceDB) · Semantic (NetworkX) · Procedural (JSON)
|
|
165
|
+
|
|
|
166
|
+
~/.mnemosynth/
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Development
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
git clone https://github.com/vasudevjaiswal/mnemosynth.git
|
|
175
|
+
cd mnemosynth/mnemosynth-core
|
|
176
|
+
pip install -e ".[dev]"
|
|
177
|
+
pytest tests/ -v
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
Built by [Vasudev Jaiswal](https://github.com/vasudevjaiswal) · Apache 2.0
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "mnemosynth"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Universal AI Memory Plugin — persistent, verified, hallucination-resistant memory for any LLM, agent, or coding workflow"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "Apache-2.0"
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Vasudev Jaiswal", email = "vasudevjaiswal@protonmail.com" },
|
|
14
|
+
]
|
|
15
|
+
maintainers = [
|
|
16
|
+
{ name = "Vasudev Jaiswal", email = "vasudevjaiswal@protonmail.com" },
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
keywords = [
|
|
20
|
+
"ai", "memory", "mcp", "llm", "knowledge-graph",
|
|
21
|
+
"vector-db", "cognitive", "agent", "rag", "second-brain",
|
|
22
|
+
"hallucination", "contradiction-detection", "belief-revision",
|
|
23
|
+
]
|
|
24
|
+
classifiers = [
|
|
25
|
+
"Development Status :: 4 - Beta",
|
|
26
|
+
"Intended Audience :: Developers",
|
|
27
|
+
"Intended Audience :: Science/Research",
|
|
28
|
+
"License :: OSI Approved :: Apache Software License",
|
|
29
|
+
"Operating System :: OS Independent",
|
|
30
|
+
"Programming Language :: Python :: 3",
|
|
31
|
+
"Programming Language :: Python :: 3.10",
|
|
32
|
+
"Programming Language :: Python :: 3.11",
|
|
33
|
+
"Programming Language :: Python :: 3.12",
|
|
34
|
+
"Programming Language :: Python :: 3.13",
|
|
35
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
36
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
37
|
+
"Typing :: Typed",
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
dependencies = [
|
|
41
|
+
"lancedb>=0.15",
|
|
42
|
+
"pyarrow>=14.0",
|
|
43
|
+
"networkx>=3.0",
|
|
44
|
+
"mcp>=1.0",
|
|
45
|
+
"sentence-transformers>=3.0",
|
|
46
|
+
"transformers>=4.40",
|
|
47
|
+
"scikit-learn>=1.4",
|
|
48
|
+
"click>=8.0",
|
|
49
|
+
"pyyaml>=6.0",
|
|
50
|
+
"numpy>=1.24",
|
|
51
|
+
"rich>=13.0",
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
[project.optional-dependencies]
|
|
55
|
+
dev = [
|
|
56
|
+
"pytest>=8.0",
|
|
57
|
+
"pytest-asyncio>=0.23",
|
|
58
|
+
"pytest-cov>=5.0",
|
|
59
|
+
"ruff>=0.4",
|
|
60
|
+
"mypy>=1.10",
|
|
61
|
+
"pre-commit>=3.0",
|
|
62
|
+
]
|
|
63
|
+
production = [
|
|
64
|
+
"qdrant-client>=1.9",
|
|
65
|
+
"falkordb>=1.0",
|
|
66
|
+
"redis>=5.0",
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
[project.scripts]
|
|
70
|
+
mnemosynth = "mnemosynth.cli.commands:main"
|
|
71
|
+
|
|
72
|
+
[project.urls]
|
|
73
|
+
Homepage = "https://github.com/vasudevjaiswal/mnemosynth"
|
|
74
|
+
Repository = "https://github.com/vasudevjaiswal/mnemosynth"
|
|
75
|
+
Documentation = "https://github.com/vasudevjaiswal/mnemosynth#readme"
|
|
76
|
+
Issues = "https://github.com/vasudevjaiswal/mnemosynth/issues"
|
|
77
|
+
Changelog = "https://github.com/vasudevjaiswal/mnemosynth/blob/main/CHANGELOG.md"
|
|
78
|
+
|
|
79
|
+
[tool.hatch.build.targets.wheel]
|
|
80
|
+
packages = ["src/mnemosynth"]
|
|
81
|
+
|
|
82
|
+
[tool.ruff]
|
|
83
|
+
target-version = "py310"
|
|
84
|
+
line-length = 100
|
|
85
|
+
|
|
86
|
+
[tool.ruff.lint]
|
|
87
|
+
select = ["E", "F", "I", "N", "W", "UP", "B", "SIM", "TCH"]
|
|
88
|
+
ignore = ["E501"]
|
|
89
|
+
|
|
90
|
+
[tool.ruff.lint.isort]
|
|
91
|
+
known-first-party = ["mnemosynth"]
|
|
92
|
+
|
|
93
|
+
[tool.mypy]
|
|
94
|
+
python_version = "3.10"
|
|
95
|
+
warn_return_any = true
|
|
96
|
+
warn_unused_configs = true
|
|
97
|
+
disallow_untyped_defs = false
|
|
98
|
+
|
|
99
|
+
[tool.pytest.ini_options]
|
|
100
|
+
testpaths = ["tests"]
|
|
101
|
+
addopts = "-v --tb=short"
|
|
102
|
+
|
|
103
|
+
[tool.coverage.run]
|
|
104
|
+
source = ["src/mnemosynth"]
|
|
105
|
+
omit = ["tests/*"]
|
|
106
|
+
|
|
107
|
+
[tool.coverage.report]
|
|
108
|
+
show_missing = true
|
|
109
|
+
exclude_lines = [
|
|
110
|
+
"pragma: no cover",
|
|
111
|
+
"if __name__ == .__main__.",
|
|
112
|
+
"if TYPE_CHECKING:",
|
|
113
|
+
]
|