zer0dex 0.0.9__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.
zer0dex-0.0.9/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ Copyright 2026 Rolando Bosch / Hermes Labs
8
+
9
+ Licensed under the Apache License, Version 2.0 (the "License");
10
+ you may not use this file except in compliance with the License.
11
+ You may obtain a copy of the License at
12
+
13
+ http://www.apache.org/licenses/LICENSE-2.0
14
+
15
+ Unless required by applicable law or agreed to in writing, software
16
+ distributed under the License is distributed on an "AS IS" BASIS,
17
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ See the License for the specific language governing permissions and
19
+ limitations under the License.
zer0dex-0.0.9/PKG-INFO ADDED
@@ -0,0 +1,237 @@
1
+ Metadata-Version: 2.4
2
+ Name: zer0dex
3
+ Version: 0.0.9
4
+ Summary: Dual-layer memory for AI agents. Compressed index + vector store. 91% recall, 70ms, $0/month.
5
+ Author-email: Rolando Bosch <rbosch@hermes-labs.ai>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/roli-lpci/zer0dex
8
+ Project-URL: Documentation, https://hermes-labs.ai/zer0dex
9
+ Project-URL: Repository, https://github.com/roli-lpci/zer0dex
10
+ Project-URL: Issues, https://github.com/roli-lpci/zer0dex/issues
11
+ Keywords: rag,memory,ai-agents,llm,vector-store,mem0
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
17
+ Requires-Python: >=3.11
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: mem0ai>=0.1.0
21
+ Requires-Dist: chromadb>=1.0.0
22
+ Provides-Extra: dev
23
+ Requires-Dist: pytest>=7.0; extra == "dev"
24
+ Dynamic: license-file
25
+
26
+ # zer0dex
27
+
28
+ **A token-efficient memory architecture for persistent AI agents.**
29
+
30
+ zer0dex combines a compressed human-readable index with a local vector store to give AI agents long-term memory that outperforms both flat files and traditional RAG.
31
+
32
+ ## Results (n=97)
33
+
34
+ | Architecture | Recall | ≥75% Pass Rate | Cross-Reference |
35
+ |---|---|---|---|
36
+ | Flat File Only | 52.2% | 41% | 70.0% |
37
+ | Full RAG | 80.3% | 77% | 37.5% |
38
+ | **zer0dex** | **91.2%** | **87%** | **80.0%** |
39
+
40
+ **Zero losses** in head-to-head comparison. 70ms latency. $0/month (fully local).
41
+
42
+ ## The Problem
43
+
44
+ Persistent AI agents need memory across sessions. Current approaches all have gaps:
45
+
46
+ - **Flat files** (MEMORY.md, etc.) — cheap on tokens but poor retrieval. The agent has to "know what it knows."
47
+ - **Full RAG** (vector store only) — good retrieval but poor cross-referencing. Facts are "floating" with no structure.
48
+ - **MemGPT/Letta** — powerful but complex. The LLM manages its own memory paging, adding latency and cost.
49
+
50
+ ## The Architecture
51
+
52
+ zer0dex uses two layers:
53
+
54
+ ### Layer 1: Compressed Index (MEMORY.md)
55
+
56
+ A human-readable markdown file (~3KB) that acts as a **semantic table of contents**. It tells the agent *what categories of knowledge exist* without storing full details.
57
+
58
+ ```markdown
59
+ ## Products
60
+ - **Little Canary** — prompt injection detection, 99% on TensorTrust
61
+ - mem0 topics: Little Canary, prompt injection, HERM
62
+ ```
63
+
64
+ This index is always in context (~782 tokens). It provides **navigational scaffolding** — the agent knows where knowledge lives.
65
+
66
+ ### Layer 2: Vector Store (mem0 + chromadb)
67
+
68
+ A semantic fact store containing extracted details from daily logs, conversations, and curated notes. Queried via embedding similarity on every inbound message.
69
+
70
+ ### The Hook: Automatic Pre-Message Injection
71
+
72
+ A lightweight HTTP server keeps the vector store warm in memory. Every inbound message triggers a semantic query (70ms), and the top 5 relevant memories are injected into the agent's context automatically. No judgment call. No forgetting.
73
+
74
+ ```
75
+ User: "How's the Suy Sideguy deployment going?"
76
+ ↓
77
+ Hook queries mem0 → finds: "Suy: watching PID 76977, qwen3:4b judge"
78
+ ↓
79
+ Agent sees: [message] + [Suy context from mem0] + [MEMORY.md index]
80
+ ↓
81
+ Agent responds with specific details it otherwise wouldn't have
82
+ ```
83
+
84
+ ## Why It Works
85
+
86
+ The compressed index solves the **cross-reference problem**. When a user asks "How does X relate to Y?", vector similarity finds X *or* Y, rarely both. But the compressed index contains cross-domain pointers — it's like a hyperlinked table of contents. The LLM uses the index to bridge domains that vector similarity alone can't connect.
87
+
88
+ | Query Type | Full RAG | zer0dex | Gap |
89
+ |---|---|---|---|
90
+ | Direct recall | 84.3% | 92.1% | +7.8pp |
91
+ | Cross-reference | 37.5% | 80.0% | **+42.5pp** |
92
+ | Negative (rejection) | 100% | 100% | 0pp |
93
+
94
+ ## Quick Start
95
+
96
+ ### Requirements
97
+
98
+ - Python 3.11+
99
+ - [Ollama](https://ollama.ai) with `nomic-embed-text` and `mistral:7b`
100
+ - 8GB+ RAM
101
+
102
+ ### Install
103
+
104
+ ```bash
105
+ pip install zer0dex
106
+
107
+ # Pull embedding + extraction models
108
+ ollama pull nomic-embed-text
109
+ ollama pull mistral:7b
110
+ ```
111
+
112
+ ### 1. Create Your Compressed Index
113
+
114
+ Create a `MEMORY.md` file — a compressed summary of what your agent knows:
115
+
116
+ ```markdown
117
+ # Agent Memory Index
118
+
119
+ ## User
120
+ - Name: Alice
121
+ - Role: ML Engineer
122
+ - Topics in mem0: Alice, preferences, projects
123
+
124
+ ## Projects
125
+ - **ProjectX** — NLP pipeline, deadline March 15
126
+ - Topics in mem0: ProjectX, NLP, deadlines
127
+ ```
128
+
129
+ ### 2. Initialize and Seed
130
+
131
+ ```bash
132
+ zer0dex init
133
+ zer0dex check # validate Ollama, models, deps
134
+ zer0dex seed --source MEMORY.md --source memory/
135
+ ```
136
+
137
+ ### 3. Start the Memory Server
138
+
139
+ ```bash
140
+ zer0dex serve
141
+ ```
142
+
143
+ ### 4. Integrate with Your Agent
144
+
145
+ The server exposes a simple HTTP API:
146
+
147
+ ```bash
148
+ # Query
149
+ curl -X POST http://localhost:18420/query \
150
+ -H "Content-Type: application/json" \
151
+ -d '{"text": "What is ProjectX?", "limit": 5}'
152
+
153
+ # Add memory
154
+ curl -X POST http://localhost:18420/add \
155
+ -H "Content-Type: application/json" \
156
+ -d '{"text": "ProjectX deadline moved to March 20"}'
157
+
158
+ # Health check
159
+ curl http://localhost:18420/health
160
+ ```
161
+
162
+ For automatic injection, add a pre-message hook in your agent framework that queries the server before every LLM call.
163
+
164
+ ## Evaluation
165
+
166
+ Run the evaluation suite yourself:
167
+
168
+ ```bash
169
+ python eval/evaluate.py --memories 86 --test-cases 97
170
+ ```
171
+
172
+ See [eval/README.md](eval/README.md) for methodology and detailed results.
173
+
174
+ ## Architecture Diagram
175
+
176
+ ```
177
+ ┌─────────────────────────────────────────────────┐
178
+ │ Agent Context │
179
+ │ │
180
+ │ ┌──────────────┐ ┌───────────────────────┐ │
181
+ │ │ MEMORY.md │ │ mem0 Results (auto) │ │
182
+ │ │ (compressed │ │ [injected by hook] │ │
183
+ │ │ index) │ │ │ │
184
+ │ │ ~782 tokens │ │ ~104 tokens │ │
185
+ │ └──────────────┘ └───────────────────────┘ │
186
+ │ ↑ ↑ │
187
+ │ Always loaded Pre-message hook │
188
+ │ at session start queries on every msg │
189
+ └─────────────────────────────────────────────────┘
190
+ ↑
191
+ ┌─────────────────┐
192
+ │ mem0 HTTP Server │
193
+ │ (port 18420) │
194
+ │ 70ms avg query │
195
+ └─────────────────┘
196
+ ↑
197
+ ┌─────────────────┐
198
+ │ chromadb │
199
+ │ (local vector │
200
+ │ store) │
201
+ └─────────────────┘
202
+ ```
203
+
204
+ ## How It Compares
205
+
206
+ | Feature | Flat Files | Full RAG | MemGPT/Letta | **zer0dex** |
207
+ |---|---|---|---|---|
208
+ | Recall | 52% | 80% | ~80%* | **91%** |
209
+ | Cross-reference | 70% | 38% | Unknown | **80%** |
210
+ | Latency | 0ms | ~15ms | ~500ms+ | **70ms** |
211
+ | Token overhead | 782 | 104 | Variable | **886** |
212
+ | Cost/month | $0 | $0-50 | $0-50 | **$0** |
213
+ | Complexity | Trivial | Moderate | High | **Low** |
214
+ | Auto-retrieval | No | On-demand | LLM-managed | **Every message** |
215
+
216
+ *MemGPT recall estimated; no published head-to-head comparison available.
217
+
218
+ ## Citation
219
+
220
+ ```bibtex
221
+ @misc{bosch2026zer0dex,
222
+ title={zer0dex: Dual-Layer Memory Architecture for Persistent AI Agents},
223
+ author={Bosch, Rolando},
224
+ year={2026},
225
+ url={https://github.com/roli-lpci/zer0dex}
226
+ }
227
+ ```
228
+
229
+ ## License
230
+
231
+ Apache 2.0
232
+
233
+ ## Credits
234
+
235
+ Built by [Hermes Labs](https://hermes-labs.ai) as part of LPCI (Linguistically Persistent Cognitive Interface) research.
236
+
237
+ Uses [mem0](https://mem0.ai) for vector storage, [chromadb](https://www.trychroma.com/) for the vector database, and [Ollama](https://ollama.ai) for local embeddings/extraction.
@@ -0,0 +1,212 @@
1
+ # zer0dex
2
+
3
+ **A token-efficient memory architecture for persistent AI agents.**
4
+
5
+ zer0dex combines a compressed human-readable index with a local vector store to give AI agents long-term memory that outperforms both flat files and traditional RAG.
6
+
7
+ ## Results (n=97)
8
+
9
+ | Architecture | Recall | ≥75% Pass Rate | Cross-Reference |
10
+ |---|---|---|---|
11
+ | Flat File Only | 52.2% | 41% | 70.0% |
12
+ | Full RAG | 80.3% | 77% | 37.5% |
13
+ | **zer0dex** | **91.2%** | **87%** | **80.0%** |
14
+
15
+ **Zero losses** in head-to-head comparison. 70ms latency. $0/month (fully local).
16
+
17
+ ## The Problem
18
+
19
+ Persistent AI agents need memory across sessions. Current approaches all have gaps:
20
+
21
+ - **Flat files** (MEMORY.md, etc.) — cheap on tokens but poor retrieval. The agent has to "know what it knows."
22
+ - **Full RAG** (vector store only) — good retrieval but poor cross-referencing. Facts are "floating" with no structure.
23
+ - **MemGPT/Letta** — powerful but complex. The LLM manages its own memory paging, adding latency and cost.
24
+
25
+ ## The Architecture
26
+
27
+ zer0dex uses two layers:
28
+
29
+ ### Layer 1: Compressed Index (MEMORY.md)
30
+
31
+ A human-readable markdown file (~3KB) that acts as a **semantic table of contents**. It tells the agent *what categories of knowledge exist* without storing full details.
32
+
33
+ ```markdown
34
+ ## Products
35
+ - **Little Canary** — prompt injection detection, 99% on TensorTrust
36
+ - mem0 topics: Little Canary, prompt injection, HERM
37
+ ```
38
+
39
+ This index is always in context (~782 tokens). It provides **navigational scaffolding** — the agent knows where knowledge lives.
40
+
41
+ ### Layer 2: Vector Store (mem0 + chromadb)
42
+
43
+ A semantic fact store containing extracted details from daily logs, conversations, and curated notes. Queried via embedding similarity on every inbound message.
44
+
45
+ ### The Hook: Automatic Pre-Message Injection
46
+
47
+ A lightweight HTTP server keeps the vector store warm in memory. Every inbound message triggers a semantic query (70ms), and the top 5 relevant memories are injected into the agent's context automatically. No judgment call. No forgetting.
48
+
49
+ ```
50
+ User: "How's the Suy Sideguy deployment going?"
51
+ ↓
52
+ Hook queries mem0 → finds: "Suy: watching PID 76977, qwen3:4b judge"
53
+ ↓
54
+ Agent sees: [message] + [Suy context from mem0] + [MEMORY.md index]
55
+ ↓
56
+ Agent responds with specific details it otherwise wouldn't have
57
+ ```
58
+
59
+ ## Why It Works
60
+
61
+ The compressed index solves the **cross-reference problem**. When a user asks "How does X relate to Y?", vector similarity finds X *or* Y, rarely both. But the compressed index contains cross-domain pointers — it's like a hyperlinked table of contents. The LLM uses the index to bridge domains that vector similarity alone can't connect.
62
+
63
+ | Query Type | Full RAG | zer0dex | Gap |
64
+ |---|---|---|---|
65
+ | Direct recall | 84.3% | 92.1% | +7.8pp |
66
+ | Cross-reference | 37.5% | 80.0% | **+42.5pp** |
67
+ | Negative (rejection) | 100% | 100% | 0pp |
68
+
69
+ ## Quick Start
70
+
71
+ ### Requirements
72
+
73
+ - Python 3.11+
74
+ - [Ollama](https://ollama.ai) with `nomic-embed-text` and `mistral:7b`
75
+ - 8GB+ RAM
76
+
77
+ ### Install
78
+
79
+ ```bash
80
+ pip install zer0dex
81
+
82
+ # Pull embedding + extraction models
83
+ ollama pull nomic-embed-text
84
+ ollama pull mistral:7b
85
+ ```
86
+
87
+ ### 1. Create Your Compressed Index
88
+
89
+ Create a `MEMORY.md` file — a compressed summary of what your agent knows:
90
+
91
+ ```markdown
92
+ # Agent Memory Index
93
+
94
+ ## User
95
+ - Name: Alice
96
+ - Role: ML Engineer
97
+ - Topics in mem0: Alice, preferences, projects
98
+
99
+ ## Projects
100
+ - **ProjectX** — NLP pipeline, deadline March 15
101
+ - Topics in mem0: ProjectX, NLP, deadlines
102
+ ```
103
+
104
+ ### 2. Initialize and Seed
105
+
106
+ ```bash
107
+ zer0dex init
108
+ zer0dex check # validate Ollama, models, deps
109
+ zer0dex seed --source MEMORY.md --source memory/
110
+ ```
111
+
112
+ ### 3. Start the Memory Server
113
+
114
+ ```bash
115
+ zer0dex serve
116
+ ```
117
+
118
+ ### 4. Integrate with Your Agent
119
+
120
+ The server exposes a simple HTTP API:
121
+
122
+ ```bash
123
+ # Query
124
+ curl -X POST http://localhost:18420/query \
125
+ -H "Content-Type: application/json" \
126
+ -d '{"text": "What is ProjectX?", "limit": 5}'
127
+
128
+ # Add memory
129
+ curl -X POST http://localhost:18420/add \
130
+ -H "Content-Type: application/json" \
131
+ -d '{"text": "ProjectX deadline moved to March 20"}'
132
+
133
+ # Health check
134
+ curl http://localhost:18420/health
135
+ ```
136
+
137
+ For automatic injection, add a pre-message hook in your agent framework that queries the server before every LLM call.
138
+
139
+ ## Evaluation
140
+
141
+ Run the evaluation suite yourself:
142
+
143
+ ```bash
144
+ python eval/evaluate.py --memories 86 --test-cases 97
145
+ ```
146
+
147
+ See [eval/README.md](eval/README.md) for methodology and detailed results.
148
+
149
+ ## Architecture Diagram
150
+
151
+ ```
152
+ ┌─────────────────────────────────────────────────┐
153
+ │ Agent Context │
154
+ │ │
155
+ │ ┌──────────────┐ ┌───────────────────────┐ │
156
+ │ │ MEMORY.md │ │ mem0 Results (auto) │ │
157
+ │ │ (compressed │ │ [injected by hook] │ │
158
+ │ │ index) │ │ │ │
159
+ │ │ ~782 tokens │ │ ~104 tokens │ │
160
+ │ └──────────────┘ └───────────────────────┘ │
161
+ │ ↑ ↑ │
162
+ │ Always loaded Pre-message hook │
163
+ │ at session start queries on every msg │
164
+ └─────────────────────────────────────────────────┘
165
+ ↑
166
+ ┌─────────────────┐
167
+ │ mem0 HTTP Server │
168
+ │ (port 18420) │
169
+ │ 70ms avg query │
170
+ └─────────────────┘
171
+ ↑
172
+ ┌─────────────────┐
173
+ │ chromadb │
174
+ │ (local vector │
175
+ │ store) │
176
+ └─────────────────┘
177
+ ```
178
+
179
+ ## How It Compares
180
+
181
+ | Feature | Flat Files | Full RAG | MemGPT/Letta | **zer0dex** |
182
+ |---|---|---|---|---|
183
+ | Recall | 52% | 80% | ~80%* | **91%** |
184
+ | Cross-reference | 70% | 38% | Unknown | **80%** |
185
+ | Latency | 0ms | ~15ms | ~500ms+ | **70ms** |
186
+ | Token overhead | 782 | 104 | Variable | **886** |
187
+ | Cost/month | $0 | $0-50 | $0-50 | **$0** |
188
+ | Complexity | Trivial | Moderate | High | **Low** |
189
+ | Auto-retrieval | No | On-demand | LLM-managed | **Every message** |
190
+
191
+ *MemGPT recall estimated; no published head-to-head comparison available.
192
+
193
+ ## Citation
194
+
195
+ ```bibtex
196
+ @misc{bosch2026zer0dex,
197
+ title={zer0dex: Dual-Layer Memory Architecture for Persistent AI Agents},
198
+ author={Bosch, Rolando},
199
+ year={2026},
200
+ url={https://github.com/roli-lpci/zer0dex}
201
+ }
202
+ ```
203
+
204
+ ## License
205
+
206
+ Apache 2.0
207
+
208
+ ## Credits
209
+
210
+ Built by [Hermes Labs](https://hermes-labs.ai) as part of LPCI (Linguistically Persistent Cognitive Interface) research.
211
+
212
+ Uses [mem0](https://mem0.ai) for vector storage, [chromadb](https://www.trychroma.com/) for the vector database, and [Ollama](https://ollama.ai) for local embeddings/extraction.
@@ -0,0 +1,45 @@
1
+ [project]
2
+ name = "zer0dex"
3
+ version = "0.0.9"
4
+ description = "Dual-layer memory for AI agents. Compressed index + vector store. 91% recall, 70ms, $0/month."
5
+ readme = "README.md"
6
+ license = "Apache-2.0"
7
+ requires-python = ">=3.11"
8
+ authors = [
9
+ { name = "Rolando Bosch", email = "rbosch@hermes-labs.ai" },
10
+ ]
11
+ keywords = ["rag", "memory", "ai-agents", "llm", "vector-store", "mem0"]
12
+ classifiers = [
13
+ "Development Status :: 3 - Alpha",
14
+ "Intended Audience :: Developers",
15
+ "Programming Language :: Python :: 3.11",
16
+ "Programming Language :: Python :: 3.12",
17
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
18
+ ]
19
+ dependencies = [
20
+ "mem0ai>=0.1.0",
21
+ "chromadb>=1.0.0",
22
+ ]
23
+
24
+ [project.optional-dependencies]
25
+ dev = ["pytest>=7.0"]
26
+
27
+ [project.urls]
28
+ Homepage = "https://github.com/roli-lpci/zer0dex"
29
+ Documentation = "https://hermes-labs.ai/zer0dex"
30
+ Repository = "https://github.com/roli-lpci/zer0dex"
31
+ Issues = "https://github.com/roli-lpci/zer0dex/issues"
32
+
33
+ [project.scripts]
34
+ zer0dex = "zer0dex.cli:main"
35
+
36
+ [tool.setuptools.packages.find]
37
+ where = ["src"]
38
+
39
+ [tool.setuptools.package-dir]
40
+ "" = "src"
41
+
42
+ [build-system]
43
+ requires = ["setuptools>=68.0"]
44
+ build-backend = "setuptools.build_meta"
45
+
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1 @@
1
+ __version__ = "0.0.9"