hermes-memory-vault 0.2.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.
Files changed (30) hide show
  1. hermes_memory_vault-0.2.0/LICENSE +21 -0
  2. hermes_memory_vault-0.2.0/PKG-INFO +300 -0
  3. hermes_memory_vault-0.2.0/README.md +264 -0
  4. hermes_memory_vault-0.2.0/pyproject.toml +73 -0
  5. hermes_memory_vault-0.2.0/setup.cfg +4 -0
  6. hermes_memory_vault-0.2.0/src/hermes_memory_vault.egg-info/PKG-INFO +300 -0
  7. hermes_memory_vault-0.2.0/src/hermes_memory_vault.egg-info/SOURCES.txt +28 -0
  8. hermes_memory_vault-0.2.0/src/hermes_memory_vault.egg-info/dependency_links.txt +1 -0
  9. hermes_memory_vault-0.2.0/src/hermes_memory_vault.egg-info/entry_points.txt +3 -0
  10. hermes_memory_vault-0.2.0/src/hermes_memory_vault.egg-info/requires.txt +16 -0
  11. hermes_memory_vault-0.2.0/src/hermes_memory_vault.egg-info/top_level.txt +1 -0
  12. hermes_memory_vault-0.2.0/src/memory_vault/__init__.py +29 -0
  13. hermes_memory_vault-0.2.0/src/memory_vault/__main__.py +5 -0
  14. hermes_memory_vault-0.2.0/src/memory_vault/cli/__init__.py +1 -0
  15. hermes_memory_vault-0.2.0/src/memory_vault/cli/main.py +780 -0
  16. hermes_memory_vault-0.2.0/src/memory_vault/core/__init__.py +1 -0
  17. hermes_memory_vault-0.2.0/src/memory_vault/core/builder.py +775 -0
  18. hermes_memory_vault-0.2.0/src/memory_vault/core/config.py +65 -0
  19. hermes_memory_vault-0.2.0/src/memory_vault/core/llm.py +402 -0
  20. hermes_memory_vault-0.2.0/src/memory_vault/core/manifest.py +109 -0
  21. hermes_memory_vault-0.2.0/src/memory_vault/core/narrator.py +337 -0
  22. hermes_memory_vault-0.2.0/src/memory_vault/core/pack.py +308 -0
  23. hermes_memory_vault-0.2.0/src/memory_vault/core/renderer.py +404 -0
  24. hermes_memory_vault-0.2.0/src/memory_vault/core/session_index.py +499 -0
  25. hermes_memory_vault-0.2.0/src/memory_vault/core/tui.py +531 -0
  26. hermes_memory_vault-0.2.0/src/memory_vault/webhook/__init__.py +242 -0
  27. hermes_memory_vault-0.2.0/src/memory_vault/webhook/__main__.py +10 -0
  28. hermes_memory_vault-0.2.0/tests/test_llm.py +500 -0
  29. hermes_memory_vault-0.2.0/tests/test_pack.py +259 -0
  30. hermes_memory_vault-0.2.0/tests/test_session_index.py +298 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jules Zhou
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,300 @@
1
+ Metadata-Version: 2.4
2
+ Name: hermes-memory-vault
3
+ Version: 0.2.0
4
+ Summary: Portable Context Protocol — package AI agent sessions into portable .hermes-memory packs
5
+ Author-email: Jules Zhou <juleszhou01@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/iruzen-dono/memory-vault
8
+ Project-URL: Repository, https://github.com/iruzen-dono/memory-vault
9
+ Project-URL: Issues, https://github.com/iruzen-dono/memory-vault/issues
10
+ Project-URL: Documentation, https://github.com/iruzen-dono/memory-vault/blob/master/docs/ARCHITECTURE.md
11
+ Project-URL: Changelog, https://github.com/iruzen-dono/memory-vault/blob/master/CHANGELOG.md
12
+ Keywords: hermes,ai-agent,memory,portable,open-source
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Requires-Python: >=3.11
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: typer<1.0,>=0.12
24
+ Requires-Dist: pydantic<3.0,>=2.0
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest<9.0,>=7.0; extra == "dev"
27
+ Requires-Dist: mypy<2.0,>=1.0; extra == "dev"
28
+ Requires-Dist: ruff<1.0,>=0.1; extra == "dev"
29
+ Provides-Extra: vault
30
+ Requires-Dist: markdown<4.0,>=3.5; extra == "vault"
31
+ Provides-Extra: tui
32
+ Requires-Dist: textual<3.0,>=2.0; extra == "tui"
33
+ Provides-Extra: all
34
+ Requires-Dist: memory-vault[tui,vault]; extra == "all"
35
+ Dynamic: license-file
36
+
37
+ # Memory Vault — Portable Context Protocol
38
+
39
+ > **From agent session to shareable context in one command.**
40
+
41
+ [![CI](https://github.com/iruzen-dono/memory-vault/actions/workflows/ci.yml/badge.svg)](https://github.com/iruzen-dono/memory-vault/actions/workflows/ci.yml)
42
+ [![PyPI version](https://img.shields.io/pypi/v/hermes-memory-vault.svg?style=flat-square&logo=pypi&logoColor=white)](https://pypi.org/project/hermes-memory-vault/)
43
+ [![PyPI downloads](https://img.shields.io/pypi/dm/hermes-memory-vault.svg?style=flat-square)](https://pypi.org/project/hermes-memory-vault/)
44
+ ![Python](https://img.shields.io/badge/Python-3.11%2B-3776AB?style=flat-square&logo=python&logoColor=white)
45
+ ![License](https://img.shields.io/badge/License-MIT-green?style=flat-square)
46
+ ![Platform](https://img.shields.io/badge/Platform-Windows%20%7C%20Linux%20%7C%20macOS-lightgrey?style=flat-square)
47
+
48
+ Memory Vault turns any Hermes session into a portable `.hermes-memory` **context pack** — the conversation, the tool traces, the artifacts created, and a handoff brief that lets another agent pick up exactly where you left off.
49
+
50
+ ## Installation
51
+
52
+ ```bash
53
+ pipx install hermes-memory-vault
54
+ # or
55
+ pip install hermes-memory-vault
56
+ ```
57
+
58
+ > The distribution is named **`hermes-memory-vault`** because `memory-vault`
59
+ > is already taken on PyPI by an unrelated project. The package you import is
60
+ > still `memory_vault`, and the command is still `memory-vault`.
61
+
62
+ Or install from source:
63
+
64
+ ```bash
65
+ git clone https://github.com/iruzen-dono/memory-vault.git
66
+ cd memory-vault
67
+ pip install -e .
68
+ ```
69
+
70
+ Requires Python 3.11+. The CLI exposes the `memory-vault` command:
71
+
72
+ ```bash
73
+ # Launch the interactive TUI browser
74
+ memory-vault browse
75
+
76
+ # List sessions
77
+ memory-vault list-sessions
78
+
79
+ # Export a session into a shareable pack
80
+ memory-vault export <session-id> --project-root . -o bot.hermes-memory
81
+
82
+ # Inspect a pack
83
+ memory-vault info bot.hermes-memory
84
+
85
+ # Import (show handoff + artifacts)
86
+ memory-vault import-pack bot.hermes-memory
87
+ ```
88
+
89
+ ## Features
90
+
91
+ ### 🖥️ Interactive TUI (`memory-vault browse`)
92
+
93
+ Browse sessions with enriched titles (LLM-generated), search, export, and re-index — all from the terminal.
94
+
95
+ ```
96
+ ┌────────── Session Browser ───────────┐
97
+ │ Config Fix │
98
+ │ 20260629_06423 · deepseek-v4-flash │
99
+ │ The AI agent fixed config issues… │
100
+ │ │
101
+ │ LLM: ✅ cloudflare │
102
+ │ Memory Vault Dev │
103
+ │ 20260628 · deepseek-v4-flash │
104
+ │ Developed and tested Memory Vault… │
105
+ └──────────────────────────────────────┘
106
+ ```
107
+
108
+ Press `i` to re-index a session, `e` to export, `Ctrl+P` to search. The footer shows your active LLM provider with its availability status.
109
+
110
+ ### 📋 Provider Management (`memory-vault providers`)
111
+
112
+ List all registered LLM providers and whether they're available (creds detected):
113
+
114
+ ```bash
115
+ $ memory-vault providers
116
+ Provider Available
117
+ ──────────────── ────────────
118
+ cloudflare ✅
119
+ anthropic ❌
120
+ openai ❌
121
+ ```
122
+
123
+ Persist a provider choice so you don't need env vars:
124
+
125
+ ```bash
126
+ memory-vault config set llm.provider cloudflare
127
+ memory-vault config get llm.provider # cloudflare
128
+ memory-vault config list # show all stored config
129
+ ```
130
+
131
+ ### 🧠 Smart Session Indexing (`memory-vault index`)
132
+
133
+ Generate descriptive titles and summaries for all your Hermes sessions using an LLM provider. Supports any OpenAI-compatible API and Cloudflare Workers AI out of the box.
134
+
135
+ ```bash
136
+ # Index all sessions (auto-detects provider)
137
+ memory-vault index
138
+
139
+ # Index with 4 parallel workers (much faster)
140
+ memory-vault index --workers 4
141
+
142
+ # Use Cloudflare Workers AI
143
+ export CLOUDFLARE_ACCOUNT_ID="..."
144
+ export CLOUDFLARE_API_TOKEN="..."
145
+ memory-vault index --force
146
+
147
+ # Use any OpenAI-compatible API
148
+ export OPENAI_BASE_URL="https://api.openai.com/v1"
149
+ export OPENAI_API_KEY="sk-..."
150
+ memory-vault index
151
+
152
+ # Override the model per run
153
+ MEMORY_VAULT_INDEX_MODEL="gpt-4o" memory-vault index
154
+ ```
155
+
156
+ ### 📦 Context Packs
157
+
158
+ Shareable, self-contained archives of any Hermes session.
159
+
160
+ ## Why context packs?
161
+
162
+ AI agent sessions produce **context** — conversations, decisions, files, tool calls — but it's trapped inside the agent's database. Memory Vault extracts it into a structured, portable format that's:
163
+
164
+ - **Shareable** — send a `.hermes-memory` file to a teammate or another agent
165
+ - **Restartable** — the handoff brief tells the receiving agent what was done and how
166
+ - **Auditable** — full transcript + tool traces + artifact copies in one file
167
+ - **Self-contained** — includes everything needed to understand the session
168
+
169
+ ## The format
170
+
171
+ A `.hermes-memory` file is a **tar.gz archive** with a clean layout:
172
+
173
+ ```
174
+ bot.hermes-memory/
175
+ ├── manifest.json # Metadata: title, tags, source session, git commit, tool usage
176
+ ├── narrative.md # Chronological story of the session
177
+ ├── messages.json # Raw session messages (for deep reference)
178
+ ├── decisions.json # Key decisions extracted (AI-generated)
179
+ ├── artifacts/ # Files created or modified during the session
180
+ │ ├── src/bot.py
181
+ │ └── ...
182
+ ├── tool-traces.json # Tool usage summary (calls per tool)
183
+ └── context/
184
+ ├── handoff.md # Brief for the receiving agent
185
+ └── references.md # URLs and resources used in the session
186
+ ```
187
+
188
+ ## Quick start
189
+
190
+ ### 1. Install
191
+
192
+ ```bash
193
+ pip install "memory-vault[tui]" # with TUI
194
+ pip install "memory-vault" # CLI only (lighter)
195
+ ```
196
+
197
+ ### 2. Browse sessions
198
+
199
+ ```bash
200
+ memory-vault browse
201
+ # or just list:
202
+ memory-vault list-sessions
203
+ ```
204
+
205
+ ### 3. Index sessions (optional, for meaningful titles)
206
+
207
+ Requires an LLM provider. By default tries `CLOUDFLARE_ACCOUNT_ID` + `CLOUDFLARE_API_TOKEN` for Cloudflare Workers AI. Falls back gracefully with template titles.
208
+
209
+ ```bash
210
+ # Auto-detect Cloudflare Workers AI
211
+ memory-vault index
212
+
213
+ # Or set any OpenAI-compatible provider
214
+ export OPENAI_BASE_URL="https://api.openai.com/v1"
215
+ export OPENAI_API_KEY="sk-..."
216
+ memory-vault index
217
+
218
+ # Only new sessions (skip already-indexed)
219
+ memory-vault index --new
220
+ ```
221
+
222
+ ### 4. Export a session
223
+
224
+ ```bash
225
+ memory-vault export 20260620_143021_a1b2c3 \
226
+ --title "Hyperliquid Trading Bot" \
227
+ --tags trading,hyperliquid,defi \
228
+ --project-root /path/to/project \
229
+ --author iruzen
230
+ ```
231
+
232
+ ### 5. Share or archive
233
+
234
+ Send the `.hermes-memory` file anywhere. The receiving agent loads it with:
235
+
236
+ ```bash
237
+ memory-vault import-pack bot.hermes-memory
238
+ ```
239
+
240
+ ## Commands
241
+
242
+ | Command | Description |
243
+ |---------|-------------|
244
+ | `browse` | Launch interactive TUI (sessions or packs) |
245
+ | `list-sessions` | Browse available Hermes sessions |
246
+ | `export <id>` | Pack a session into .hermes-memory |
247
+ | `info <pack>` | Inspect a pack (metadata, artifacts, tools) |
248
+ | `import-pack <pack>` | Show handoff brief, artifacts, and tool traces |
249
+ | `list` | List all packs in a directory |
250
+ | `search <pattern>` | Regex search across packs |
251
+ | `render <pack>` | Render pack as Markdown or HTML |
252
+ | `index [--workers N]` | Enrich session titles & summaries via LLM |
253
+ | `providers` | List available LLM providers and their status |
254
+ | `config set/get/list` | Manage persistent configuration |
255
+ | `diff <pack1> <pack2>` | Compare two context packs side-by-side |
256
+
257
+ ## Use cases
258
+
259
+ - **Handoff between agents**: finish a session on desktop, continue on Telegram
260
+ - **Project snapshots**: capture the full context of building a feature
261
+ - **Debugging archives**: save the session that led to a bug
262
+ - **Knowledge base**: build a library of past agent actions
263
+ - **Onboarding**: share how a complex task was done
264
+
265
+ ## How it works
266
+
267
+ Memory Vault reads directly from the Hermes sessions database (`state.db`). It:
268
+
269
+ 1. Queries the session metadata (title, model, platform, duration)
270
+ 2. Reads all messages (user prompts, assistant responses, tool calls)
271
+ 3. Builds a chronological narrative from the conversation
272
+ 4. Detects artifacts by scanning `write_file` and `patch` tool calls
273
+ 5. Counts tool usage for the summary
274
+ 6. Generates a handoff brief with the original goal and key results
275
+ 7. Packages everything into a compressed `.hermes-memory` archive
276
+
277
+ ## Project structure
278
+
279
+ ```
280
+ src/memory_vault/
281
+ ├── __init__.py # Version + public exports
282
+ ├── __main__.py # CLI entry point
283
+ ├── cli/
284
+ │ └── main.py # Typer commands (export, info, import, list, search, render, index, browse)
285
+ ├── core/
286
+ │ ├── __init__.py
287
+ │ ├── llm.py # LLMProvider ABC + CloudflareAI + OpenAICompatibleProvider
288
+ │ ├── config.py # JSON config persistence (llm.provider, etc.)
289
+ │ ├── manifest.py # Manifest dataclass + serialization
290
+ │ ├── pack.py # ContextPack — in-memory representation + tar.gz I/O
291
+ │ ├── builder.py # ContextBuilder — reads Hermes sessions, builds packs
292
+ │ ├── narrator.py # SessionNarrator — compresses conversations via LLM
293
+ │ ├── renderer.py # Export packs as Markdown or HTML
294
+ │ ├── session_index.py # SessionIndex — SQLite cache for LLM-enriched titles
295
+ │ └── tui.py # MemoryVaultTUI — Textual-based interactive browser
296
+ ```
297
+
298
+ ## License
299
+
300
+ MIT
@@ -0,0 +1,264 @@
1
+ # Memory Vault — Portable Context Protocol
2
+
3
+ > **From agent session to shareable context in one command.**
4
+
5
+ [![CI](https://github.com/iruzen-dono/memory-vault/actions/workflows/ci.yml/badge.svg)](https://github.com/iruzen-dono/memory-vault/actions/workflows/ci.yml)
6
+ [![PyPI version](https://img.shields.io/pypi/v/hermes-memory-vault.svg?style=flat-square&logo=pypi&logoColor=white)](https://pypi.org/project/hermes-memory-vault/)
7
+ [![PyPI downloads](https://img.shields.io/pypi/dm/hermes-memory-vault.svg?style=flat-square)](https://pypi.org/project/hermes-memory-vault/)
8
+ ![Python](https://img.shields.io/badge/Python-3.11%2B-3776AB?style=flat-square&logo=python&logoColor=white)
9
+ ![License](https://img.shields.io/badge/License-MIT-green?style=flat-square)
10
+ ![Platform](https://img.shields.io/badge/Platform-Windows%20%7C%20Linux%20%7C%20macOS-lightgrey?style=flat-square)
11
+
12
+ Memory Vault turns any Hermes session into a portable `.hermes-memory` **context pack** — the conversation, the tool traces, the artifacts created, and a handoff brief that lets another agent pick up exactly where you left off.
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ pipx install hermes-memory-vault
18
+ # or
19
+ pip install hermes-memory-vault
20
+ ```
21
+
22
+ > The distribution is named **`hermes-memory-vault`** because `memory-vault`
23
+ > is already taken on PyPI by an unrelated project. The package you import is
24
+ > still `memory_vault`, and the command is still `memory-vault`.
25
+
26
+ Or install from source:
27
+
28
+ ```bash
29
+ git clone https://github.com/iruzen-dono/memory-vault.git
30
+ cd memory-vault
31
+ pip install -e .
32
+ ```
33
+
34
+ Requires Python 3.11+. The CLI exposes the `memory-vault` command:
35
+
36
+ ```bash
37
+ # Launch the interactive TUI browser
38
+ memory-vault browse
39
+
40
+ # List sessions
41
+ memory-vault list-sessions
42
+
43
+ # Export a session into a shareable pack
44
+ memory-vault export <session-id> --project-root . -o bot.hermes-memory
45
+
46
+ # Inspect a pack
47
+ memory-vault info bot.hermes-memory
48
+
49
+ # Import (show handoff + artifacts)
50
+ memory-vault import-pack bot.hermes-memory
51
+ ```
52
+
53
+ ## Features
54
+
55
+ ### 🖥️ Interactive TUI (`memory-vault browse`)
56
+
57
+ Browse sessions with enriched titles (LLM-generated), search, export, and re-index — all from the terminal.
58
+
59
+ ```
60
+ ┌────────── Session Browser ───────────┐
61
+ │ Config Fix │
62
+ │ 20260629_06423 · deepseek-v4-flash │
63
+ │ The AI agent fixed config issues… │
64
+ │ │
65
+ │ LLM: ✅ cloudflare │
66
+ │ Memory Vault Dev │
67
+ │ 20260628 · deepseek-v4-flash │
68
+ │ Developed and tested Memory Vault… │
69
+ └──────────────────────────────────────┘
70
+ ```
71
+
72
+ Press `i` to re-index a session, `e` to export, `Ctrl+P` to search. The footer shows your active LLM provider with its availability status.
73
+
74
+ ### 📋 Provider Management (`memory-vault providers`)
75
+
76
+ List all registered LLM providers and whether they're available (creds detected):
77
+
78
+ ```bash
79
+ $ memory-vault providers
80
+ Provider Available
81
+ ──────────────── ────────────
82
+ cloudflare ✅
83
+ anthropic ❌
84
+ openai ❌
85
+ ```
86
+
87
+ Persist a provider choice so you don't need env vars:
88
+
89
+ ```bash
90
+ memory-vault config set llm.provider cloudflare
91
+ memory-vault config get llm.provider # cloudflare
92
+ memory-vault config list # show all stored config
93
+ ```
94
+
95
+ ### 🧠 Smart Session Indexing (`memory-vault index`)
96
+
97
+ Generate descriptive titles and summaries for all your Hermes sessions using an LLM provider. Supports any OpenAI-compatible API and Cloudflare Workers AI out of the box.
98
+
99
+ ```bash
100
+ # Index all sessions (auto-detects provider)
101
+ memory-vault index
102
+
103
+ # Index with 4 parallel workers (much faster)
104
+ memory-vault index --workers 4
105
+
106
+ # Use Cloudflare Workers AI
107
+ export CLOUDFLARE_ACCOUNT_ID="..."
108
+ export CLOUDFLARE_API_TOKEN="..."
109
+ memory-vault index --force
110
+
111
+ # Use any OpenAI-compatible API
112
+ export OPENAI_BASE_URL="https://api.openai.com/v1"
113
+ export OPENAI_API_KEY="sk-..."
114
+ memory-vault index
115
+
116
+ # Override the model per run
117
+ MEMORY_VAULT_INDEX_MODEL="gpt-4o" memory-vault index
118
+ ```
119
+
120
+ ### 📦 Context Packs
121
+
122
+ Shareable, self-contained archives of any Hermes session.
123
+
124
+ ## Why context packs?
125
+
126
+ AI agent sessions produce **context** — conversations, decisions, files, tool calls — but it's trapped inside the agent's database. Memory Vault extracts it into a structured, portable format that's:
127
+
128
+ - **Shareable** — send a `.hermes-memory` file to a teammate or another agent
129
+ - **Restartable** — the handoff brief tells the receiving agent what was done and how
130
+ - **Auditable** — full transcript + tool traces + artifact copies in one file
131
+ - **Self-contained** — includes everything needed to understand the session
132
+
133
+ ## The format
134
+
135
+ A `.hermes-memory` file is a **tar.gz archive** with a clean layout:
136
+
137
+ ```
138
+ bot.hermes-memory/
139
+ ├── manifest.json # Metadata: title, tags, source session, git commit, tool usage
140
+ ├── narrative.md # Chronological story of the session
141
+ ├── messages.json # Raw session messages (for deep reference)
142
+ ├── decisions.json # Key decisions extracted (AI-generated)
143
+ ├── artifacts/ # Files created or modified during the session
144
+ │ ├── src/bot.py
145
+ │ └── ...
146
+ ├── tool-traces.json # Tool usage summary (calls per tool)
147
+ └── context/
148
+ ├── handoff.md # Brief for the receiving agent
149
+ └── references.md # URLs and resources used in the session
150
+ ```
151
+
152
+ ## Quick start
153
+
154
+ ### 1. Install
155
+
156
+ ```bash
157
+ pip install "memory-vault[tui]" # with TUI
158
+ pip install "memory-vault" # CLI only (lighter)
159
+ ```
160
+
161
+ ### 2. Browse sessions
162
+
163
+ ```bash
164
+ memory-vault browse
165
+ # or just list:
166
+ memory-vault list-sessions
167
+ ```
168
+
169
+ ### 3. Index sessions (optional, for meaningful titles)
170
+
171
+ Requires an LLM provider. By default tries `CLOUDFLARE_ACCOUNT_ID` + `CLOUDFLARE_API_TOKEN` for Cloudflare Workers AI. Falls back gracefully with template titles.
172
+
173
+ ```bash
174
+ # Auto-detect Cloudflare Workers AI
175
+ memory-vault index
176
+
177
+ # Or set any OpenAI-compatible provider
178
+ export OPENAI_BASE_URL="https://api.openai.com/v1"
179
+ export OPENAI_API_KEY="sk-..."
180
+ memory-vault index
181
+
182
+ # Only new sessions (skip already-indexed)
183
+ memory-vault index --new
184
+ ```
185
+
186
+ ### 4. Export a session
187
+
188
+ ```bash
189
+ memory-vault export 20260620_143021_a1b2c3 \
190
+ --title "Hyperliquid Trading Bot" \
191
+ --tags trading,hyperliquid,defi \
192
+ --project-root /path/to/project \
193
+ --author iruzen
194
+ ```
195
+
196
+ ### 5. Share or archive
197
+
198
+ Send the `.hermes-memory` file anywhere. The receiving agent loads it with:
199
+
200
+ ```bash
201
+ memory-vault import-pack bot.hermes-memory
202
+ ```
203
+
204
+ ## Commands
205
+
206
+ | Command | Description |
207
+ |---------|-------------|
208
+ | `browse` | Launch interactive TUI (sessions or packs) |
209
+ | `list-sessions` | Browse available Hermes sessions |
210
+ | `export <id>` | Pack a session into .hermes-memory |
211
+ | `info <pack>` | Inspect a pack (metadata, artifacts, tools) |
212
+ | `import-pack <pack>` | Show handoff brief, artifacts, and tool traces |
213
+ | `list` | List all packs in a directory |
214
+ | `search <pattern>` | Regex search across packs |
215
+ | `render <pack>` | Render pack as Markdown or HTML |
216
+ | `index [--workers N]` | Enrich session titles & summaries via LLM |
217
+ | `providers` | List available LLM providers and their status |
218
+ | `config set/get/list` | Manage persistent configuration |
219
+ | `diff <pack1> <pack2>` | Compare two context packs side-by-side |
220
+
221
+ ## Use cases
222
+
223
+ - **Handoff between agents**: finish a session on desktop, continue on Telegram
224
+ - **Project snapshots**: capture the full context of building a feature
225
+ - **Debugging archives**: save the session that led to a bug
226
+ - **Knowledge base**: build a library of past agent actions
227
+ - **Onboarding**: share how a complex task was done
228
+
229
+ ## How it works
230
+
231
+ Memory Vault reads directly from the Hermes sessions database (`state.db`). It:
232
+
233
+ 1. Queries the session metadata (title, model, platform, duration)
234
+ 2. Reads all messages (user prompts, assistant responses, tool calls)
235
+ 3. Builds a chronological narrative from the conversation
236
+ 4. Detects artifacts by scanning `write_file` and `patch` tool calls
237
+ 5. Counts tool usage for the summary
238
+ 6. Generates a handoff brief with the original goal and key results
239
+ 7. Packages everything into a compressed `.hermes-memory` archive
240
+
241
+ ## Project structure
242
+
243
+ ```
244
+ src/memory_vault/
245
+ ├── __init__.py # Version + public exports
246
+ ├── __main__.py # CLI entry point
247
+ ├── cli/
248
+ │ └── main.py # Typer commands (export, info, import, list, search, render, index, browse)
249
+ ├── core/
250
+ │ ├── __init__.py
251
+ │ ├── llm.py # LLMProvider ABC + CloudflareAI + OpenAICompatibleProvider
252
+ │ ├── config.py # JSON config persistence (llm.provider, etc.)
253
+ │ ├── manifest.py # Manifest dataclass + serialization
254
+ │ ├── pack.py # ContextPack — in-memory representation + tar.gz I/O
255
+ │ ├── builder.py # ContextBuilder — reads Hermes sessions, builds packs
256
+ │ ├── narrator.py # SessionNarrator — compresses conversations via LLM
257
+ │ ├── renderer.py # Export packs as Markdown or HTML
258
+ │ ├── session_index.py # SessionIndex — SQLite cache for LLM-enriched titles
259
+ │ └── tui.py # MemoryVaultTUI — Textual-based interactive browser
260
+ ```
261
+
262
+ ## License
263
+
264
+ MIT
@@ -0,0 +1,73 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [tool.setuptools.packages.find]
6
+ where = ["src"]
7
+
8
+ [project]
9
+ name = "hermes-memory-vault"
10
+ version = "0.2.0"
11
+ description = "Portable Context Protocol — package AI agent sessions into portable .hermes-memory packs"
12
+ readme = "README.md"
13
+ authors = [
14
+ { name = "Jules Zhou", email = "juleszhou01@gmail.com" },
15
+ ]
16
+ license = "MIT"
17
+ license-files = ["LICENSE"]
18
+ requires-python = ">=3.11"
19
+ keywords = ["hermes", "ai-agent", "memory", "portable", "open-source"]
20
+ classifiers = [
21
+ "Development Status :: 3 - Alpha",
22
+ "Intended Audience :: Developers",
23
+ "Programming Language :: Python :: 3",
24
+ "Programming Language :: Python :: 3.11",
25
+ "Programming Language :: Python :: 3.12",
26
+ "Programming Language :: Python :: 3.13",
27
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
28
+ ]
29
+
30
+ dependencies = [
31
+ "typer>=0.12,<1.0",
32
+ "pydantic>=2.0,<3.0",
33
+ ]
34
+
35
+ [project.optional-dependencies]
36
+ dev = [
37
+ "pytest>=7.0,<9.0",
38
+ "mypy>=1.0,<2.0",
39
+ "ruff>=0.1,<1.0",
40
+ ]
41
+ vault = [
42
+ "markdown>=3.5,<4.0",
43
+ ]
44
+ tui = [
45
+ "textual>=2.0,<3.0",
46
+ ]
47
+ all = ["memory-vault[vault,tui]"]
48
+
49
+ [project.urls]
50
+ Homepage = "https://github.com/iruzen-dono/memory-vault"
51
+ Repository = "https://github.com/iruzen-dono/memory-vault"
52
+ Issues = "https://github.com/iruzen-dono/memory-vault/issues"
53
+ Documentation = "https://github.com/iruzen-dono/memory-vault/blob/master/docs/ARCHITECTURE.md"
54
+ Changelog = "https://github.com/iruzen-dono/memory-vault/blob/master/CHANGELOG.md"
55
+
56
+ [project.scripts]
57
+ memory-vault = "memory_vault.cli.main:app"
58
+ memory-vault-webhook = "memory_vault.webhook:serve"
59
+
60
+ [tool.ruff]
61
+ line-length = 250
62
+ target-version = "py311"
63
+
64
+ [tool.ruff.lint]
65
+ select = ["E", "F", "I", "W"]
66
+
67
+ [tool.mypy]
68
+ python_version = "3.11"
69
+ strict = false
70
+ ignore_missing_imports = true
71
+
72
+ [tool.pytest.ini_options]
73
+ testpaths = ["tests"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+