SmartRAG 3.9.0

dotnet add package SmartRAG --version 3.9.0
                    
NuGet\Install-Package SmartRAG -Version 3.9.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SmartRAG" Version="3.9.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SmartRAG" Version="3.9.0" />
                    
Directory.Packages.props
<PackageReference Include="SmartRAG" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SmartRAG --version 3.9.0
                    
#r "nuget: SmartRAG, 3.9.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SmartRAG@3.9.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SmartRAG&version=3.9.0
                    
Install as a Cake Addin
#tool nuget:?package=SmartRAG&version=3.9.0
                    
Install as a Cake Tool

SmartRAG

Multi-Database RAG Library for .NET
Ask questions about your data in natural language

SmartRAG is a comprehensive Retrieval-Augmented Generation (RAG) library that enables you to query multiple databases, documents, images, and audio files using natural language. Transform your data into intelligent conversations with a single, unified API.

πŸš€ Quick Start

Installation

dotnet add package SmartRAG

Basic Setup

// For Web API applications
builder.Services.AddSmartRag(builder.Configuration, options =>
{
    options.AIProvider = AIProvider.OpenAI;
    options.StorageProvider = StorageProvider.InMemory;
});

// For Console applications
var serviceProvider = services.UseSmartRag(
    configuration,
    aiProvider: AIProvider.OpenAI,
    storageProvider: StorageProvider.InMemory
);

Configuration

Add database connections to your appsettings.json:

{
  "SmartRAG": {
    "DatabaseConnections": [
      {
        "Name": "Sales",
        "ConnectionString": "Server=localhost;Database=Sales;...",
        "DatabaseType": "SqlServer"
      }
    ]
  }
}

Usage Example

// Upload document
var document = await documentService.UploadDocumentAsync(
    fileStream, fileName, contentType, "user-123"
);

// Unified query across databases, documents, images, and audio
var response = await searchService.QueryIntelligenceAsync(
    "Show me all customers who made purchases over $10,000 in the last quarter, their payment history, and any complaints or feedback they provided"
);
// β†’ AI automatically analyzes query intent and routes intelligently:
//   - High confidence + database queries β†’ Searches databases only
//   - High confidence + document queries β†’ Searches documents only  
//   - Medium confidence β†’ Searches both databases and documents, merges results
// β†’ Queries SQL Server (orders), MySQL (payments), PostgreSQL (customer data)
// β†’ Analyzes uploaded PDF contracts, OCR-scanned invoices, and transcribed call recordings
// β†’ Provides unified answer combining all sources

✨ Key Features

🎯 Unified Query Intelligence - Single query searches across databases, documents, images, and audio automatically
🧠 Smart Hybrid Routing - AI analyzes query intent and automatically determines optimal search strategy
πŸ—„οΈ Multi-Database RAG - Query multiple databases simultaneously with natural language
πŸ“„ Multi-Modal Intelligence - PDF, Word, Excel, Images (OCR), Audio (Speech-to-Text), and more
πŸ”Œ MCP Client Integration - Connect to external MCP servers and extend capabilities with external tools
πŸ“ Automatic File Watching - Monitor folders and automatically index new documents without manual uploads
🏠 100% Local Processing - GDPR, KVKK, HIPAA compliant with Ollama and Whisper.net
πŸš€ Production Ready - Enterprise-grade, thread-safe, high performance

πŸ“Š Supported Data Sources

Databases: SQL Server, MySQL, PostgreSQL, SQLite
Documents: PDF, Word, Excel, PowerPoint, Images, Audio
AI Models: OpenAI, Anthropic, Gemini, Azure OpenAI, Ollama (local), LM Studio
Vector Stores: Qdrant, Redis, InMemory
Conversation Storage: Redis, SQLite, FileSystem, InMemory (independent from document storage)
External Integrations: MCP (Model Context Protocol) servers for extended tool capabilities
File Monitoring: Automatic folder watching with real-time document indexing

🎯 Real-World Use Cases

Banking - Customer Financial Profile

var answer = await searchService.QueryIntelligenceAsync(
    "Which customers have overdue payments and what's their total outstanding balance?"
);
// β†’ Queries Customer DB, Payment DB, Account DB and combines results
// β†’ Provides comprehensive financial risk assessment for credit decisions

Healthcare - Patient Care Management

var answer = await searchService.QueryIntelligenceAsync(
    "Show me all patients with diabetes who haven't had their HbA1c checked in 6 months"
);
// β†’ Combines Patient DB, Lab Results DB, Appointment DB and identifies at-risk patients
// β†’ Ensures preventive care compliance and reduces complications

Inventory - Supply Chain Optimization

var answer = await searchService.QueryIntelligenceAsync(
    "Which products are running low on stock and which suppliers can restock them fastest?"
);
// β†’ Analyzes Inventory DB, Supplier DB, Order History DB and provides restocking recommendations
// β†’ Prevents stockouts and optimizes supply chain efficiency

πŸ“š Additional Resources

πŸ“ž Support

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Built with ❀️ by Barış Yerlikaya

Made in Turkey πŸ‡ΉπŸ‡· | Contact | LinkedIn | Website

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.9.0 164 2/5/2026
3.8.1 192 1/28/2026
3.8.0 229 1/26/2026
3.7.0 173 1/19/2026
3.6.0 229 12/30/2025
3.5.0 240 12/26/2025
3.4.0 245 12/11/2025
3.3.0 796 12/1/2025
3.2.0 403 11/27/2025
3.1.0 348 11/13/2025
3.0.3 446 11/6/2025
3.0.2 337 10/23/2025
3.0.1 404 10/22/2025
3.0.0 392 10/22/2025
2.3.1 254 10/8/2025
2.3.0 376 9/16/2025
2.2.0 413 9/15/2025
2.1.0 178 9/5/2025
2.0.0 343 8/27/2025
1.1.0 195 8/22/2025
Loading failed

Release 3.9.0: Conversation Timestamps, RAG Improvements, Qdrant 1.16 (MINOR - 2026-02-05)

ADDED: Conversation timestamps and sources, explicit session RAG overload, duplicate upload prevention by hash, Whisper native bootstrap, MCP on-demand connection.

IMPROVEMENTS: Document RAG search (filename early return, phrase/morphological matching), follow-up question handling, PDF/OCR encoding, storage factory scoping, Qdrant 1.16.1 compatibility, NuGet updates.

BREAKING: IStorageFactory.GetCurrentRepository(IServiceProvider), IConversationRepository new methods, IQdrantCacheManager removed. See migration guide.