1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! # nusy-graph-query
//!
//! Graph-native semantic search for Arrow RecordBatches — embeddings,
//! traversal, hybrid ranking, and caching.
//!
//! This crate provides the building blocks for combining structural graph
//! queries with semantic similarity search over Apache Arrow data.
//!
//! ## Quick Example
//!
//! ```rust
//! use nusy_graph_query::{HashEmbeddingProvider, EmbeddingProvider, cosine_similarity};
//!
//! let provider = HashEmbeddingProvider::new(384);
//! let vecs = provider.embed_batch(&[
//! "Alice knows Bob".to_string(),
//! "Cat is an animal".to_string(),
//! ]).unwrap();
//!
//! let sim = cosine_similarity(&vecs[0], &vecs[1]);
//! assert!(sim >= -1.0 && sim <= 1.0);
//! ```
//!
//! ## Modules
//!
//! - [`embedding`] — `EmbeddingProvider` trait, hash provider, cosine similarity
//! - [`traversal`] — Generic BFS/DFS over Arrow edge RecordBatches
//! - [`hybrid_rank`] — Combine structural + semantic scores
//! - [`cache`] — Content-hash embedding cache with Parquet persistence
//! - [`subprocess`] — Python sentence-transformers provider (feature: `subprocess`)
//! - [`fastembed_provider`] — Local ONNX embedding provider (feature: `fastembed`)
//!
//! ## Feature Flags
//!
//! | Flag | Description |
//! |------|-------------|
//! | `subprocess` | Enable Python sentence-transformers provider |
//! | `fastembed` | Enable local ONNX embedding via fastembed-rs (~2ms/chunk) |
// Re-export key types at crate root for convenience.
pub use EmbeddingCache;
pub use ;
pub use FastembedProvider;
pub use ;
pub use SubprocessEmbeddingProvider;
pub use ;