hyperspace-memory (Python) 🚀
Drop-in replacement for Mem0, Zep, and MemGPT powered by the HyperspaceDB native memory engine with 1-bit ADC quantization, MRL in-RAM cascades, and Lorentz hyperbolic spaces.
⚡ Key Advantages over Mem0 & Zep
- 100x Lower Search Latency: Sub-millisecond (< 0.5 ms) retrieval via MRL in-RAM cascade indexing.
- 98% RAM & Storage Reduction: Native
extreme1-bit ADC andturbo4-bit Lloyd-Max quantization (compressed down to ~100B per vector). - Zero Extra LLM Calls: Direct vector and graph traversal memory operations without forcing expensive LLM parsing for every insert.
- 100% Mem0 API Compatibility: Replace
from mem0 import Memorywithfrom hyperspace_memory import Memorywithout altering your application code.
📦 Installation
pip install hyperspace-memory
🛠 Quick Start (Mem0 Drop-In Migration)
from hyperspace_memory import Memory
# 1. Initialize Memory (connects to HyperspaceDB)
memory = Memory(config={
"host": "the.yar.ink",
"api_key": "YOUR_YARINK_API_KEY",
"quantization": "medium_plus" # "none" | "medium_plus" | "turbo" | "extreme"
})
# 2. Add Memory
res = memory.add(
"User prefers Rust and dark mode UI over Python and light mode.",
user_id="user_123",
metadata={"category": "preferences"}
)
print("Added Memory:", res)
# 3. Search Memory
results = memory.search("What programming language does the user prefer?", user_id="user_123", limit=3)
for item in results:
print(f"Memory: {item['memory']} (Score: {item['score']})")
# 4. Get All Memories for User
all_memories = memory.get_all(user_id="user_123")
# 5. Cognitive Consolidation (Fréchet Mean on Hyperboloid)
consolidation = memory.consolidate(
"programming languages",
summary_text="User strongly favors Rust and systems programming."
)
print("Consolidated concept:", consolidation["summary"])
# 6. Anti-Hallucination Claim Verification (Lorentz Geodesic Trust)
verification = memory.verify_claim(
"User prefers Rust and dark mode UI over Python and light mode.",
"User always requests Python notebooks with light themes."
)
print("Trust status:", verification["status"], "Score:", verification["trust_score"])
# 7. Delete & Reset
memory.delete(results[0]["id"])
🧠 Cognitive Operations
memory.consolidate(topic_query, ...): Synthesizes a cluster of related episodic memories into a single abstract semantic concept using the Fréchet Mean on the hyperboloid.memory.verify_claim(premise, conclusion, threshold=0.30): Computes Geodesic Trust Score (Lorentz $\mathbb{H}^{32}$ + Cosine 96D) to verify that an LLM conclusion does not hallucinate.memory.list_sessions(limit=100): Discovers and enumerates active conversational sessions.memory.explore_hierarchy(concept_id, direction="down"): Navigates conceptual taxonomy trees in Lorentz space.memory.stats(): Returns vector counts, cascade configuration, and collection status.
📄 License
MIT © YARlabs.
Metadata
Release files for hyperspace-memory 4.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hyperspace_memory-4.0.0.tar.gz | 10.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hyperspace_memory-4.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.1 kB
Release files / hyperspace_memory-4.0.0.tar.gz
| Download URL | hyperspace_memory-4.0.0.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e372ca4994f81309d983418d77ea4a921c44eba0e6778ebeda59b91121b7a3ab
|
|
BLAKE2b-256 checksum How to use checksums |
5551cf4a086412a337219452900bd44440e33f9abd6e8336de10d33853b16abd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / hyperspace_memory-4.0.0-py3-none-any.whl
| Download URL | hyperspace_memory-4.0.0-py3-none-any.whl |
|---|---|
| Size | 11.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1de45c433ce865bf37c05c0c52722034d4e3f3491d981d5abc0f45fbc0499860
|
|
BLAKE2b-256 checksum How to use checksums |
3edf271e0e5c648f824e5ab4b9c897eba01de0c6bc9adfa7b5c8817454e4484c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|