Skip to main content

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.

License: MIT CI Python 3.10+ PyPI PRs Welcome


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:

  1. Privacy First โ€” Encryption happens client-side before anything leaves your device
  2. Verify Everything โ€” Every operation produces a cryptographic proof
  3. Own Your Data โ€” Open formats, open code, export anytime
  4. 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

  • Core SDK โ€” hash, encrypt, verify, store
  • Memory format spec (.dvmem)
  • Agent context layer โ€” selective, verified sharing (v0.2)
  • Arweave anchoring (v0.3)
  • Ethereum L2 anchoring (v0.3)
  • AI synthesis agents (v0.4)
  • Photo/voice capture agents (v0.5)
  • Dead man's switch (v0.6)
  • Personal AI training export (v0.7)
  • Mobile SDK (v0.8)
  • DiaryVault app integration (v1.0)

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.

diaryvault.com ยท @diaryvault

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diaryvault_memory-0.2.0.tar.gz (24.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diaryvault_memory-0.2.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file diaryvault_memory-0.2.0.tar.gz.

File metadata

  • Download URL: diaryvault_memory-0.2.0.tar.gz
  • Upload date:
  • Size: 24.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.16

File hashes

Hashes for diaryvault_memory-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2a35f8466036cb69fb2cccea2950f3681d44f2d3108c6b2cbd7235b0f1c1b5e7
MD5 29d65e6179e9ceade6cb5c64830a4e00
BLAKE2b-256 2a02aeb3700296c72a067099d7c828b076387d8801def833ed99fe54aa0dbd18

See more details on using hashes here.

File details

Details for the file diaryvault_memory-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for diaryvault_memory-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10938039c74fbe51b8074b8555fed1fa9dfcebabc5dda2511ff97af6523ba968
MD5 c4a8b4019f9325362303bf876f22c15e
BLAKE2b-256 d11a304ee65ebbbba3e0e713b14ffab58eee57523ee00cacf662b40f8a416611

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page