Skip to main content

sphereql_embed/
lib.rs

1//! Vector embedding projection engine.
2//!
3//! Projects high-dimensional embeddings onto S² via one of several
4//! projection families (PCA, kernel PCA, Laplacian eigenmap, random)
5//! and offers a query pipeline for k-NN search, similarity thresholds,
6//! concept paths, glob detection, local manifold fitting, and a
7//! category-level enrichment layer (inter-category graph, bridge
8//! detection with `Genuine`/`OverlapArtifact`/`Weak` classification,
9//! inner spheres, hierarchical concept paths, domain-group routing
10//! for low-EVR regimes).
11//!
12//! On top of that, the crate ships a **metalearning framework**:
13//!
14//! - [`config`] — a single [`PipelineConfig`] hierarchy for every
15//!   tunable constant.
16//! - [`quality_metric`] — a [`QualityMetric`] trait plus four concrete
17//!   metrics (territorial health, bridge coherence, cluster silhouette,
18//!   graph modularity) and composite presets.
19//! - [`tuner`] — [`auto_tune`] over a discrete [`SearchSpace`] with
20//!   Grid / Random / Bayesian (TPE-lite) strategies. Projection kind
21//!   is a first-class tuner axis.
22//! - [`corpus_features`] — a 10-feature corpus profile suitable as
23//!   input to a meta-model.
24//! - [`meta_model`] — [`MetaTrainingRecord`] with an on-disk store
25//!   under `~/.sphereql/meta_records.json`, the [`MetaModel`] trait,
26//!   and two concrete implementations ([`NearestNeighborMetaModel`],
27//!   [`DistanceWeightedMetaModel`]).
28//! - [`feedback`] — per-query user-satisfaction primitives
29//!   ([`FeedbackEvent`] + [`FeedbackAggregator`]) for L3 online
30//!   refinement of stored records.
31//!
32//! See [`SphereQLPipeline::new_with_config`],
33//! [`SphereQLPipeline::new_from_metamodel`], and
34//! [`SphereQLPipeline::new_from_metamodel_tuned`] for the
35//! tune-or-recall entry points.
36
37pub mod category;
38pub mod confidence;
39pub mod config;
40pub mod configured_projection;
41pub mod corpus_features;
42pub mod domain_groups;
43pub mod feedback;
44pub mod kernel_pca;
45pub mod laplacian;
46pub mod mapper;
47pub mod meta_model;
48pub mod navigator;
49pub mod pipeline;
50pub mod projection;
51pub mod quality_metric;
52pub mod query;
53pub mod spatial_quality;
54pub mod text_embedder;
55pub mod tuner;
56pub mod types;
57pub mod util;
58
59pub use category::*;
60pub use confidence::*;
61pub use config::*;
62pub use configured_projection::*;
63pub use corpus_features::*;
64pub use domain_groups::*;
65pub use feedback::*;
66pub use kernel_pca::*;
67pub use laplacian::*;
68pub use mapper::*;
69pub use meta_model::*;
70pub use navigator::*;
71pub use pipeline::*;
72pub use projection::*;
73pub use quality_metric::*;
74pub use query::*;
75pub use spatial_quality::*;
76pub use text_embedder::*;
77pub use tuner::*;
78pub use types::*;
79pub use util::*;