Skip to content

Commit 3624475

Browse files
committed
Fix demo worldIDA crash, add CI demo smoke test, relocate assets
- demo.py: fix two runtime crashes — Scene has no 'description' field (use ongoing_action) and to_dict() returns a dict (JSON-encode it); force UTF-8 output so ✓/✗ render on Windows cp1252 consoles - tests/test_demo_smoke.py: hermetic CI replay of the demo story (plant facts, flood filler, recall each, supersede a changed fact) - README: shorten REST + config sections, fill benchmark table with honest qwen/gemma numbers from the clean re-run - move visual assets from docs/ to root assets/ - migrate Berlin to Vienna across README, assets, and tests
1 parent 163e8b3 commit 3624475

18 files changed

Lines changed: 208 additions & 73 deletions

README.md

Lines changed: 24 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![PyPI](https://img.shields.io/badge/pypi-1.0.0-blue)](https://pypi.org/project/hypermem/)
55

66
<p align="center">
7-
<img src="docs/assets/banner.png" alt="HyperMEM — AI memory that never forgets" width="100%">
7+
<img src="assets/banner.png" alt="HyperMEM — AI memory that never forgets" width="100%">
88
</p>
99

1010
HyperMEM is a **memory layer** for AI applications — the missing piece
@@ -65,7 +65,7 @@ hm = HyperMEM() # defaults: Ollama, qwen2.5:7b on localhost:11434
6565

6666
async def main():
6767
# HyperMEM auto-tags important details as they arrive, stored verbatim
68-
await hm.add_message("user", "My name is Emanuel, I live in Berlin")
68+
await hm.add_message("user", "My name is Emanuel, I live in Vienna")
6969
await hm.add_message("user", "I'm planning a hike in the Alps next week")
7070

7171
# Later, the relevant memories come back — even with different wording
@@ -82,7 +82,7 @@ Output:
8282

8383
```
8484
[RELEVANT MEMORIES]
85-
- My name is Emanuel, I live in Berlin (importance: 100%)
85+
- My name is Emanuel, I live in Vienna (importance: 100%)
8686
[/RELEVANT MEMORIES]
8787
```
8888

@@ -109,25 +109,11 @@ hypermem-server --port 8080 --llm-model qwen2.5:7b --llm-endpoint http://localho
109109
```
110110

111111
```bash
112-
# Create a session
113112
curl -X POST localhost:8080/sessions -d '{"session_id": "rp1"}'
114-
115-
# Feed it messages (returns anything newly tagged/recalled)
116113
curl -X POST localhost:8080/sessions/rp1/messages \
117-
-d '{"role": "user", "content": "My name is Emanuel"}' \
118-
-H "Content-Type: application/json"
119-
120-
# Ask for context — memories + recent chat + world state
121-
curl "localhost:8080/sessions/rp1/context?message=What+is+my+name?"
122-
123-
# Provenance: why does a memory exist, and why would it surface?
124-
curl "localhost:8080/sessions/rp1/memories/<memory_id>?query=What+is+my+name?"
125-
126-
# Inspect everything it remembers
127-
curl localhost:8080/sessions/rp1/memories
128-
129-
# Export the full session state
130-
curl localhost:8080/sessions/rp1/state
114+
-d '{"role": "user", "content": "My name is Emanuel"}' -H "Content-Type: application/json"
115+
curl "localhost:8080/sessions/rp1/context?message=What+is+my+name?" # memories + chat + world state
116+
curl "localhost:8080/sessions/rp1/memories/<id>?query=What+is+my+name?" # provenance
131117
```
132118

133119
Endpoints: `GET /health`, `POST/GET/DELETE /sessions` (and `/sessions/{id}`),
@@ -138,9 +124,8 @@ Endpoints: `GET /health`, `POST/GET/DELETE /sessions` (and `/sessions/{id}`),
138124
`POST /sessions/{id}/world-ida/update`, `GET /sessions/{id}/state`.
139125

140126
Sessions are auto-persisted to `--data-dir` (default `.hypermem_data/`) after
141-
every change — even auto-generated sessions persist from creation — and
142-
survive restarts. Concurrent writes are serialized per-session (no lost
143-
updates). API responses never leak raw embedding vectors.
127+
every change and survive restarts. Concurrent writes are serialized per-session
128+
(no lost updates). API responses never leak raw embedding vectors.
144129

145130
## worldIDA — live world state
146131

@@ -224,18 +209,13 @@ config = HyperMemConfig(
224209
llm_model="qwen2.5:7b",
225210
llm_endpoint="http://localhost:11434",
226211
llm_api_key=None, # required for openai/anthropic
227-
# ---- recall ----
228212
embedding_provider="auto", # "auto" | "ollama" | "openai" | "none"
229213
recall_use_llm=False, # also run the LLM rank on top of embeddings
230214
max_recall_tokens=300, # context-window budget for recalled memories
231-
search_archive=False, # include decay-archived memories in recall
232-
# ---- ingestion / lifecycle ----
233215
auto_tag_threshold=0.4, # minimum importance to store a fact
234216
max_active_memories=100, # active mems before decay-archiving
235-
max_memory_chars=1000, # verbatim content cap
236217
consolidation_threshold=6, # episodic mems per subject before consolidation (0=off)
237218
consolidation_interval=20, # min messages between consolidation runs
238-
max_context_messages=20, # recent chat lines kept for context
239219
auto_tagging=True, # set False to only store explicit remembers
240220
)
241221
hm = HyperMEM(config)
@@ -288,17 +268,20 @@ python benchmarks/diag_recall.py
288268

289269
### Results — v1.0.0, real Ollama, scales [100, 1000]
290270

291-
> Latest run: `qwen2.5:7b` + `gemma3:12b` · see `benchmarks/benchmark_report_phase5.md`
271+
> Latest run: `qwen2.5:7b` + `gemma3:12b` · see `benchmarks/benchmark_report_full.md`
292272
293273
| suite · metric | qwen2.5:7b | gemma3:12b |
294274
|---|---|---|
295-
| contradiction · new fact wins @100 | **1.0** ||
296-
| contradiction · stale leak @100 | **0.0** ||
297-
| paraphrase · recall @100 | **1.0** ||
298-
| recall · pass@1 @100 |||
299-
| distractor · accuracy @100 |||
300-
| answer · hypermem @100 |||
301-
| answer · hypermem+worldIDA @100 |||
275+
| recall · pass@1 @100 | **1.0** | **1.0** |
276+
| recall · pass@1 @1000 | **1.0** | **1.0** |
277+
| distractor · accuracy @100 | **1.0** | **1.0** |
278+
| distractor · leaks @100 | **0.0** | **0.0** |
279+
| contradiction · new fact wins @100 | **1.0** | **1.0** |
280+
| contradiction · stale leak @100 | **0.0** | **0.0** |
281+
| paraphrase · recall @100 | **0.917** | **0.958** |
282+
| answer · hypermem @100 | **0.917** | **0.75** |
283+
| answer · hypermem+worldIDA @100 | **0.917** | **0.75** |
284+
| recall · latency @100 | **~137 ms** | ~833 ms |
302285

303286
For the 0.1.0 baseline this was: gemma **0.0 everywhere** (judge JSON never
304287
parsed), qwen contradiction leak **1.0**, recall ≈ **0.57**, paraphrase ≈
@@ -321,8 +304,11 @@ examples/demo.py self-contained end-to-end demo (public API only)
321304

322305
## License
323306

324-
MIT — see [LICENSE](LICENSE).
307+
Source-available — free for personal use and commercial projects under
308+
10K ARR / 1K MAU; commercial license required above that. Attribution
309+
required when you use it. See [LICENSE](LICENSE) and contact
310+
hypermem@x5i.ch.
325311

326312
<p align="center">
327-
<img src="docs/assets/footer.png" alt="HyperMEM — LLM-agnostic memory layer" width="100%">
313+
<img src="assets/footer.png" alt="HyperMEM — LLM-agnostic memory layer" width="100%">
328314
</p>

assets/banner.png

215 KB
Loading
Lines changed: 2 additions & 2 deletions
Loading

assets/footer.png

56.1 KB
Loading
Lines changed: 1 addition & 1 deletion
Loading

assets/og-image-1280.png

86.6 KB
Loading

assets/og-image.png

225 KB
Loading
Lines changed: 1 addition & 1 deletion
Loading

docs/assets/README.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

docs/assets/banner.png

-217 KB
Binary file not shown.

0 commit comments

Comments
 (0)