An open-source memory layer for humans. Cryptographically verified, encrypted, permanent memory records.
Project description
๐ง DiaryVault Memory Layer
Give agents context without giving up your data.
An open-source, cryptographically verified memory layer that lets AI agents access user context โ with selective sharing, hash verification, and full user control.
The Problem
AI agents are everywhere. They schedule your meetings, manage your tasks, and make decisions on your behalf. But they all face the same problem: they don't know anything about you.
Right now:
- Agents own execution and behavior
- Platforms own memory (logs, embeddings, context)
- Users own nothing durable or portable
Every platform stores its own version of "you" โ and you can't verify it, control it, move it, or prove it hasn't been tampered with.
There is no canonical user-owned memory layer. Until now.
Quick Start
pip install diaryvault-memory
Create your vault
from diaryvault_memory import MemoryVault
vault = MemoryVault(encryption_key="your-secret-key")
vault.create(content="I'm allergic to shellfish", tags=["health"])
vault.create(content="I work at a fintech startup in Seoul", tags=["work"])
vault.create(content="I prefer morning meetings before 10am", tags=["preference"])
vault.create(content="My salary is 150k", tags=["financial", "private"])
Every memory is SHA-256 hashed, AES-256 encrypted, HMAC signed, and timestamped.
Share context with an agent โ selectively
from diaryvault_memory import ContextRequest
# Agent requests context
request = ContextRequest(
agent_id="scheduling-agent-001",
scope=["preference", "work"],
purpose="Personalize meeting scheduling",
)
# User controls what gets shared (health and financial data blocked)
response = vault.share(request, denied_tags=["health", "financial", "private"])
print(response.memory_count) # 2 (only preference + work)
print(response.scope_granted) # ['preference', 'work']
print(response.scope_denied) # []
print(response.verify_all()) # True โ every memory is hash-verified
# Agent gets verified context:
for mem in response.shared_memories:
print(f" [{', '.join(mem.tags)}] {mem.content} (verified={mem.verified})")
# [preference] I prefer morning meetings before 10am (verified=True)
# [work] I work at a fintech startup in Seoul (verified=True)
# Agent CANNOT see: health data, salary, anything you didn't approve
The agent gets cryptographic proof that the context is authentic and unmodified. The user keeps full control of what gets shared.
Why This Matters
| Today | With DiaryVault Memory Layer |
|---|---|
| Each platform stores its own version of you | You own one canonical memory vault |
| You can't verify what agents "remember" about you | Every memory is SHA-256 hashed and verifiable |
| Context is siloed and non-portable | Open .dvmem format โ export and move freely |
| Platforms can modify your data without your knowledge | HMAC signatures detect any tampering |
| Agents get everything or nothing | Selective sharing by tags โ you choose what to share |
| No proof of when data was created | RFC 3339 timestamps with optional blockchain anchoring |
How It Works
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ USER'S VAULT โ
โ preferences ยท health ยท work ยท financial ยท personal โ
โ All encrypted. All hashed. All signed. โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
Agent requests context
(scope + purpose)
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SELECTIVE SHARING โ
โ User (or policy) decides what tags to share โ
โ Denied tags are never exposed โ
โ Each shared memory includes hash + signature โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ VERIFIED CONTEXT โ
โ Agent receives: content + hash + signature โ
โ Agent can verify: integrity, authenticity โ
โ Agent cannot: access other memories, forge proofs โ
โ Vault merkle root included for full integrity check โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Core Features
๐ AES-256-GCM Encryption โ Every memory encrypted client-side. Your key never leaves your device.
๐ SHA-256 + HMAC Verification โ Content hashing and signing. Tamper with one byte and verification fails.
๐ค Agent Context Layer โ ContextRequest / ContextResponse protocol for agents to request and receive verified user context.
๐ท๏ธ Selective Sharing โ Share by tags. Block by tags. Users decide what agents can see, per request.
๐ณ Merkle Tree Integrity โ Compute a single hash for your entire vault. Prove nothing has been added, removed, or modified.
๐ฆ Open .dvmem Format โ Documented JSON format. No vendor lock-in. Export and import freely.
๐ Blockchain Anchoring โ Optionally anchor hashes to Arweave or Ethereum L2 for permanent, third-party-verifiable proof.
๐ Self-Hostable โ Runs entirely on your hardware. No cloud. No accounts. No trust required.
Use Cases
| Use Case | Description |
|---|---|
| Agent Personalization | Give agents verified context without giving up your data |
| Portable Identity | One vault, many agents โ your context moves with you |
| Data Sovereignty | Prove what you shared, when, and with whom |
| AI Twin Training | Structured, verified life data for training your personal AI |
| Digital Legacy | Preserve your life story with cryptographic permanence |
| Legal Evidence | Timestamped, tamper-proof personal records |
| Health Timeline | Verifiable medical history and symptom tracking |
Architecture
Built on four principles:
- Privacy First โ Encryption happens client-side before anything leaves your device
- Verify Everything โ Every operation produces a cryptographic proof
- Own Your Data โ Open formats, open code, export anytime
- Permanence Optional โ Choose your storage backend: local, cloud, or blockchain
See ARCHITECTURE.md for the full technical deep dive, threat model, and .dvmem format specification.
The Bigger Picture
DiaryVault Memory Layer is one half of a trust equation for the agent era:
- Agent trust โ Can I trust what this agent did? โ authe.me
- Data trust โ Can I trust the data the agent is using about me? โ DiaryVault Memory Layer
Trust = Agent behavior + Data integrity.
Roadmap
- v0.1 โ Core SDK: hash, encrypt, verify, store,
.dvmemformat - v0.2 โ Agent Context Layer: selective, verified sharing
- v0.3 โ Personal AI Export: fine-tuning datasets, RAG embeddings, knowledge graphs
- v0.4 โ Blockchain Anchoring: Arweave + Ethereum L2 (Base)
- v0.5 โ AI Synthesis Agents: calendar capture, daily summary, photo description
- v0.6 โ Rich Capture: photo, voice, health data agents
- v0.7 โ Dead Man's Switch: inactivity threshold, beneficiary access
- v0.8 โ Mobile SDK (iOS/Android)
- v1.0 โ DiaryVault app integration
Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
Priority areas:
- Agent framework integrations (OpenClaw, LangChain, CrewAI)
- Storage backend adapters (IPFS, Filecoin, Ceramic)
- Language SDKs (TypeScript, Rust, Go)
- Documentation and tutorials
Philosophy
"The palest ink is better than the best memory." โ Chinese Proverb
Your memories belong to you. Not to a platform. Not to a corporation. Not to an algorithm.
The Memory Layer is infrastructure for a future where every human has a verified, portable, private record of their existence โ and every agent they interact with can be given exactly the context they need, nothing more.
This is not a product. It's a protocol. Build on it.
License
MIT โ Use it. Fork it. Build on it.
Own your data. Share it on your terms.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file diaryvault_memory-0.3.0.tar.gz.
File metadata
- Download URL: diaryvault_memory-0.3.0.tar.gz
- Upload date:
- Size: 29.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64b7ceace55ec53bb33d982aab3a2ebfdb6dc4274a21542e0dff8ce6b4a7aec7
|
|
| MD5 |
909c79a290f9ff8d5300f4a9ea031e1c
|
|
| BLAKE2b-256 |
7d525a88dfca58efbb96fe7cae5c2fb0ed044897ec500f3a70961f71ec404090
|
File details
Details for the file diaryvault_memory-0.3.0-py3-none-any.whl.
File metadata
- Download URL: diaryvault_memory-0.3.0-py3-none-any.whl
- Upload date:
- Size: 23.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
683b221b447eb175cf17c9ad9cdd7a6d1aeaea0c416ec8d715935c611552a38a
|
|
| MD5 |
fff4dadf6aaaeb740a627ed5a7157cb0
|
|
| BLAKE2b-256 |
9a6c67b5ab7263de0772fc358ca13cc92fef18a4e0d580c6dbab4879bbed3830
|