Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
af8b324
feat: Semantic Kernel integration as enhancement layer (not AI provider)
byerlikaya Aug 16, 2025
1552b7c
feat: Semantic Kernel integration as enhancement layer (not AI provider)
byerlikaya Aug 16, 2025
6a8ce0a
Fix all compilation warnings: Achieve 0 errors, 0 warnings, 0 message…
byerlikaya Aug 16, 2025
5100b8b
Remove domain-specific hardcoded code
byerlikaya Aug 16, 2025
8ec5bdd
Fix Redis lock issues and integrate Semantic Kernel for cross-documen…
byerlikaya Aug 16, 2025
357dda7
feat: Implement smart rate limiting for global package compatibility
byerlikaya Aug 16, 2025
87ac2fa
feat: Add Unicode normalization and improve name detection for RAG se…
byerlikaya Aug 16, 2025
38a2a59
feat: Simplify query intent detection to be truly language-agnostic -…
byerlikaya Aug 16, 2025
2e35e2d
feat: Add comprehensive benchmark testing and troubleshooting guide
byerlikaya Aug 16, 2025
8479af2
docs: Update README and add troubleshooting guide
byerlikaya Aug 16, 2025
ce20e6f
Remove benchmark testing functionality - simplify project scope
byerlikaya Aug 16, 2025
4ddcb49
Update configuration to InMemory storage and OpenAI provider - simpli…
byerlikaya Aug 16, 2025
5c9eed8
Fix README example: replace personal salary query with generic employ…
byerlikaya Aug 16, 2025
1c213ad
Add VoyageAI embedding configuration for Anthropic - include official…
byerlikaya Aug 16, 2025
f8de196
Update configuration to Redis + Gemini and fix code formatting
byerlikaya Aug 17, 2025
fc4facd
Revert Program.cs configuration back to InMemory + OpenAI
byerlikaya Aug 17, 2025
fecd095
docs: Update README.md - Replace Roadmap with What's New section
byerlikaya Aug 17, 2025
7f74ace
feat: Prepare v1.0.1 release - Update package version, release notes,…
byerlikaya Aug 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
- Initial project structure
- Planning for future releases
### Planned
- Excel file support with EPPlus
- Batch document processing
- Advanced search filters
- Performance monitoring

## [1.0.1] - 2025-01-19

### Improved
- 🧠 **Smart Query Intent Detection**: Enhanced query routing between chat and document search
- 🌍 **Language-Agnostic Design**: Removed all hardcoded language patterns for global compatibility
- πŸ” **Enhanced Search Relevance**: Improved name detection and content scoring algorithms
- πŸ”€ **Unicode Normalization**: Fixed special character handling issues (e.g., Turkish characters)
- ⚑ **Rate Limiting & Retry Logic**: Robust API handling with exponential backoff
- πŸš€ **VoyageAI Integration**: Optimized Anthropic embedding support
- πŸ“š **Enhanced Documentation**: Added official documentation links and troubleshooting guide
- 🧹 **Configuration Cleanup**: Removed unnecessary configuration fields
- 🎯 **Project Simplification**: Streamlined codebase for better performance

### Fixed
- Query intent detection for general conversation vs document search
- Special character handling in search queries
- Rate limiting issues with AI providers
- Configuration validation and error handling

## [1.0.0] - 2025-01-19

Expand Down
140 changes: 113 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ SmartRAG is a **production-ready** .NET 9.0 library that provides a complete **R
## ✨ Key Highlights

- 🎯 **AI Question Answering**: Ask questions about your documents and get intelligent, contextual answers
- 🧠 **Smart Query Intent Detection**: Automatically distinguishes between general conversation and document search queries
- 🌍 **Language-Agnostic**: Works with any language without hardcoded patterns or keywords
- πŸ€– **Universal AI Support**: 5 dedicated providers + CustomProvider for unlimited AI APIs
- 🏒 **Enterprise Storage**: Vector databases, Redis, SQL, FileSystem with advanced configurations
- 🧠 **Advanced RAG Pipeline**: Smart chunking, semantic retrieval, AI-powered answer generation
Expand All @@ -25,17 +27,38 @@ SmartRAG is a **production-ready** .NET 9.0 library that provides a complete **R
```
πŸ“„ Document Upload β†’ πŸ” Smart Chunking β†’ 🧠 AI Embeddings β†’ πŸ’Ύ Vector Storage
↓
πŸ™‹β€β™‚οΈ User Question β†’ πŸ” Find Relevant Chunks β†’ πŸ€– AI Answer Generation β†’ ✨ Smart Response
πŸ™‹β€β™‚οΈ User Question β†’ 🎯 Intent Detection β†’ πŸ” Find Relevant Chunks β†’ πŸ€– AI Answer Generation β†’ ✨ Smart Response
```

### πŸ† **Production Features**
- **Smart Chunking**: Maintains context continuity between document segments
- **Intelligent Query Routing**: Automatically routes general conversation to AI chat, document queries to RAG search
- **Language-Agnostic Design**: No hardcoded language patterns - works globally with any language
- **Multiple Storage Options**: From in-memory to enterprise vector databases
- **AI Provider Flexibility**: Switch between providers without code changes
- **Document Intelligence**: Advanced parsing for PDF, Word, and text formats
- **Configuration-First**: Environment-based configuration with sensible defaults
- **Dependency Injection**: Full DI container integration

## 🧠 Smart Query Intent Detection

SmartRAG automatically detects whether your query is a general conversation or a document search request:

### **General Conversation** (Direct AI Chat)
- βœ… **"How are you?"** β†’ Direct AI response
- βœ… **"What's the weather like?"** β†’ Direct AI response
- βœ… **"Tell me a joke"** β†’ Direct AI response
- βœ… **"Emin misin?"** β†’ Direct AI response (Turkish)
- βœ… **"δ½ ε₯½ε—οΌŸ"** β†’ Direct AI response (Chinese)

### **Document Search** (RAG with your documents)
- πŸ” **"What are the main benefits in the contract?"** β†’ Searches your documents
- πŸ” **"Γ‡alışan maaş bilgileri nedir?"** β†’ Searches your documents (Turkish)
- πŸ” **"2025年第一季度ζŠ₯ε‘Šηš„δΈ»θ¦ε‘ηŽ°ζ˜―δ»€δΉˆοΌŸ"** β†’ Searches your documents (Chinese)
- πŸ” **"Show me the employee salary data"** β†’ Searches your documents

**How it works:** The system analyzes query structure (numbers, dates, formats, length) to determine intent without any hardcoded language patterns.

## πŸ“¦ Installation

### NuGet Package Manager
Expand All @@ -50,12 +73,27 @@ dotnet add package SmartRAG

### PackageReference
```xml
<PackageReference Include="SmartRAG" Version="1.0.0" />
<PackageReference Include="SmartRAG" Version="1.0.1" />
```

## πŸš€ Quick Start

### 1. **Basic Setup**
### 1. **Development Setup**
```bash
# Clone the repository
git clone https://github.com/byerlikaya/SmartRAG.git
cd SmartRAG

# Copy development configuration template
cp src/SmartRAG.API/appsettings.Development.template.json src/SmartRAG.API/appsettings.Development.json

# Edit appsettings.Development.json with your API keys
# - OpenAI API Key
# - Azure OpenAI credentials
# - Database connection strings
```

### 2. **Basic Setup**
```csharp
using SmartRAG.Extensions;
using SmartRAG.Enums;
Expand Down Expand Up @@ -130,6 +168,12 @@ cp src/SmartRAG.API/appsettings.json src/SmartRAG.API/appsettings.Development.js
"ApiKey": "sk-proj-YOUR_REAL_KEY",
"Model": "gpt-4",
"EmbeddingModel": "text-embedding-ada-002"
},
"Anthropic": {
"ApiKey": "sk-ant-YOUR_REAL_KEY",
"Model": "claude-3.5-sonnet",
"EmbeddingApiKey": "voyage-YOUR_REAL_KEY",
"EmbeddingModel": "voyage-large-2"
}
},
"Storage": {
Expand All @@ -140,7 +184,15 @@ cp src/SmartRAG.API/appsettings.json src/SmartRAG.API/appsettings.Development.js
}
```

πŸ“– **[Complete Configuration Guide](docs/configuration.md)**
πŸ“– **[Complete Configuration Guide](docs/configuration.md) | [πŸ”§ Troubleshooting Guide](docs/troubleshooting.md)**

### πŸ”‘ **Important Note for Anthropic Users**
**Anthropic Claude models require a separate VoyageAI API key for embeddings:**
- **Why?** Anthropic doesn't provide embedding models, so we use VoyageAI's high-quality embeddings
- **Official Documentation:** [Anthropic Embeddings Guide](https://docs.anthropic.com/en/docs/build-with-claude/embeddings#how-to-get-embeddings-with-anthropic)
- **Get API Key:** [VoyageAI API Keys](https://console.voyageai.com/)
- **Models:** `voyage-large-2` (recommended), `voyage-code-2`, `voyage-01`
- **Documentation:** [VoyageAI Embeddings API](https://docs.voyageai.com/embeddings/)

## πŸ€– AI Providers - Universal Support

Expand All @@ -149,7 +201,7 @@ cp src/SmartRAG.API/appsettings.json src/SmartRAG.API/appsettings.Development.js
| Provider | Capabilities | Special Features |
|----------|-------------|------------------|
| **πŸ€– OpenAI** | βœ… Latest GPT models<br/>βœ… Advanced embeddings | Industry standard, reliable, extensive model family |
| **🧠 Anthropic** | βœ… Claude family models<br/>βœ… High-quality embeddings | Safety-focused, constitutional AI, long context |
| **🧠 Anthropic** | βœ… Claude family models<br/>βœ… VoyageAI embeddings | Safety-focused, constitutional AI, long context, requires separate VoyageAI API key |
| **🌟 Google Gemini** | βœ… Gemini models<br/>βœ… Multimodal embeddings | Multimodal support, latest Google AI innovations |
| **☁️ Azure OpenAI** | βœ… Enterprise GPT models<br/>βœ… Enterprise embeddings | GDPR compliant, enterprise security, SLA support |

Expand Down Expand Up @@ -278,7 +330,9 @@ services.AddSmartRAG(configuration, options =>
"ApiKey": "sk-ant-...",
"Model": "claude-3.5-sonnet",
"MaxTokens": 4096,
"Temperature": 0.3
"Temperature": 0.3,
"EmbeddingApiKey": "voyage-...",
"EmbeddingModel": "voyage-large-2"
}
},
"Storage": {
Expand Down Expand Up @@ -363,18 +417,29 @@ curl -X DELETE "http://localhost:5000/api/documents/{document-id}"
curl "http://localhost:5000/api/documents/search"
```

### **AI Question Answering**
### **AI Question Answering & Chat**

SmartRAG handles both document search and general conversation automatically:

```bash
# Ask questions about your documents
# Ask questions about your documents (RAG mode)
curl -X POST "http://localhost:5000/api/search/search" \
-H "Content-Type: application/json" \
-d '{
"query": "What are the main risks mentioned in the financial report?",
"maxResults": 5
}'

# General conversation (Direct AI chat mode)
curl -X POST "http://localhost:5000/api/search/search" \
-H "Content-Type: application/json" \
-d '{
"query": "How are you today?",
"maxResults": 1
}'
```

**Response Example:**
**Document Search Response Example:**
```json
{
"query": "What are the main risks mentioned in the financial report?",
Expand All @@ -387,18 +452,40 @@ curl -X POST "http://localhost:5000/api/search/search" \
"relevanceScore": 0.94
}
],
"processingTimeMs": 1180
"searchedAt": "2025-08-16T14:57:06.2312433Z",
"configuration": {
"aiProvider": "Anthropic",
"storageProvider": "Redis",
"model": "Claude + VoyageAI"
}
}
```

**General Chat Response Example:**
```json
{
"query": "How are you today?",
"answer": "I'm doing well, thank you for asking! I'm here to help you with any questions you might have about your documents or just general conversation. How can I assist you today?",
"sources": [],
"searchedAt": "2025-08-16T14:57:06.2312433Z",
"configuration": {
"aiProvider": "Anthropic",
"storageProvider": "Redis",
"model": "Claude + VoyageAI"
}
}
```


## πŸ“Š Performance & Scaling

### **Benchmarks**
- **Document Upload**: ~500ms for 10MB PDF
- **Semantic Search**: ~200ms with 10K documents
- **AI Response**: ~2-5s depending on provider
- **Memory Usage**: ~50MB base + documents in memory
- **Document Upload**: ~500ms for 100KB file, ~1-2s for 1MB file
- **Semantic Search**: ~200ms for simple queries, ~500ms for complex queries
- **AI Response**: ~2-5s for 5 sources, ~3-8s for 10 sources
- **Memory Usage**: ~50MB base + documents, ~100MB with Redis cache



### **Scaling Tips**
- Use **Redis** or **Qdrant** for production workloads
Expand Down Expand Up @@ -436,19 +523,18 @@ We welcome contributions!
4. Add tests
5. Submit a pull request

## πŸ“ˆ Roadmap

### **Version 1.1.0**
- [ ] Excel file support with EPPlus
- [ ] Batch document processing
- [ ] Advanced search filters
- [ ] Performance monitoring

### **Version 1.2.0**
- [ ] Multi-modal document support (images, tables)
- [ ] Real-time collaboration features
- [ ] Advanced analytics dashboard
- [ ] GraphQL API support
## πŸ†• What's New

### **Latest Release (v1.0.1)**
- 🧠 **Smart Query Intent Detection** - Automatically routes queries to chat vs document search
- 🌍 **Language-Agnostic Design** - Removed all hardcoded language patterns
- πŸ” **Enhanced Search Relevance** - Improved name detection and content scoring
- πŸ”€ **Unicode Normalization** - Fixed special character handling issues
- ⚑ **Rate Limiting & Retry Logic** - Robust API handling with exponential backoff
- πŸš€ **VoyageAI Integration** - Anthropic embedding support
- πŸ“š **Enhanced Documentation** - Official documentation links
- 🧹 **Configuration Cleanup** - Removed unnecessary fields
- 🎯 **Project Simplification** - Streamlined for better performance

## πŸ“š Resources

Expand Down
Loading
Loading