Skip to content

Commit 8479af2

Browse files
committed
docs: Update README and add troubleshooting guide
1 parent 2e35e2d commit 8479af2

File tree

2 files changed

+460
-12
lines changed

2 files changed

+460
-12
lines changed

โ€ŽREADME.mdโ€Ž

Lines changed: 106 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ SmartRAG is a **production-ready** .NET 9.0 library that provides a complete **R
1212
## โœจ Key Highlights
1313

1414
- ๐ŸŽฏ **AI Question Answering**: Ask questions about your documents and get intelligent, contextual answers
15+
- ๐Ÿง  **Smart Query Intent Detection**: Automatically distinguishes between general conversation and document search queries
16+
- ๐ŸŒ **Language-Agnostic**: Works with any language without hardcoded patterns or keywords
1517
- ๐Ÿค– **Universal AI Support**: 5 dedicated providers + CustomProvider for unlimited AI APIs
1618
- ๐Ÿข **Enterprise Storage**: Vector databases, Redis, SQL, FileSystem with advanced configurations
1719
- ๐Ÿง  **Advanced RAG Pipeline**: Smart chunking, semantic retrieval, AI-powered answer generation
@@ -25,17 +27,38 @@ SmartRAG is a **production-ready** .NET 9.0 library that provides a complete **R
2527
```
2628
๐Ÿ“„ Document Upload โ†’ ๐Ÿ” Smart Chunking โ†’ ๐Ÿง  AI Embeddings โ†’ ๐Ÿ’พ Vector Storage
2729
โ†“
28-
๐Ÿ™‹โ€โ™‚๏ธ User Question โ†’ ๐Ÿ” Find Relevant Chunks โ†’ ๐Ÿค– AI Answer Generation โ†’ โœจ Smart Response
30+
๐Ÿ™‹โ€โ™‚๏ธ User Question โ†’ ๐ŸŽฏ Intent Detection โ†’ ๐Ÿ” Find Relevant Chunks โ†’ ๐Ÿค– AI Answer Generation โ†’ โœจ Smart Response
2931
```
3032

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

43+
## ๐Ÿง  Smart Query Intent Detection
44+
45+
SmartRAG automatically detects whether your query is a general conversation or a document search request:
46+
47+
### **General Conversation** (Direct AI Chat)
48+
- โœ… **"How are you?"** โ†’ Direct AI response
49+
- โœ… **"What's the weather like?"** โ†’ Direct AI response
50+
- โœ… **"Tell me a joke"** โ†’ Direct AI response
51+
- โœ… **"Emin misin?"** โ†’ Direct AI response (Turkish)
52+
- โœ… **"ไฝ ๅฅฝๅ—๏ผŸ"** โ†’ Direct AI response (Chinese)
53+
54+
### **Document Search** (RAG with your documents)
55+
- ๐Ÿ” **"What are the main benefits in the contract?"** โ†’ Searches your documents
56+
- ๐Ÿ” **"BarฤฑลŸ Yerlikaya maaลŸฤฑ nedir?"** โ†’ Searches your documents (Turkish)
57+
- ๐Ÿ” **"2025ๅนด็ฌฌไธ€ๅญฃๅบฆๆŠฅๅ‘Š็š„ไธป่ฆๅ‘็Žฐๆ˜ฏไป€ไนˆ๏ผŸ"** โ†’ Searches your documents (Chinese)
58+
- ๐Ÿ” **"Show me the employee salary data"** โ†’ Searches your documents
59+
60+
**How it works:** The system analyzes query structure (numbers, dates, formats, length) to determine intent without any hardcoded language patterns.
61+
3962
## ๐Ÿ“ฆ Installation
4063

4164
### NuGet Package Manager
@@ -155,7 +178,7 @@ cp src/SmartRAG.API/appsettings.json src/SmartRAG.API/appsettings.Development.js
155178
}
156179
```
157180

158-
๐Ÿ“– **[Complete Configuration Guide](docs/configuration.md)**
181+
๐Ÿ“– **[Complete Configuration Guide](docs/configuration.md) | [๐Ÿ”ง Troubleshooting Guide](docs/troubleshooting.md)**
159182

160183
## ๐Ÿค– AI Providers - Universal Support
161184

@@ -378,18 +401,29 @@ curl -X DELETE "http://localhost:5000/api/documents/{document-id}"
378401
curl "http://localhost:5000/api/documents/search"
379402
```
380403

381-
### **AI Question Answering**
404+
### **AI Question Answering & Chat**
405+
406+
SmartRAG handles both document search and general conversation automatically:
407+
382408
```bash
383-
# Ask questions about your documents
409+
# Ask questions about your documents (RAG mode)
384410
curl -X POST "http://localhost:5000/api/search/search" \
385411
-H "Content-Type: application/json" \
386412
-d '{
387413
"query": "What are the main risks mentioned in the financial report?",
388414
"maxResults": 5
389415
}'
416+
417+
# General conversation (Direct AI chat mode)
418+
curl -X POST "http://localhost:5000/api/search/search" \
419+
-H "Content-Type: application/json" \
420+
-d '{
421+
"query": "How are you today?",
422+
"maxResults": 1
423+
}'
390424
```
391425

392-
**Response Example:**
426+
**Document Search Response Example:**
393427
```json
394428
{
395429
"query": "What are the main risks mentioned in the financial report?",
@@ -402,18 +436,71 @@ curl -X POST "http://localhost:5000/api/search/search" \
402436
"relevanceScore": 0.94
403437
}
404438
],
405-
"processingTimeMs": 1180
439+
"searchedAt": "2025-08-16T14:57:06.2312433Z",
440+
"configuration": {
441+
"aiProvider": "Anthropic",
442+
"storageProvider": "Redis",
443+
"model": "Claude + VoyageAI"
444+
}
445+
}
446+
```
447+
448+
**General Chat Response Example:**
449+
```json
450+
{
451+
"query": "How are you today?",
452+
"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?",
453+
"sources": [],
454+
"searchedAt": "2025-08-16T14:57:06.2312433Z",
455+
"configuration": {
456+
"aiProvider": "Anthropic",
457+
"storageProvider": "Redis",
458+
"model": "Claude + VoyageAI"
459+
}
406460
}
407461
```
408462

409463

410464
## ๐Ÿ“Š Performance & Scaling
411465

412466
### **Benchmarks**
413-
- **Document Upload**: ~500ms for 10MB PDF
414-
- **Semantic Search**: ~200ms with 10K documents
415-
- **AI Response**: ~2-5s depending on provider
416-
- **Memory Usage**: ~50MB base + documents in memory
467+
- **Document Upload**: ~500ms for 100KB file, ~1-2s for 1MB file
468+
- **Semantic Search**: ~200ms for simple queries, ~500ms for complex queries
469+
- **AI Response**: ~2-5s for 5 sources, ~3-8s for 10 sources
470+
- **Memory Usage**: ~50MB base + documents, ~100MB with Redis cache
471+
472+
### **Performance Testing**
473+
SmartRAG includes built-in benchmark tools to measure performance:
474+
475+
```bash
476+
# Run comprehensive performance test
477+
curl -X POST "http://localhost:5000/api/benchmark/performance-test" \
478+
-H "Content-Type: application/json" \
479+
-d '{
480+
"testDocumentUpload": true,
481+
"testSearch": true,
482+
"testAIResponse": true,
483+
"testEndToEnd": true,
484+
"documentSizeKB": 100,
485+
"searchQuery": "What are the main topics discussed?",
486+
"maxResults": 5
487+
}'
488+
489+
# Get system information
490+
curl "http://localhost:5000/api/benchmark/system-info"
491+
```
492+
493+
**Expected Results (Development Environment):**
494+
- **Document Upload**: 100KB โ†’ ~500ms, 1MB โ†’ ~1-2s
495+
- **Search Response**: Simple query โ†’ ~200ms, Complex โ†’ ~500ms
496+
- **AI Response**: 5 sources โ†’ ~2-5s, 10 sources โ†’ ~3-8s
497+
- **Memory Usage**: Base ~50MB + document cache
498+
499+
**Production Performance (Redis + Anthropic):**
500+
- **Document Upload**: 1MB โ†’ ~1-2s, 10MB โ†’ ~5-10s
501+
- **Search Response**: Complex query โ†’ ~500ms, Large dataset โ†’ ~1-2s
502+
- **AI Response**: 10 sources โ†’ ~3-8s, 20 sources โ†’ ~5-15s
503+
- **Memory Usage**: Base ~100MB + Redis cache
417504

418505
### **Scaling Tips**
419506
- Use **Redis** or **Qdrant** for production workloads
@@ -453,13 +540,20 @@ We welcome contributions!
453540

454541
## ๐Ÿ“ˆ Roadmap
455542

456-
### **Version 1.1.0**
543+
### **Version 1.1.0** โœ… **COMPLETED**
544+
- [x] **Smart Query Intent Detection** - Automatically routes queries to chat vs document search
545+
- [x] **Language-Agnostic Design** - Removed all hardcoded language patterns
546+
- [x] **Enhanced Search Relevance** - Improved name detection and content scoring
547+
- [x] **Unicode Normalization** - Fixed special character handling issues
548+
- [x] **Rate Limiting & Retry Logic** - Robust API handling with exponential backoff
549+
550+
### **Version 1.2.0** ๐Ÿšง **IN PROGRESS**
457551
- [ ] Excel file support with EPPlus
458552
- [ ] Batch document processing
459553
- [ ] Advanced search filters
460554
- [ ] Performance monitoring
461555

462-
### **Version 1.2.0**
556+
### **Version 1.3.0** ๐Ÿ”ฎ **PLANNED**
463557
- [ ] Multi-modal document support (images, tables)
464558
- [ ] Real-time collaboration features
465559
- [ ] Advanced analytics dashboard

0 commit comments

Comments
ย (0)