//! AI Backend Module
//!
//! Provides embeddings, vector search, full-text indexing, and RAG capabilities
//! for semantic and keyword-based document retrieval.
//!
//! # Features
//!
//! - **Embeddings**: Convert text to dense vectors using fastembed
//! - **Vector Store**: HNSW-based approximate nearest neighbor search with instant-distance
//! - **Full-Text Indexing**: BM25-like scoring with tantivy integration
//! - **RAG System**: Hybrid retrieval combining semantic and keyword search
//!
//! # Example
//!
//! ```ignore
//! use typedialog_core::ai::{RagSystem, RagConfig};
//!
//! #[tokio::main]
//! async fn main() -> Result<()> {
//!     let config = RagConfig::default();
//!     let mut rag = RagSystem::new(config).await?;
//!
//!     rag.add_document("doc1".to_string(), "Hello world".to_string()).await?;
//!     let results = rag.retrieve("hello").await?;
//!     Ok(())
//! }
//! ```

#[cfg(feature = "ai_backend")]
pub mod embeddings;
#[cfg(feature = "ai_backend")]
pub mod indexer;
#[cfg(feature = "ai_backend")]
pub mod kg;
#[cfg(feature = "ai_backend")]
pub mod persistence;
#[cfg(feature = "ai_backend")]
pub mod rag;
#[cfg(feature = "ai_backend")]
pub mod vector_store;

// Public exports when ai_backend feature is enabled
#[cfg(feature = "ai_backend")]
pub use embeddings::{EmbeddingModel, EmbeddingsService};
#[cfg(feature = "ai_backend")]
pub use indexer::{Document, FullTextIndexer};
#[cfg(feature = "ai_backend")]
pub use kg::{
    Entity, EntityType, GraphTraversal, KnowledgeGraph, RagKgIntegration, RelationType,
    Relationship,
};
#[cfg(feature = "ai_backend")]
pub use persistence::{KnowledgeGraphSnapshot, Persistence, RagSystemSnapshot};
#[cfg(feature = "ai_backend")]
pub use rag::{RagConfig, RagSystem, RetrievalResult, RetrievalSource};
#[cfg(feature = "ai_backend")]
pub use vector_store::{VectorData, VectorStore};
