Skip to content

Commit 9a6bc99

Browse files
authored
74 add embedded graph database (#75)
- feat: refacto graph_persistance - Created GraphPersistenceService with hexagonal architecture, removed HMAC layer - feat: refacto platform graph - Integrated Graph adapter into Platform as a proper dependency - feat: refacto platform - Enhanced Platform with additional adapter accessors for better dependency injection - fix: load data - Fixed graph persistence issue by using static Lazy globals (NODES and EDGES) to share state across all Platform instances - feat: change extension name - Migrated file extensions from .ns/.json/.age to .hoddor with backward compatibility - feat: remove without encryption - Made encryption mandatory everywhere - feat: fmt - Fixed WASM compilation issues
1 parent affb5b4 commit 9a6bc99

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+5266
-147
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ This solution provides encrypted storage capabilities with robust support for mu
4949
### Built for Privacy-First Applications
5050
This solution is ideal for building **zero-knowledge systems** where user privacy is paramount. The backend serves solely as a storage and synchronization medium, with all sensitive encryption and decryption logic confined to the client side. This ensures that sensitive information never leaves the user's control, empowering developers to build **compliant, privacy-focused, and performant web applications.**
5151

52+
## ⚠️ Experimental Features
53+
54+
> **Warning**: The following features are currently under active development and should **NOT** be used in production environments.
55+
56+
- 🔬 **Graph Database Integration**: Embedded CozoDB graph database with encrypted persistence for knowledge graph and RAG (Retrieval-Augmented Generation) applications.
57+
- **Status**: Work in Progress (WIP)
58+
- **Known Limitations**: API may change, potential data migration issues between versions
59+
- **Use Case**: Experimental RAG workspaces and memory management features
60+
61+
These experimental features are being developed to explore advanced use cases. They are subject to breaking changes and may not provide the same stability guarantees as the core vault functionality. Use at your own risk and avoid storing critical data.
5262

5363
## Prerequisites
5464

hoddor/Cargo.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ edition = "2021"
99
crate-type = ["cdylib", "rlib"]
1010

1111
[features]
12-
default = ["console_error_panic_hook"]
12+
default = ["vault", "graph"]
13+
14+
# Vault: Core functionality - encrypted vaults with namespaces, WebAuthn, etc.
15+
# This is the base feature of Hoddor
16+
vault = ["console_error_panic_hook"]
17+
18+
# Graph: Adds graph database with vector search
19+
# Requires vault for persistence and encryption
20+
graph = ["vault", "uuid"]
1321

1422
[dependencies]
1523
once_cell = "1.20.2"
@@ -52,6 +60,8 @@ hkdf = "0.12.4"
5260
x25519-dalek = { version = "2.0.1", features = ["static_secrets"] }
5361
async-trait = "0.1.89"
5462

63+
uuid = { version = "1.11", features = ["v4", "serde", "js"], optional = true }
64+
5565
[dependencies.web-sys]
5666
version = "0.3.77"
5767
features = [

hoddor/src/adapters/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,10 @@ pub use native::{
1414

1515
pub mod shared;
1616
pub use shared::{AgeEncryption, AgeIdentity, Argon2Kdf};
17+
18+
#[cfg(feature = "graph")]
19+
#[path = "wasm/simple_graph.rs"]
20+
mod simple_graph;
21+
22+
#[cfg(feature = "graph")]
23+
pub use simple_graph::SimpleGraphAdapter as Graph;

hoddor/src/adapters/wasm/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@ pub mod opfs_storage;
88
pub mod persistence;
99
pub mod webauthn_prf;
1010

11+
#[cfg(feature = "graph")]
12+
pub mod simple_graph;
13+
1114
pub use clock::Clock;
1215
pub use console_logger::ConsoleLogger;
1316
pub use locks::Locks;
1417
pub use notifier::Notifier;
1518
pub use opfs_storage::OpfsStorage;
1619
pub use persistence::Persistence;
1720
pub use webauthn_prf::WebAuthnPrf;
21+
22+
#[cfg(feature = "graph")]
23+
pub use simple_graph::SimpleGraphAdapter;

0 commit comments

Comments
 (0)