pyopenmem 0.1.1__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 jcgokart
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,261 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyopenmem
3
+ Version: 0.1.1
4
+ Summary: Memory System for AI-powered Development
5
+ Home-page: https://github.com/openlyco/openmem
6
+ Author: jcgokart
7
+ Author-email:
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Topic :: Software Development :: Libraries
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Requires-Python: >=3.8
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: pyyaml>=5.0
22
+ Requires-Dist: jieba>=0.42
23
+ Requires-Dist: cryptography>=3.0
24
+ Requires-Dist: requests>=2.28
25
+ Dynamic: author
26
+ Dynamic: classifier
27
+ Dynamic: description
28
+ Dynamic: description-content-type
29
+ Dynamic: home-page
30
+ Dynamic: license-file
31
+ Dynamic: requires-dist
32
+ Dynamic: requires-python
33
+ Dynamic: summary
34
+
35
+ # OpenMem
36
+
37
+ # Project-level Memory system for AI-powered development.
38
+
39
+ ## Why OpenMem?
40
+
41
+ **The Problem We Solved**
42
+
43
+ While using AI-powered development tools like OpenClaw, we experienced a critical issue: **important conversations and decisions were frequently lost**. The trigger-based memory system missed crucial context daily - technical decisions, problem-solving insights, and creative breakthroughs disappeared into the void.
44
+
45
+ **Our Development Environment Has Evolved**
46
+
47
+ The IDE is no longer just a code editor. It's become our **primary workspace** where we:
48
+ - Discuss architecture with AI
49
+ - Debug complex problems
50
+ - Capture fleeting insights
51
+ - Make critical technical decisions
52
+
53
+ Only polished outcomes become documentation (MD/Word/PDF). But the **golden moments** - the sparks of insight during live problem-solving - deserve to be preserved too.
54
+
55
+ **Our Solution: Full Recording + Smart Organization**
56
+
57
+ Instead of relying on imperfect triggers, we record **everything** and organize intelligently. This approach:
58
+ - ✅ Never misses important context
59
+ - ✅ Captures the complete thinking process
60
+ - ✅ Turns conversations into actionable knowledge
61
+ - ✅ Works across all development scenarios
62
+
63
+ **Four Usage Scenarios**
64
+
65
+ 1. **IDE Integration** (Trae / VS Code) - Your daily driver
66
+ 2. **Code Editor** - Lightweight editing sessions
67
+ 3. **CLI Tools** - Command-line development
68
+ 4. **AI Assistant** (OpenClaw) - Enhanced memory for your AI partner
69
+
70
+ **Why We Built This**
71
+
72
+ We're developers who faced the same pain point. After replacing our own OpenClaw memory with this system and seeing dramatic improvements, we knew we had to share it.
73
+
74
+ **Learn from OpenClaw, Evolve Beyond**
75
+
76
+ OpenClaw showed us the way. We're continuing that evolution - breaking context limitations, preserving knowledge, and making every conversation count.
77
+
78
+ ---
79
+
80
+ ## Features
81
+
82
+ - 🎯 **Project-level Memory** - Independent memory space per project
83
+ - 🔍 **Full-text Search** - Chinese tokenization (jieba) + FTS5 + BM25 ranking
84
+ - 🌐 **Global/Project Layers** - Flexible like Poetry
85
+ - 📦 **Template Init** - minimal / standard / full
86
+ - ⚙️ **Config Inheritance** - extends global config
87
+ - 📝 **Rules Generation** - Auto-generate IDE-readable rules
88
+ - 🔒 **Encrypted Backup** - Local encrypted storage (future)
89
+ - ⏮️ **Version Control** - Git-like versioning (future)
90
+ - 🖥️ **IDE Support** - Trae IDE + VS Code
91
+
92
+ ---
93
+
94
+ ## Security & Privacy
95
+
96
+ **Data Storage**
97
+ - All data is stored **locally** on your machine
98
+ - Raw data in SQLite database (plain text for fast FTS5 search)
99
+ - **No data is ever sent to external servers**
100
+
101
+ **Backup**
102
+ - Encrypted backup feature is planned for future release
103
+ - Encryption algorithm: Fernet (symmetric encryption)
104
+ - Key management: User-provided passphrase
105
+
106
+ **Privacy**
107
+ - Zero network requests by default
108
+ - Your data stays on your machine
109
+ - You control when and how to share
110
+
111
+ ---
112
+
113
+ ## Current Status
114
+
115
+ | Feature | Status | Notes |
116
+ |:---|:---:|:---|
117
+ | CLI (init/add/search/list/status) | ✅ Done | Core commands working |
118
+ | Project/Global layers | ✅ Done | Like Poetry config |
119
+ | Full-text search (FTS5 + BM25) | ✅ Done | jieba for Chinese |
120
+ | Config inheritance | ✅ Done | extends global config |
121
+ | Template init | ✅ Done | minimal/standard/full |
122
+ | Python API | ✅ Done | from openmem import |
123
+ | Encrypted backup | 🔜 Planned | v0.2 |
124
+ | Git-like version control | 🔜 Planned | v0.2 |
125
+ | IDE rules auto-generation | 🔜 In Progress | Trae/VS Code support |
126
+ | LLM summarization | 🔜 Planned | v0.3 |
127
+
128
+ ---
129
+
130
+ ## Architecture
131
+
132
+ ```mermaid
133
+ graph TD
134
+ A[User Input] --> B{CLI or API}
135
+ B -->|CLI| C[Memory Manager]
136
+ B -->|API| C
137
+ C --> D{Scope Check}
138
+ D -->|Project| E[Project DB<br/>.memory/]
139
+ D -->|Global| F[Global DB<br/>~/.memory/]
140
+ E --> G[SQLite + FTS5]
141
+ F --> G
142
+ G --> H[BM25 Ranking]
143
+ H --> I[Search Results]
144
+ ```
145
+
146
+ **Data Flow:**
147
+ 1. User input via CLI or Python API
148
+ 2. Memory Manager routes to Project or Global layer
149
+ 3. Data stored in local SQLite with FTS5 index
150
+ 4. Search uses BM25 for relevance ranking
151
+
152
+ ---
153
+
154
+ ## Installation
155
+
156
+ ```bash
157
+ pip install openmem
158
+ ```
159
+
160
+ Or development mode:
161
+
162
+ ```bash
163
+ pip install -e .
164
+ ```
165
+
166
+ ## Quick Start
167
+
168
+ ### Initialize
169
+
170
+ ```bash
171
+ # Project-level Memory
172
+ omem init
173
+
174
+ # Global Memory (shared across projects)
175
+ omem init --global
176
+
177
+ # Select template
178
+ omem init --template=standard
179
+ omem init --template=full
180
+
181
+ # Non-interactive mode
182
+ omem init -y
183
+ ```
184
+
185
+ ### Basic Usage
186
+
187
+ ```bash
188
+ # Add memory
189
+ omem add "Use JWT for authentication" --type decision --tags auth,security
190
+
191
+ # Search
192
+ omem search auth
193
+ omem search auth --scope both
194
+
195
+ # List
196
+ omem list --type decision
197
+
198
+ # Status
199
+ omem status
200
+ omem status -v
201
+ ```
202
+
203
+ ### Python API
204
+
205
+ ```python
206
+ from openmem import MemoryManager
207
+
208
+ # Auto-select (project first, fallback to global)
209
+ memory = MemoryManager()
210
+
211
+ # Explicit project path
212
+ memory = MemoryManager(project_path="/path/to/project")
213
+
214
+ # Global memory only
215
+ memory = MemoryManager(project_path=None)
216
+
217
+ # Add memory
218
+ memory_id = memory.add(
219
+ content="Use JWT for authentication",
220
+ type="decision",
221
+ tags=["auth", "security"],
222
+ priority=8
223
+ )
224
+
225
+ # Search with filters
226
+ results = memory.search(
227
+ query="authentication",
228
+ scope="project", # "project" | "global" | "both"
229
+ memory_type="decision",
230
+ tags=["auth"],
231
+ limit=10
232
+ )
233
+
234
+ # List memories
235
+ memories = memory.list(
236
+ memory_type="decision",
237
+ tags=["auth"],
238
+ limit=50
239
+ )
240
+
241
+ # Update and delete
242
+ memory.update(memory_id, content="New content")
243
+ memory.delete(memory_id)
244
+
245
+ memory.close()
246
+ ```
247
+
248
+ ## Documentation
249
+
250
+ - [Quick Start Guide](QUICKSTART.md)
251
+ - [Usage Guide](USAGE.md)
252
+ - [Architecture](ARCHITECTURE.md)
253
+ - [Philosophy](PHILOSOPHY.md)
254
+ - [Contributing](CONTRIBUTING.md)
255
+ - [Changelog](CHANGELOG.md)
256
+
257
+ ---
258
+
259
+ ## License
260
+
261
+ MIT
@@ -0,0 +1,227 @@
1
+ # OpenMem
2
+
3
+ # Project-level Memory system for AI-powered development.
4
+
5
+ ## Why OpenMem?
6
+
7
+ **The Problem We Solved**
8
+
9
+ While using AI-powered development tools like OpenClaw, we experienced a critical issue: **important conversations and decisions were frequently lost**. The trigger-based memory system missed crucial context daily - technical decisions, problem-solving insights, and creative breakthroughs disappeared into the void.
10
+
11
+ **Our Development Environment Has Evolved**
12
+
13
+ The IDE is no longer just a code editor. It's become our **primary workspace** where we:
14
+ - Discuss architecture with AI
15
+ - Debug complex problems
16
+ - Capture fleeting insights
17
+ - Make critical technical decisions
18
+
19
+ Only polished outcomes become documentation (MD/Word/PDF). But the **golden moments** - the sparks of insight during live problem-solving - deserve to be preserved too.
20
+
21
+ **Our Solution: Full Recording + Smart Organization**
22
+
23
+ Instead of relying on imperfect triggers, we record **everything** and organize intelligently. This approach:
24
+ - ✅ Never misses important context
25
+ - ✅ Captures the complete thinking process
26
+ - ✅ Turns conversations into actionable knowledge
27
+ - ✅ Works across all development scenarios
28
+
29
+ **Four Usage Scenarios**
30
+
31
+ 1. **IDE Integration** (Trae / VS Code) - Your daily driver
32
+ 2. **Code Editor** - Lightweight editing sessions
33
+ 3. **CLI Tools** - Command-line development
34
+ 4. **AI Assistant** (OpenClaw) - Enhanced memory for your AI partner
35
+
36
+ **Why We Built This**
37
+
38
+ We're developers who faced the same pain point. After replacing our own OpenClaw memory with this system and seeing dramatic improvements, we knew we had to share it.
39
+
40
+ **Learn from OpenClaw, Evolve Beyond**
41
+
42
+ OpenClaw showed us the way. We're continuing that evolution - breaking context limitations, preserving knowledge, and making every conversation count.
43
+
44
+ ---
45
+
46
+ ## Features
47
+
48
+ - 🎯 **Project-level Memory** - Independent memory space per project
49
+ - 🔍 **Full-text Search** - Chinese tokenization (jieba) + FTS5 + BM25 ranking
50
+ - 🌐 **Global/Project Layers** - Flexible like Poetry
51
+ - 📦 **Template Init** - minimal / standard / full
52
+ - ⚙️ **Config Inheritance** - extends global config
53
+ - 📝 **Rules Generation** - Auto-generate IDE-readable rules
54
+ - 🔒 **Encrypted Backup** - Local encrypted storage (future)
55
+ - ⏮️ **Version Control** - Git-like versioning (future)
56
+ - 🖥️ **IDE Support** - Trae IDE + VS Code
57
+
58
+ ---
59
+
60
+ ## Security & Privacy
61
+
62
+ **Data Storage**
63
+ - All data is stored **locally** on your machine
64
+ - Raw data in SQLite database (plain text for fast FTS5 search)
65
+ - **No data is ever sent to external servers**
66
+
67
+ **Backup**
68
+ - Encrypted backup feature is planned for future release
69
+ - Encryption algorithm: Fernet (symmetric encryption)
70
+ - Key management: User-provided passphrase
71
+
72
+ **Privacy**
73
+ - Zero network requests by default
74
+ - Your data stays on your machine
75
+ - You control when and how to share
76
+
77
+ ---
78
+
79
+ ## Current Status
80
+
81
+ | Feature | Status | Notes |
82
+ |:---|:---:|:---|
83
+ | CLI (init/add/search/list/status) | ✅ Done | Core commands working |
84
+ | Project/Global layers | ✅ Done | Like Poetry config |
85
+ | Full-text search (FTS5 + BM25) | ✅ Done | jieba for Chinese |
86
+ | Config inheritance | ✅ Done | extends global config |
87
+ | Template init | ✅ Done | minimal/standard/full |
88
+ | Python API | ✅ Done | from openmem import |
89
+ | Encrypted backup | 🔜 Planned | v0.2 |
90
+ | Git-like version control | 🔜 Planned | v0.2 |
91
+ | IDE rules auto-generation | 🔜 In Progress | Trae/VS Code support |
92
+ | LLM summarization | 🔜 Planned | v0.3 |
93
+
94
+ ---
95
+
96
+ ## Architecture
97
+
98
+ ```mermaid
99
+ graph TD
100
+ A[User Input] --> B{CLI or API}
101
+ B -->|CLI| C[Memory Manager]
102
+ B -->|API| C
103
+ C --> D{Scope Check}
104
+ D -->|Project| E[Project DB<br/>.memory/]
105
+ D -->|Global| F[Global DB<br/>~/.memory/]
106
+ E --> G[SQLite + FTS5]
107
+ F --> G
108
+ G --> H[BM25 Ranking]
109
+ H --> I[Search Results]
110
+ ```
111
+
112
+ **Data Flow:**
113
+ 1. User input via CLI or Python API
114
+ 2. Memory Manager routes to Project or Global layer
115
+ 3. Data stored in local SQLite with FTS5 index
116
+ 4. Search uses BM25 for relevance ranking
117
+
118
+ ---
119
+
120
+ ## Installation
121
+
122
+ ```bash
123
+ pip install openmem
124
+ ```
125
+
126
+ Or development mode:
127
+
128
+ ```bash
129
+ pip install -e .
130
+ ```
131
+
132
+ ## Quick Start
133
+
134
+ ### Initialize
135
+
136
+ ```bash
137
+ # Project-level Memory
138
+ omem init
139
+
140
+ # Global Memory (shared across projects)
141
+ omem init --global
142
+
143
+ # Select template
144
+ omem init --template=standard
145
+ omem init --template=full
146
+
147
+ # Non-interactive mode
148
+ omem init -y
149
+ ```
150
+
151
+ ### Basic Usage
152
+
153
+ ```bash
154
+ # Add memory
155
+ omem add "Use JWT for authentication" --type decision --tags auth,security
156
+
157
+ # Search
158
+ omem search auth
159
+ omem search auth --scope both
160
+
161
+ # List
162
+ omem list --type decision
163
+
164
+ # Status
165
+ omem status
166
+ omem status -v
167
+ ```
168
+
169
+ ### Python API
170
+
171
+ ```python
172
+ from openmem import MemoryManager
173
+
174
+ # Auto-select (project first, fallback to global)
175
+ memory = MemoryManager()
176
+
177
+ # Explicit project path
178
+ memory = MemoryManager(project_path="/path/to/project")
179
+
180
+ # Global memory only
181
+ memory = MemoryManager(project_path=None)
182
+
183
+ # Add memory
184
+ memory_id = memory.add(
185
+ content="Use JWT for authentication",
186
+ type="decision",
187
+ tags=["auth", "security"],
188
+ priority=8
189
+ )
190
+
191
+ # Search with filters
192
+ results = memory.search(
193
+ query="authentication",
194
+ scope="project", # "project" | "global" | "both"
195
+ memory_type="decision",
196
+ tags=["auth"],
197
+ limit=10
198
+ )
199
+
200
+ # List memories
201
+ memories = memory.list(
202
+ memory_type="decision",
203
+ tags=["auth"],
204
+ limit=50
205
+ )
206
+
207
+ # Update and delete
208
+ memory.update(memory_id, content="New content")
209
+ memory.delete(memory_id)
210
+
211
+ memory.close()
212
+ ```
213
+
214
+ ## Documentation
215
+
216
+ - [Quick Start Guide](QUICKSTART.md)
217
+ - [Usage Guide](USAGE.md)
218
+ - [Architecture](ARCHITECTURE.md)
219
+ - [Philosophy](PHILOSOPHY.md)
220
+ - [Contributing](CONTRIBUTING.md)
221
+ - [Changelog](CHANGELOG.md)
222
+
223
+ ---
224
+
225
+ ## License
226
+
227
+ MIT
@@ -0,0 +1,5 @@
1
+ """
2
+ Memory CLI Module
3
+ """
4
+
5
+ __all__ = ["main"]