Home
Softono
b

byerlikaya

Professional software vendor delivering innovative solutions on the Softono platform. Specialized in both open-source and proprietary software development.

Total Products
1

Software by byerlikaya

SmartRAG
Open Source

SmartRAG

<p align="center"> <img src="icon.svg" alt="SmartRAG Logo" width="200" height="200"> </p> <p align="center"> <b>Multi-Modal RAG for .NET β€” query databases, documents, images & audio in natural language</b> </p> <p align="center"> <a href="https://www.nuget.org/packages/SmartRAG"><img src="https://img.shields.io/nuget/v/SmartRAG.svg?style=for-the-badge&logo=nuget" alt="NuGet Version"/></a> <a href="https://www.nuget.org/packages/SmartRAG"><img src="https://img.shields.io/nuget/dt/SmartRAG.svg?style=for-the-badge&logo=nuget" alt="Downloads"/></a> <a href="https://github.com/byerlikaya/SmartRAG/stargazers"><img src="https://img.shields.io/github/stars/byerlikaya/SmartRAG?style=for-the-badge&logo=github" alt="GitHub Stars"/></a> <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg?style=for-the-badge" alt="License"/></a> </p> <p align="center"> <a href="https://github.com/byerlikaya/SmartRAG/actions"><img src="https://img.shields.io/github/actions/workflow/status/byerlikaya/SmartRAG/ci.yml?style=for-the-badge&logo=github" alt="Build Status"/></a> <a href="https://www.nuget.org/packages/SmartRAG"><img src="https://img.shields.io/badge/.NET-6.0-blue?style=for-the-badge&logo=.net" alt=".NET 6"/></a> </p> <p align="center"> <a href="https://byerlikaya.github.io/SmartRAG/en/"><img src="https://img.shields.io/badge/πŸ“š-Complete_Documentation-blue?style=for-the-badge&logo=book" alt="Documentation"/></a> <a href="README.tr.md"><img src="https://img.shields.io/badge/πŸ‡ΉπŸ‡·-TΓΌrkΓ§e_README-red?style=for-the-badge" alt="Turkish README"/></a> </p> ## πŸš€ **Quick Start** ### **1. Install SmartRAG** ```bash dotnet add package SmartRAG ``` ### **2. Setup** ```csharp // 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 ); ``` ### **3. Configure databases in appsettings.json** ```json { "SmartRAG": { "DatabaseConnections": [ { "Name": "Sales", "ConnectionString": "Server=localhost;Database=Sales;...", "DatabaseType": "SqlServer" } ] } } ``` ### **4. Upload documents & ask questions** ```csharp // 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 ``` ### **5. (Optional) Configure MCP Client & File Watcher** ```json { "SmartRAG": { "Features": { "EnableMcpSearch": true, "EnableFileWatcher": true }, "McpServers": [ { "ServerId": "example-server", "Endpoint": "https://mcp.example.com/api", "TransportType": "Http" } ], "WatchedFolders": [ { "FolderPath": "/path/to/documents", "AllowedExtensions": [".pdf", ".docx", ".txt"], "AutoUpload": true } ], "DefaultLanguage": "en" } } ``` **Want to test SmartRAG immediately?** β†’ [Jump to Examples & Testing](#-examples--testing) ### **Dashboard (Web UI)** SmartRAG includes a built-in browser-based dashboard for document management and chat (no separate package needed): ```csharp builder.Services.AddSmartRag(builder.Configuration); builder.Services.AddSmartRagDashboard(options => { options.Path = "/smartrag"; }); app.UseSmartRagDashboard("/smartrag"); app.MapSmartRagDashboard("/smartrag"); ``` Then open `https://localhost:5000/smartrag` to list/upload/delete documents and chat with the active AI model. **By default the dashboard is only enabled in Development.** For production, protect the path with your own auth or use `AuthorizationFilter`. See [Dashboard documentation](https://byerlikaya.github.io/SmartRAG/en/dashboard.html) for security and options. ### **Dashboard & UI Overview** SmartRAG ships with a production-ready web dashboard for managing documents, databases, and AI conversations. The screenshots below show a typical setup in development: | Chat & Conversation | Database Schema Analysis | | ------------------- | ------------------------ | | ![SmartRAG Chat](screenshot/chat_3.png) | ![SmartRAG Database Schema Analyzer](screenshot/database_1.png) | | Database Details & Relations | Document Management & Settings | | ---------------------------- | ------------------------------ | | ![SmartRAG Database Details](screenshot/database_2.png) | ![SmartRAG Settings](screenshot/settings_1.png) | <details> <summary><strong>Show full dashboard gallery (all views)</strong></summary> #### Chat & Conversations - ![SmartRAG Chat - Conversation Overview](screenshot/chat_3.png) - ![SmartRAG Chat - Database-Aware Answer](screenshot/chat_2.png) - ![SmartRAG Chat - Mixed Sources Answer](screenshot/chat_4.png) #### Database Overview & Health - ![SmartRAG Database Overview](screenshot/database_1.png) - ![SmartRAG Database Details](screenshot/database_2.png) #### Schema & Table Insights - ![SmartRAG Table and Relationship View](screenshot/database_3.png) - ![SmartRAG Cross-Database Schema Insights](screenshot/database_3_1.png) - ![SmartRAG Schema-Level Summary](screenshot/database_4.png) - ![SmartRAG Schema Column Details](screenshot/schema_1.png) - ![SmartRAG Schema Relationship Map](screenshot/schema_2.png) #### Documents & File Processing - ![SmartRAG Document List View](screenshot/document_1.png) #### Settings & Configuration - ![SmartRAG Core Settings](screenshot/settings_1.png) - ![SmartRAG Advanced Settings](screenshot/settings_2.png) </details> ## πŸ† **Why SmartRAG?** 🎯 **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 🧩 **Modular Architecture** - Strategy Pattern for SQL dialects, scoring, and file parsing 🏠 **100% Local Processing** - GDPR, KVKK, HIPAA compliant πŸš€ **Production Ready** - Enterprise-grade, thread-safe, high performance ## 🎯 **Real-World Use Cases** ### **1. Banking - Customer Financial Profile** ```csharp 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 ``` ### **2. Healthcare - Patient Care Management** ```csharp 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 ``` ### **3. Inventory - Supply Chain Optimization** ```csharp 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 ``` ## πŸš€ **What Makes SmartRAG Special?** - **Native multi-database RAG capabilities** for .NET - **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 - **MCP Client integration** for extending capabilities with external tools - **Automatic file watching** for real-time document indexing ## πŸ§ͺ **Examples & Testing** SmartRAG provides comprehensive example applications for different use cases: ### **πŸ“ Available Examples** ``` examples/ β”œβ”€β”€ SmartRAG.API/ # Complete REST API with Swagger UI └── SmartRAG.Demo/ # Interactive console application ``` ### **πŸš€ Quick Test with Demo** Want to see SmartRAG in action immediately? Try our interactive console demo: ```bash # Clone and run the demo git clone https://github.com/byerlikaya/SmartRAG.git cd SmartRAG/examples/SmartRAG.Demo dotnet run ``` **Prerequisites:** You need to have databases and AI services running locally, or use Docker for easy setup. πŸ“– **[SmartRAG.Demo README](examples/SmartRAG.Demo/README.md)** - Complete demo application guide and setup instructions #### **🐳 Docker Setup (Recommended)** For the easiest experience with all services pre-configured: ```bash # Start all services (SQL Server, MySQL, PostgreSQL, Ollama, Qdrant, Redis) docker-compose up -d # Setup AI models docker exec -it smartrag-ollama ollama pull llama3.2 docker exec -it smartrag-ollama ollama pull nomic-embed-text ``` πŸ“š **[Complete Docker Setup Guide](examples/SmartRAG.Demo/README-Docker.md)** - Detailed Docker configuration, troubleshooting, and management ### **πŸ“‹ Demo Features & Steps:** **πŸ”— Database Management:** - **Step 1-2**: Show connections & health check - **Step 3-5**: Create test databases (SQL Server, MySQL, PostgreSQL) - **Step 6**: Create SQLite test database - **Step 7**: View database schemas and relationships **πŸ€– AI & Query Testing:** - **Step 8**: Query analysis - see how natural language converts to SQL - **Step 9**: Automatic test queries - pre-built scenarios - **Step 10**: Multi-database AI queries - ask questions across all databases **🏠 Local AI Setup:** - **Step 11**: Setup Ollama models for 100% local processing - **Step 12**: Test vector stores (InMemory, FileSystem, Redis, SQLite, Qdrant) **πŸ“„ Document Processing:** - **Step 13**: Upload documents (PDF, Word, Excel, Images, Audio) - **Step 14**: List and manage uploaded documents - **Step 15**: Clear documents for fresh testing - **Step 16**: Conversational Assistant - combine databases + documents + chat - **Step 17**: MCP Integration - list tools and run MCP queries **πŸ“ File Watcher:** - Automatic folder monitoring for new documents - Real-time document indexing - Duplicate detection and prevention **Perfect for:** Quick evaluation, proof-of-concept, team demos, learning SmartRAG capabilities πŸ“š **[Complete Examples & Testing Guide](https://byerlikaya.github.io/SmartRAG/en/examples)** - Step-by-step tutorials and test scenarios ## 🎯 **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 ## πŸ“„ License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. **Built with ❀️ by Barış Yerlikaya** Made in Turkey πŸ‡ΉπŸ‡· | [Contact](mailto:[email protected]) | [LinkedIn](https://www.linkedin.com/in/barisyerlikaya/)

Knowledge Bases & RAG Backend as a Service
26 Github Stars