[package]
name = "rag-module"
version = "0.4.6"
edition = "2021"
description = "Enterprise RAG module with chat context storage, vector search, session management, and model downloading. Rust implementation with Node.js compatibility."
authors = ["Escher DBAI <noreply@escher-dbai.com>"]
license = "MIT"
repository = "https://github.com/escher-dbai/client-rag-rust/tree/dual-mode-v2"
homepage = "https://github.com/escher-dbai/client-rag-rust/tree/dual-mode-v2"
documentation = "https://docs.rs/rag-module"
readme = "README.md"
keywords = ["rag", "ai", "vector-search", "embeddings", "chat"]
categories = ["science", "algorithms", "api-bindings", "database-implementations", "web-programming"]
exclude = [
    "test-*/",
    "example-*/",
    "models/",
    "data/",
    "qdrant-data/",
    "sessions/",
    "keys/",
    "sync/",
    "cache/",
    "*.db",
    "*.log"
]

[lib]
name = "rag_module"
crate-type = ["cdylib", "rlib"]

# Temporarily disabled due to formatting issues
# [[bin]]
# name = "rag-server"
# path = "src/bin/server.rs"

[dependencies]
# Async runtime
tokio = { version = "1.40", features = ["full"] }
async-trait = "0.1"

# Serialization
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = ["preserve_order"] }
serde_yaml = "0.9"

# HTTP/API server
axum = "0.7"
tower = "0.4"
tower-http = { version = "0.5", features = ["cors", "trace"] }

# Database/Vector store
qdrant-client = { version = "1.12", features = ["serde"] }
sqlx = { version = "0.7", features = ["runtime-tokio-rustls", "postgres", "sqlite", "json", "uuid", "chrono"] }
redis = { version = "0.24", features = ["tokio-comp", "json"] }

# Vector operations
ndarray = "0.15"
# Machine learning and model downloading
hf-hub = { version = "0.3", features = ["tokio"] }
bytes = "1.5"
futures = "0.3"
candle-core = { version = "0.9.1", features = ["metal"] }
candle-transformers = "0.9.1"
candle-nn = { version = "0.9.1", features = ["metal"] }
safetensors = "0.4"
tokenizers = "0.22"

# Encryption/Security
ring = "0.17"
aes-gcm = "0.10"
argon2 = "0.5"
uuid = { version = "1.10", features = ["v4", "serde"] }
sha2 = "0.10"

# File operations
tokio-fs = "0.1"
fs_extra = "1.3"

# Configuration
config = "0.14"

# Logging
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

# Error handling
anyhow = "1.0"
thiserror = "1.0"

# Utilities
chrono = { version = "0.4", features = ["serde"] }
regex = "1.10"
once_cell = "1.19"
reqwest = { version = "0.11", features = ["json"] }
base64 = "0.21"
rand = "0.8"
indexmap = { version = "2.0", features = ["serde"] }
hex = "0.4"

# Cloud storage
aws-sdk-s3 = { version = "1.58", optional = true }
aws-config = { version = "1.5", optional = true }
azure_storage_blobs = { version = "0.20", optional = true }
google-cloud-storage = { version = "0.18", optional = true }

# FFI for Node.js integration
napi = { version = "2.16", features = ["async", "serde-json"] }
napi-derive = "2.16"
keyring = "3.6.3"

[dev-dependencies]
tempfile = "3.8"
tokio-test = "0.4"

[features]
default = ["qdrant", "local-storage", "encryption", "aws", "metal"]
qdrant = []
local-storage = []
encryption = []
metal = []
aws = ["dep:aws-sdk-s3", "dep:aws-config"]
azure = ["dep:azure_storage_blobs"]
gcp = ["dep:google-cloud-storage"]

[[example]]
name = "test_decrypt_estate"
path = "examples/test_decrypt_estate.rs"
