{"id":30453639,"url":"https://github.com/byerlikaya/smartrag","last_synced_at":"2026-02-05T22:07:31.243Z","repository":{"id":310118573,"uuid":"1038743717","full_name":"byerlikaya/SmartRAG","owner":"byerlikaya","description":"SmartRAG is a production-ready .NET 9.0 library that provides a complete Retrieval-Augmented Generation (RAG) solution. Features include multi-provider AI support (OpenAI, Anthropic, Gemini), enterprise vector storage (Qdrant, Redis, SQLite), and intelligent document processing (PDF, Word, Text).","archived":false,"fork":false,"pushed_at":"2025-08-22T14:22:40.000Z","size":353,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-23T00:40:03.683Z","etag":null,"topics":["ai","anthropic","csharp","document-processing","document-qa","dotnet","enterprise-ai","gemini","llm","machine-learning","natural-language-processing","openai","pdf-parser","qdrant","rag","redis","retrieval-augmented-generation","vector-database","word-parser"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/SmartRAG","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/byerlikaya.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-15T18:38:32.000Z","updated_at":"2025-08-22T14:21:47.000Z","dependencies_parsed_at":"2025-08-15T22:36:09.571Z","dependency_job_id":"3ba49cb8-736b-4f04-8e8b-77059e975c61","html_url":"https://github.com/byerlikaya/SmartRAG","commit_stats":null,"previous_names":["byerlikaya/smartrag"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/byerlikaya/SmartRAG","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byerlikaya%2FSmartRAG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byerlikaya%2FSmartRAG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byerlikaya%2FSmartRAG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byerlikaya%2FSmartRAG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/byerlikaya","download_url":"https://codeload.github.com/byerlikaya/SmartRAG/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byerlikaya%2FSmartRAG/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271755394,"owners_count":24815394,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","anthropic","csharp","document-processing","document-qa","dotnet","enterprise-ai","gemini","llm","machine-learning","natural-language-processing","openai","pdf-parser","qdrant","rag","redis","retrieval-augmented-generation","vector-database","word-parser"],"created_at":"2025-08-23T16:01:09.294Z","updated_at":"2026-02-05T22:07:31.233Z","avatar_url":"https://github.com/byerlikaya.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"icon.svg\" alt=\"SmartRAG Logo\" width=\"200\" height=\"200\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eMulti-Modal RAG for .NET — query databases, documents, images \u0026 audio in natural language\u003c/b\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.nuget.org/packages/SmartRAG\"\u003e\u003cimg src=\"https://img.shields.io/nuget/v/SmartRAG.svg?style=for-the-badge\u0026logo=nuget\" alt=\"NuGet Version\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.nuget.org/packages/SmartRAG\"\u003e\u003cimg src=\"https://img.shields.io/nuget/dt/SmartRAG.svg?style=for-the-badge\u0026logo=nuget\" alt=\"Downloads\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/byerlikaya/SmartRAG/stargazers\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/byerlikaya/SmartRAG?style=for-the-badge\u0026logo=github\" alt=\"GitHub Stars\"/\u003e\u003c/a\u003e\n  \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-green.svg?style=for-the-badge\" alt=\"License\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/byerlikaya/SmartRAG/actions\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/byerlikaya/SmartRAG/ci.yml?style=for-the-badge\u0026logo=github\" alt=\"Build Status\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.nuget.org/packages/SmartRAG\"\u003e\u003cimg src=\"https://img.shields.io/badge/.NET%20Standard-2.1-blue?style=for-the-badge\u0026logo=.net\" alt=\".NET Standard 2.1\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://byerlikaya.github.io/SmartRAG/en/\"\u003e\u003cimg src=\"https://img.shields.io/badge/📚-Complete_Documentation-blue?style=for-the-badge\u0026logo=book\" alt=\"Documentation\"/\u003e\u003c/a\u003e\n  \u003ca href=\"README.tr.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/🇹🇷-Türkçe_README-red?style=for-the-badge\" alt=\"Turkish README\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## 🚀 **Quick Start**\n\n### **1. Install SmartRAG**\n```bash\ndotnet add package SmartRAG\n```\n\n### **2. Setup**\n```csharp\n// For Web API applications\nbuilder.Services.AddSmartRag(builder.Configuration, options =\u003e\n{\n    options.AIProvider = AIProvider.OpenAI;\n    options.StorageProvider = StorageProvider.InMemory;\n});\n\n// For Console applications\nvar serviceProvider = services.UseSmartRag(\n    configuration,\n    aiProvider: AIProvider.OpenAI,\n    storageProvider: StorageProvider.InMemory\n);\n```\n\n### **3. Configure databases in appsettings.json**\n```json\n{\n  \"SmartRAG\": {\n    \"DatabaseConnections\": [\n      {\n        \"Name\": \"Sales\",\n        \"ConnectionString\": \"Server=localhost;Database=Sales;...\",\n        \"DatabaseType\": \"SqlServer\"\n      }\n    ]\n    }\n}\n```\n\n### **4. Upload documents \u0026 ask questions**\n```csharp\n// Upload document\nvar document = await documentService.UploadDocumentAsync(\n    fileStream, fileName, contentType, \"user-123\"\n);\n\n// Unified query across databases, documents, images, and audio\nvar response = await searchService.QueryIntelligenceAsync(\n    \"Show me all customers who made purchases over $10,000 in the last quarter, their payment history, and any complaints or feedback they provided\"\n);\n// → AI automatically analyzes query intent and routes intelligently:\n//   - High confidence + database queries → Searches databases only\n//   - High confidence + document queries → Searches documents only  \n//   - Medium confidence → Searches both databases and documents, merges results\n// → Queries SQL Server (orders), MySQL (payments), PostgreSQL (customer data)\n// → Analyzes uploaded PDF contracts, OCR-scanned invoices, and transcribed call recordings\n// → Provides unified answer combining all sources\n```\n\n### **5. (Optional) Configure MCP Client \u0026 File Watcher**\n```json\n{\n  \"SmartRAG\": {\n    \"Features\": {\n      \"EnableMcpSearch\": true,\n      \"EnableFileWatcher\": true\n    },\n    \"McpServers\": [\n      {\n        \"ServerId\": \"example-server\",\n        \"Endpoint\": \"https://mcp.example.com/api\",\n        \"TransportType\": \"Http\"\n      }\n    ],\n    \"WatchedFolders\": [\n      {\n        \"FolderPath\": \"/path/to/documents\",\n        \"AllowedExtensions\": [\".pdf\", \".docx\", \".txt\"],\n        \"AutoUpload\": true\n      }\n    ],\n    \"DefaultLanguage\": \"en\"\n  }\n}\n```\n\n**Want to test SmartRAG immediately?** → [Jump to Examples \u0026 Testing](#-examples--testing)\n\n### **Dashboard (Web UI)**\n\nAdd a browser-based dashboard for document management and chat:\n\n```bash\ndotnet add package SmartRAG.Dashboard\n```\n\n```csharp\nbuilder.Services.AddSmartRag(builder.Configuration);\nbuilder.Services.AddSmartRagDashboard(options =\u003e { options.Path = \"/smartrag\"; });\n\napp.UseSmartRagDashboard(\"/smartrag\");\napp.MapSmartRagDashboard(\"/smartrag\");\n```\n\nThen 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.\n\n## 🏆 **Why SmartRAG?**\n\n🎯 **Unified Query Intelligence** - Single query searches across databases, documents, images, and audio automatically\n\n🧠 **Smart Hybrid Routing** - AI analyzes query intent and automatically determines optimal search strategy\n\n🗄️ **Multi-Database RAG** - Query multiple databases simultaneously with natural language\n\n📄 **Multi-Modal Intelligence** - PDF, Word, Excel, Images (OCR), Audio (Speech-to-Text), and more  \n\n🔌 **MCP Client Integration** - Connect to external MCP servers and extend capabilities with external tools\n\n📁 **Automatic File Watching** - Monitor folders and automatically index new documents without manual uploads\n\n🧩 **Modular Architecture** - Strategy Pattern for SQL dialects, scoring, and file parsing\n\n🏠 **100% Local Processing** - GDPR, KVKK, HIPAA compliant\n\n🚀 **Production Ready** - Enterprise-grade, thread-safe, high performance\n\n## 🎯 **Real-World Use Cases**\n\n### **1. Banking - Customer Financial Profile**\n```csharp\nvar answer = await searchService.QueryIntelligenceAsync(\n    \"Which customers have overdue payments and what's their total outstanding balance?\"\n);\n// → Queries Customer DB, Payment DB, Account DB and combines results\n// → Provides comprehensive financial risk assessment for credit decisions\n```\n\n### **2. Healthcare - Patient Care Management**\n```csharp\nvar answer = await searchService.QueryIntelligenceAsync(\n    \"Show me all patients with diabetes who haven't had their HbA1c checked in 6 months\"\n);\n// → Combines Patient DB, Lab Results DB, Appointment DB and identifies at-risk patients\n// → Ensures preventive care compliance and reduces complications\n```\n\n### **3. Inventory - Supply Chain Optimization**\n```csharp\nvar answer = await searchService.QueryIntelligenceAsync(\n    \"Which products are running low on stock and which suppliers can restock them fastest?\"\n);\n// → Analyzes Inventory DB, Supplier DB, Order History DB and provides restocking recommendations\n// → Prevents stockouts and optimizes supply chain efficiency\n```\n\n## 🚀 **What Makes SmartRAG Special?**\n\n- **Native multi-database RAG capabilities** for .NET\n- **Automatic schema detection** across different database types  \n- **100% local processing** with Ollama and Whisper.net\n- **Enterprise-ready** with comprehensive error handling and logging\n- **Cross-database queries** without manual SQL writing\n- **Multi-modal intelligence** combining documents, databases, and AI\n- **MCP Client integration** for extending capabilities with external tools\n- **Automatic file watching** for real-time document indexing\n\n## 🧪 **Examples \u0026 Testing**\n\nSmartRAG provides comprehensive example applications for different use cases:\n\n### **📁 Available Examples**\n```\nexamples/\n├── SmartRAG.API/          # Complete REST API with Swagger UI\n└── SmartRAG.Demo/         # Interactive console application\n```\n\n### **🚀 Quick Test with Demo**\n\nWant to see SmartRAG in action immediately? Try our interactive console demo:\n\n```bash\n# Clone and run the demo\ngit clone https://github.com/byerlikaya/SmartRAG.git\ncd SmartRAG/examples/SmartRAG.Demo\ndotnet run\n```\n\n**Prerequisites:** You need to have databases and AI services running locally, or use Docker for easy setup.\n\n📖 **[SmartRAG.Demo README](examples/SmartRAG.Demo/README.md)** - Complete demo application guide and setup instructions\n\n#### **🐳 Docker Setup (Recommended)**\n\nFor the easiest experience with all services pre-configured:\n\n```bash\n# Start all services (SQL Server, MySQL, PostgreSQL, Ollama, Qdrant, Redis)\ndocker-compose up -d\n\n# Setup AI models\ndocker exec -it smartrag-ollama ollama pull llama3.2\ndocker exec -it smartrag-ollama ollama pull nomic-embed-text\n```\n\n📚 **[Complete Docker Setup Guide](examples/SmartRAG.Demo/README-Docker.md)** - Detailed Docker configuration, troubleshooting, and management\n\n### **📋 Demo Features \u0026 Steps:**\n\n**🔗 Database Management:**\n- **Step 1-2**: Show connections \u0026 health check\n- **Step 3-5**: Create test databases (SQL Server, MySQL, PostgreSQL)\n- **Step 6**: Create SQLite test database\n- **Step 7**: View database schemas and relationships\n\n**🤖 AI \u0026 Query Testing:**\n- **Step 8**: Query analysis - see how natural language converts to SQL\n- **Step 9**: Automatic test queries - pre-built scenarios\n- **Step 10**: Multi-database AI queries - ask questions across all databases\n\n**🏠 Local AI Setup:**\n- **Step 11**: Setup Ollama models for 100% local processing\n- **Step 12**: Test vector stores (InMemory, FileSystem, Redis, SQLite, Qdrant)\n\n**📄 Document Processing:**\n- **Step 13**: Upload documents (PDF, Word, Excel, Images, Audio)\n- **Step 14**: List and manage uploaded documents\n- **Step 15**: Clear documents for fresh testing\n- **Step 16**: Conversational Assistant - combine databases + documents + chat\n- **Step 17**: MCP Integration - list tools and run MCP queries\n\n**📁 File Watcher:**\n- Automatic folder monitoring for new documents\n- Real-time document indexing\n- Duplicate detection and prevention\n\n**Perfect for:** Quick evaluation, proof-of-concept, team demos, learning SmartRAG capabilities\n\n📚 **[Complete Examples \u0026 Testing Guide](https://byerlikaya.github.io/SmartRAG/en/examples)** - Step-by-step tutorials and test scenarios\n\n## 🎯 **Supported Data Sources**\n\n**📊 Databases:** SQL Server, MySQL, PostgreSQL, SQLite  \n**📄 Documents:** PDF, Word, Excel, PowerPoint, Images, Audio  \n**🤖 AI Models:** OpenAI, Anthropic, Gemini, Azure OpenAI, Ollama (local), LM Studio  \n**🗄️ Vector Stores:** Qdrant, Redis, InMemory  \n**💬 Conversation Storage:** Redis, SQLite, FileSystem, InMemory (independent from document storage)  \n**🔌 External Integrations:** MCP (Model Context Protocol) servers for extended tool capabilities  \n**📁 File Monitoring:** Automatic folder watching with real-time document indexing\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n**Built with ❤️ by Barış Yerlikaya**\n\nMade in Turkey 🇹🇷 | [Contact](mailto:b.yerlikaya@outlook.com) | [LinkedIn](https://www.linkedin.com/in/barisyerlikaya/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyerlikaya%2Fsmartrag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyerlikaya%2Fsmartrag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyerlikaya%2Fsmartrag/lists"}