rag-module 0.6.7

Enterprise RAG module with chat context storage, vector search, session management, and model downloading. Rust implementation with Node.js compatibility.
use anyhow::Result;
use rag_module::RagModule;

#[tokio::main]
async fn main() -> Result<()> {
    // Initialize RAG module
    let mut rag_module = RagModule::new("/Users/aparnapitchikala/Library/Application Support/Escher").await?;
    rag_module.initialize().await?;

    // Test user ID and context ID
    let user_id = "148854b8-9091-70e0-ed07-40553c514535";
    let context_id = "42a81770-d605-4fed-bfff-49c3194a3728"; // You can change this to any valid context_id

    // Get chat history as JSON
    match rag_module.get_chat_history_json(user_id, context_id).await {
        Ok(chat_history) => {
            // Print clean JSON output
            println!("{}", serde_json::to_string_pretty(&chat_history)?);
        }
        Err(e) => {
            eprintln!("Error: {}", e);
        }
    }

    Ok(())
}