ares-server 0.7.5

A.R.E.S - Agentic Retrieval Enhanced Server: A production-grade agentic chatbot server with multi-provider LLM support, tool calling, RAG, and MCP integration
Documentation
//! Retrieval Augmented Generation (RAG) Pipeline
//!
//! This module provides the core RAG pipeline components for enhancing LLM responses
//! with relevant context from your document collections.
//!
//! # Module Structure
//!
//! - `rag::embeddings` - Dense embedding models (fastembed, 38+ models) **[requires `local-embeddings` feature]**
//! - [`rag::search`](crate::rag::search) - Search strategies (semantic, BM25, fuzzy, hybrid)
//! - `rag::reranker` - Cross-encoder reranking for improved relevance **[requires `local-embeddings` feature]**
//! - [`rag::chunker`](crate::rag::chunker) - Text chunking for document processing
//! - [`rag::cache`](crate::rag::cache) - Embedding cache for avoiding recomputation
//!
//! # Feature Flags
//!
//! The `local-embeddings` feature enables ONNX-based local embedding and reranking models.
//! This feature is optional because the ONNX runtime (`ort`) can have build issues on some platforms,
//! particularly Windows with certain MSVC versions.
//!
//! **Note:** The `local-embeddings` feature is NOT supported on Windows MSVC due to linker errors
//! in `ort-sys`. Use WSL, Linux, or macOS for local embeddings, or use remote embedding APIs.
//!
//! Without `local-embeddings`, you can still use:
//! - Remote embedding APIs (OpenAI embeddings, Ollama embeddings, etc.)
//! - The chunker and search modules
//! - The cache module (if you have embeddings from elsewhere)
//!
//! # RAG Pipeline
//!
//! The typical RAG pipeline flow:
//!
//! 1. **Ingestion** - Documents are chunked and embedded
//! 2. **Storage** - Embeddings stored in vector database
//! 3. **Retrieval** - Query embedded, similar chunks retrieved
//! 4. **Reranking** - Cross-encoder reranks for relevance
//! 5. **Generation** - LLM generates response with context
//!
//! # Example
//!
//! ```ignore
//! use ares::rag::{embeddings::EmbeddingModel, chunker::Chunker, search::SearchStrategy};
//!
//! // Embed a document
//! let embedder = EmbeddingModel::new("BAAI/bge-small-en-v1.5")?;
//! let chunker = Chunker::new(512, 50);  // chunk_size, overlap
//!
//! let chunks = chunker.chunk(&document_text);
//! let embeddings = embedder.embed_batch(&chunks).await?;
//!
//! // Search
//! let query_embedding = embedder.embed(&query).await?;
//! let results = vector_store.search("my_collection", query_embedding, 10).await?;
//! ```
//!
//! # Embedding Models
//!
//! Supports 38+ models via fastembed. Popular choices:
//! - `BAAI/bge-small-en-v1.5` - Fast, good quality (default)
//! - `BAAI/bge-base-en-v1.5` - Higher quality, slower
//! - `sentence-transformers/all-MiniLM-L6-v2` - Lightweight

// Compile-time error for unsupported platform + feature combination
#[cfg(all(
    feature = "local-embeddings",
    target_os = "windows",
    target_env = "msvc"
))]
compile_error!(
    "The `local-embeddings` feature is not supported on Windows MSVC due to ort-sys linker errors. \
    Please use one of the following alternatives:\n\
    1. Use WSL (Windows Subsystem for Linux)\n\
    2. Use remote embedding APIs (OpenAI, Ollama, etc.)\n\
    3. Build on Linux or macOS\n\
    4. Disable this feature: cargo build --no-default-features --features \"...\""
);

pub mod cache;
pub mod chunker;
#[cfg(feature = "local-embeddings")]
pub mod embeddings;
#[cfg(feature = "local-embeddings")]
pub mod reranker;
pub mod search;