Skip to content

Commit 3505f15

Browse files
authored
feat: add cozodb (#77)
1 parent 9a6bc99 commit 3505f15

File tree

25 files changed

+1619
-1195
lines changed

25 files changed

+1619
-1195
lines changed

hoddor/Cargo.toml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,9 @@ crate-type = ["cdylib", "rlib"]
1010

1111
[features]
1212
default = ["vault", "graph"]
13-
14-
# Vault: Core functionality - encrypted vaults with namespaces, WebAuthn, etc.
15-
# This is the base feature of Hoddor
1613
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"]
14+
# Graph database with CozoDB (Datalog queries + HNSW vector index for RAG)
15+
graph = ["vault", "uuid", "cozo", "ndarray"]
2116

2217
[dependencies]
2318
once_cell = "1.20.2"
@@ -61,6 +56,8 @@ x25519-dalek = { version = "2.0.1", features = ["static_secrets"] }
6156
async-trait = "0.1.89"
6257

6358
uuid = { version = "1.11", features = ["v4", "serde", "js"], optional = true }
59+
cozo = { version = "0.7", default-features = false, features = ["wasm"], optional = true }
60+
ndarray = { version = "0.15", optional = true }
6461

6562
[dependencies.web-sys]
6663
version = "0.3.77"

hoddor/src/adapters/mod.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,5 @@ pub use native::{
1515
pub mod shared;
1616
pub use shared::{AgeEncryption, AgeIdentity, Argon2Kdf};
1717

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;
18+
#[cfg(all(feature = "graph", target_arch = "wasm32"))]
19+
pub use wasm::CozoGraphAdapter as Graph;

0 commit comments

Comments
 (0)