//! Knowledge Graph Module
//!
//! Implements a knowledge graph using petgraph for entity and relationship management,
//! with integration into the RAG system for contextual retrieval.
//!
//! # Components
//!
//! - **entities**: Entity and relationship types
//! - **graph**: Knowledge graph using petgraph DiGraph
//! - **traversal**: Graph traversal and relationship inference algorithms
//! - **integration**: RAG + KG integration for augmented retrieval
//!
//! # Example
//!
//! ```ignore
//! use typedialog_core::ai::kg::{KnowledgeGraph, Entity, EntityType, Relationship, RelationType};
//!
//! let mut kg = KnowledgeGraph::new();
//!
//! let alice = Entity::new("e1".into(), "Alice".into(), EntityType::Person);
//! let acme = Entity::new("e2".into(), "ACME Corp".into(), EntityType::Organization);
//!
//! kg.add_entity(alice)?;
//! kg.add_entity(acme)?;
//!
//! kg.add_relationship(Relationship::new(
//!     "e1".into(),
//!     "e2".into(),
//!     RelationType::WorksFor
//! ))?;
//! ```

#[cfg(feature = "ai_backend")]
pub mod entities;
#[cfg(feature = "ai_backend")]
pub mod graph;
#[cfg(feature = "ai_backend")]
pub mod integration;
#[cfg(feature = "ai_backend")]
pub mod traversal;

// Public exports when ai_backend feature is enabled
#[cfg(feature = "ai_backend")]
pub use entities::{Entity, EntityType, RelationType, Relationship};
#[cfg(feature = "ai_backend")]
pub use graph::KnowledgeGraph;
#[cfg(feature = "ai_backend")]
pub use integration::{EntityContext, KgAugmentedResult, KgStats, RagKgIntegration};
#[cfg(feature = "ai_backend")]
pub use traversal::{GraphTraversal, InferredRelationship, Path};
