SmartRAG 3.7.0
See the version list below for details.
dotnet add package SmartRAG --version 3.7.0
NuGet\Install-Package SmartRAG -Version 3.7.0
<PackageReference Include="SmartRAG" Version="3.7.0" />
<PackageVersion Include="SmartRAG" Version="3.7.0" />
<PackageReference Include="SmartRAG" />
paket add SmartRAG --version 3.7.0
#r "nuget: SmartRAG, 3.7.0"
#:package SmartRAG@3.7.0
#addin nuget:?package=SmartRAG&version=3.7.0
#tool nuget:?package=SmartRAG&version=3.7.0
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
- Complete Documentation - https://byerlikaya.github.io/SmartRAG/en/ - Comprehensive guides, API reference, and tutorials
- GitHub Repository - https://github.com/byerlikaya/SmartRAG - Source code, examples, and community
- Live Examples - https://byerlikaya.github.io/SmartRAG/en/examples - Real-world usage scenarios
- API Reference - https://byerlikaya.github.io/SmartRAG/en/api-reference - Complete API documentation
- Changelog - https://github.com/byerlikaya/SmartRAG/blob/main/CHANGELOG.md - Version history and updates
π Support
- Email Support - b.yerlikaya@outlook.com
- LinkedIn - https://www.linkedin.com/in/barisyerlikaya/
- GitHub Issues - https://github.com/byerlikaya/SmartRAG/issues
- Website - https://byerlikaya.github.io/SmartRAG/en/
π License
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ by BarΔ±Ε Yerlikaya
| Product | Versions 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. |
-
.NETStandard 2.1
- DocumentFormat.OpenXml (>= 3.3.0)
- EPPlus (>= 8.3.1)
- FFMpegCore (>= 5.4.0)
- itext (>= 9.4.0)
- Microsoft.Data.SqlClient (>= 6.1.3)
- Microsoft.Data.Sqlite (>= 10.0.0)
- Microsoft.Extensions.Caching.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Caching.Memory (>= 10.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Http (>= 10.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.0)
- MySql.Data (>= 9.5.0)
- Npgsql (>= 8.0.8)
- NRedisStack (>= 1.1.1)
- PDFtoImage (>= 5.0.0)
- Qdrant.Client (>= 1.15.1)
- SkiaSharp (>= 3.119.1)
- StackExchange.Redis (>= 2.10.1)
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Text.Json (>= 10.0.0)
- Tesseract (>= 5.2.0)
- Whisper.net (>= 1.9.0)
- Xabe.FFmpeg.Downloader (>= 6.0.2)
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 | 165 | 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 |
Release 3.7.0: Cross-Database Mapping Detector & Security Improvements (MINOR Release - 2026-01-19)
ADDED:
- Cross-Database Mapping Detector: Automatic detection of relationships between columns across different databases
- New CrossDatabaseMapping model for defining cross-database relationships
- New CrossDatabaseMappingDetector service for automatic relationship detection
- Automatic detection based on Primary Key and Foreign Key analysis
- Support for Primary Key and Foreign Key relationship types
- Semantic column name matching for relationship detection
IMPROVEMENTS:
- SQL Script Extraction: Extracted SQL scripts from database creator classes to separate files
- Applied DRY principle by centralizing SQL scripts
- Better maintainability and reusability of database setup scripts
- Database Query Generation: Enhanced query generation and validation logic
- Improved database query generation accuracy
- Better validation logic for generated queries
- Database Parser and Document Search: Updated services for better integration
SECURITY:
- SQL Injection Prevention: Enhanced input validation and parameterized query usage
- Command Injection Prevention: Removed shell command execution, enhanced input sanitization
- Sensitive Data Leakage Prevention: Removed sensitive data from error messages and logs
- Removed backup file paths from exception messages
- Enhanced error message sanitization
TECHNICAL DETAILS:
- Maintained 0 errors, 0 warnings
- Full backward compatibility maintained
- Important security improvements included
This release adds cross-database relationship detection capabilities and includes important security improvements for better data protection.