SmartRAG 3.0.3
See the version list below for details.
dotnet add package SmartRAG --version 3.0.3
NuGet\Install-Package SmartRAG -Version 3.0.3
<PackageReference Include="SmartRAG" Version="3.0.3" />
<PackageVersion Include="SmartRAG" Version="3.0.3" />
<PackageReference Include="SmartRAG" />
paket add SmartRAG --version 3.0.3
#r "nuget: SmartRAG, 3.0.3"
#:package SmartRAG@3.0.3
#addin nuget:?package=SmartRAG&version=3.0.3
#tool nuget:?package=SmartRAG&version=3.0.3
SmartRAG
Multi-Database RAG Library for .NET
Ask questions about your data in natural language
Description
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.
Key Capabilities
- Multi-Database RAG - Query SQL Server, MySQL, PostgreSQL, SQLite together
- Multi-Modal Intelligence - PDF, Word, Excel, Images (OCR), Audio (Whisper.net)
- On-Premise Ready - 100% local with Ollama, LM Studio, Whisper.net
- Conversation History - Built-in automatic context management
- Universal AI Support - OpenAI, Anthropic, Gemini, Azure, Custom APIs
- Enterprise Storage - Qdrant, Redis, SQLite, FileSystem, In-Memory
Getting Started
Prerequisites
- .NET Standard 2.1 or higher
- AI Provider API key (OpenAI, Anthropic, etc.) or local AI setup (Ollama)
- Database connections (SQL Server, MySQL, PostgreSQL, SQLite)
Installation
dotnet add package SmartRAG
Basic Setup
// Program.cs
builder.Services.AddSmartRAG(builder.Configuration);
Configuration
Add database connections to your appsettings.json:
{
"SmartRAG": {
"DatabaseConnections": [
{
"Name": "Sales",
"ConnectionString": "Server=localhost;Database=Sales;...",
"DatabaseType": "SqlServer"
}
]
}
}
Usage
Upload Documents
// Upload document
var document = await documentService.UploadDocumentAsync(
fileStream, fileName, contentType, "user-123"
);
Query Across Multiple Data Sources
// Query across databases and documents
var response = await documentSearchService.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 queries SQL Server (orders), MySQL (payments), PostgreSQL (customer data),
// analyzes uploaded PDF contracts, OCR-scanned invoices, and transcribed call recordings
Multi-Database Queries
// Direct multi-database query coordination
var multiDbResponse = await multiDbCoordinator.QueryMultipleDatabasesAsync(
"Calculate total revenue by customer across all databases",
maxResults: 10
);
// → AI analyzes query intent, generates SQL for each database,
// executes queries, and merges results intelligently
Real-World Use Cases
Banking - Customer Financial Profile
var answer = await documentSearchService.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 documentSearchService.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 documentSearchService.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
What Makes SmartRAG Special?
- Only .NET library with native multi-database RAG capabilities
- Automatic schema detection across different database types
- 100% local processing with Ollama and Whisper.net
- Enterprise-ready with comprehensive error handling and logging
- Cross-database queries without manual SQL writing
- Multi-modal intelligence combining documents, databases, and AI
Supported Data Sources
Databases: SQL Server, MySQL, PostgreSQL, SQLite
Documents: PDF, Word, Excel, PowerPoint, Images, Audio
AI Models: OpenAI, Anthropic, Ollama (local), LM Studio
Vector Stores: Qdrant, Redis, SQLite, InMemory
Comparison with Other RAG Libraries
| Feature | SmartRAG | LM-Kit.NET | Semantic Kernel | LangChain.NET |
|---|---|---|---|---|
| Library Owner | Barış Yerlikaya | LM-Kit (France) | Microsoft | LangChain Community |
| Description | Multi-database RAG library for .NET | Generative AI SDK for .NET applications | AI orchestration framework | .NET port of LangChain framework |
| RAG Support | ✅ | ✅ | ✅ | ✅ |
| Memory Management | ✅ | ✅ | ✅ | ✅ |
| Vector Stores | ✅ | ✅ | ✅ | ✅ |
| AI Model Integration | ✅ | ✅ | ✅ | ✅ |
| Plugin/Extension System | ✅ | ✅ | ✅ | ✅ |
| Multi-Modal | ✅ | ✅ | ❌ | ❌ |
| Local AI | ✅ | ✅ | ❌ | ❌ |
| Audio | ✅ | ✅ | ❌ | ❌ |
| OCR | ✅ | ✅ | ❌ | ❌ |
| On-Premise | ✅ | ✅ | ❌ | ❌ |
| Fallback Providers* | ✅ | ❌ | ❌ | ❌ |
| Retry Policies* | ✅ | ❌ | ❌ | ❌ |
| Batch Embeddings* | ✅ | ❌ | ❌ | ❌ |
| Hybrid Search* | ✅ | ❌ | ❌ | ❌ |
| Session Management* | ✅ | ❌ | ❌ | ❌ |
| Cross-DB JOIN* | ✅ | ❌ | ❌ | ❌ |
| Multi-DB RAG* | ✅ | ❌ | ❌ | ❌ |
| Databases* | ✅ | ❌ | ❌ | ❌ |
SmartRAG Exclusive Features (*):
- Fallback Providers: Automatic failover to backup AI providers when primary fails
- Retry Policies: Configurable retry with FixedDelay, LinearBackoff, ExponentialBackoff
- Batch Embeddings: Efficient batch processing for multiple texts simultaneously
- Hybrid Search: Semantic + keyword hybrid algorithm (80% semantic, 20% keyword)
- Session Management: Persistent conversation continuity across app restarts
- Cross-DB JOIN: AI-powered intelligent joins across different databases
- Multi-DB RAG: Native multi-database query coordination
- Databases: Native support for SQL Server, MySQL, PostgreSQL, SQLite
Additional Documentation
- 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
Feedback
- 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
MIT License - see LICENSE 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.2.1)
- FFMpegCore (>= 5.3.0)
- itext (>= 9.3.0)
- Microsoft.Data.SqlClient (>= 6.1.2)
- Microsoft.Data.Sqlite (>= 9.0.10)
- Microsoft.Extensions.Caching.Abstractions (>= 9.0.10)
- Microsoft.Extensions.Caching.Memory (>= 9.0.10)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.10)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.10)
- Microsoft.Extensions.Http (>= 9.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.10)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 9.0.10)
- MySql.Data (>= 9.5.0)
- Npgsql (>= 8.0.8)
- Qdrant.Client (>= 1.15.1)
- SkiaSharp (>= 3.119.1)
- StackExchange.Redis (>= 2.9.32)
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Text.Json (>= 9.0.10)
- Tesseract (>= 5.2.0)
- Whisper.net (>= 1.8.1)
- 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.1.0 | 286 | 11/13/2025 |
| 3.0.3 | 337 | 11/6/2025 |
| 3.0.2 | 307 | 10/23/2025 |
| 3.0.1 | 373 | 10/22/2025 |
| 3.0.0 | 364 | 10/22/2025 |
| 2.3.1 | 226 | 10/8/2025 |
| 2.3.0 | 349 | 9/16/2025 |
| 2.2.0 | 383 | 9/15/2025 |
| 2.1.0 | 153 | 9/5/2025 |
| 2.0.0 | 314 | 8/27/2025 |
| 1.1.0 | 171 | 8/22/2025 |
| 1.0.3 | 186 | 8/20/2025 |
| 1.0.2 | 190 | 8/19/2025 |
| 1.0.1 | 158 | 8/17/2025 |
| 1.0.0 | 118 | 8/15/2025 |
Release 3.0.3: Package Optimization - Native Libraries
PACKAGE OPTIMIZATION:
• Native libraries excluded from SmartRAG package
• Whisper.net.Runtime native libraries no longer included
• Tessdata files no longer included in package
• Significantly reduced package size
BENEFITS:
• Smaller NuGet package footprint
• Cleaner project output directories
• Better dependency management
• Consistent with direct package references
MIGRATION:
• For Audio Transcription: Add Whisper.net.Runtime package to your project
• For OCR: Add Tesseract package to your project
• No changes required if not using these features
This release optimizes package size by excluding native libraries that should come from their respective packages.