A full-stack document management and AI chat application that enables users to upload, manage, and chat with their documents using AI. Built with ASP.NET Core Web API backend and Angular frontend.
AIDocumentRAG provides an intelligent document management system with AI-powered chat capabilities. Users can upload documents, organize them in a searchable interface, and engage in natural language conversations about document contents using multiple AI providers including OpenAI's GPT models and Ollama.
- File Processing: Automatic copying and metadata extraction from source directories
- Multiple Format Support: PDF, Word documents (.docx, .doc), Excel files (.xlsx, .xls), text files (.txt), and more
- Metadata Tracking: File size, creation date, modification date, character count, and file extension
- Search Functionality: Real-time search across file names, types, sizes, and dates
- Multi-Select Mode: Select and work with multiple documents simultaneously
- File Upload: Direct file upload support with drag-and-drop interface
- File Operations: Rename, delete, and retrieve file content
- File Status Tracking: System initialization and file management status
- Multi-Provider Support: OpenAI GPT models and Ollama local models
- Document-Aware Conversations: Chat about specific documents or multiple documents at once
- Conversation History: Persistent chat history per document/document set with local storage
- Streaming Responses: Real-time AI response streaming for better user experience
- Context-Aware Prompts: Automatic document context injection into chat prompts
- Export Functionality: Export chat conversations as JSON files
- Model Selection: Choose between different AI models and providers
- Single Document Summaries: Generate summaries for individual documents
- Multi-Document Summaries: Batch summary generation for multiple documents
- Caching System: Intelligent caching of summaries to improve performance
- Summary State Management: Track loading states and summary availability
- Single Document Notes: Generate structured notes for individual documents
- Multi-Document Notes: Create cross-document analysis and comparative notes
- Note Management: Full CRUD operations for notes (create, read, update, delete)
- Note Search: Search across all generated notes
- Note Categories and Tags: Organize notes with categories and tagging system
- Cross-Document Context: Analyze relationships between multiple documents
- Fluent Design: Modern UI following Microsoft Fluent Design principles
- Responsive Layout: Grid-based layout that adapts to different screen sizes
- Real-time Updates: Live document status and loading indicators
- Search Integration: Integrated search with filtering and result highlighting
- Tabbed Interface: Separate tabs for chat and note generation
- Drag and Drop: Intuitive file upload with visual feedback
- Controllers:
FileManagementController
: Handles document operations (initialize, upload, list, retrieve, delete, rename)AIChatController
: Manages AI chat interactions (regular and streaming) with multi-provider supportDocumentSummaryController
: Generates and retrieves document summariesNoteGenerationController
: Manages note generation and CRUD operations
- Services:
FileManagementService
: Core document processing and repository managementAIChatService
: Multi-provider AI integration with Semantic KernelDocumentSummaryService
: Document summarization with cachingNoteGenerationService
: Note generation and management
- Models: Comprehensive request/response DTOs with API responses
- Components:
DocumentsQuickViewComponent
: Sidebar for document browsing and selectionChatViewComponent
: Main chat interface with conversation management and multi-provider supportNoteGenerationComponent
: Note generation interface with form controlsFileUploadComponent
: File upload with drag-and-drop supportLoadingDialogComponent
: System initialization and loading states
- Services:
FileManagementService
: Backend API integrationDocumentSearchService
: Client-side search functionalityAIChatService
: Multi-provider AI chat API integrationDocumentSummaryService
: Summary management with cachingNoteGenerationService
: Note generation and management
GET /api/filemanagement/status
- System status and initialization statePOST /api/filemanagement/initialize
- Initialize with source/destination pathsPOST /api/filemanagement/upload
- Upload individual filesGET /api/filemanagement/files
- List all managed filesGET /api/filemanagement/files/{fileName}
- Get specific file metadataGET /api/filemanagement/files/{fileName}/content
- Get file contentDELETE /api/filemanagement/files/{fileName}
- Delete specific filePOST /api/filemanagement/files/{fileName}/rename
- Rename files
GET /api/aichat/ollama/models
- Get available Ollama modelsPOST /api/aichat/chat
- Send chat message (synchronous)POST /api/aichat/chat/stream
- Send chat message (streaming response)
GET /api/documentsummary/{fileName}
- Get summary for specific documentPOST /api/documentsummary/multiple
- Get summaries for multiple documents
POST /api/notegeneration/generate
- Generate note for single documentPOST /api/notegeneration/generate-multi
- Generate multi-document noteGET /api/notegeneration/all
- Get all notesGET /api/notegeneration/{noteId}
- Get specific note by IDGET /api/notegeneration/document/{fileName}
- Get notes for specific documentGET /api/notegeneration/documents/multiple
- Get notes for multiple documentsGET /api/notegeneration/cross-document/{documentNames}
- Get cross-document notesGET /api/notegeneration/search
- Search notes by queryPUT /api/notegeneration/{noteId}
- Update existing noteDELETE /api/notegeneration/{noteId}
- Delete specific noteDELETE /api/notegeneration/document/{fileName}
- Delete all notes for document
- Framework: ASP.NET Core (.NET 9.0)
- AI Integration: Microsoft Semantic Kernel with OpenAI and Ollama support
- Architecture: Clean architecture with SOLID principles
- Patterns: Repository pattern, dependency injection, async/await
- Markdown Processing: Markdig for content formatting
- Framework: Angular 19 with TypeScript
- UI Library: Fluent UI Web Components
- State Management: RxJS observables and local storage
- Styling: CSS with Fluent Design variables and animations
- Icons: FontAwesome for file type icons
- API Testing: HTTP files for endpoint testing
- Configuration: Environment-based settings
- CORS: Configured for development origins
- Package Manager: Yarn for dependency management
AIDocumentRAG/
├── AIDocumentRAG.Server/ # ASP.NET Core Web API
│ ├── Controllers/ # API controllers (4 controllers)
│ ├── Services/ # Business logic services
│ │ ├── ChatInference/ # AI chat and document summary
│ │ ├── FileManagement/ # File operations and processing
│ │ └── NoteGeneration/ # Note generation and management
│ ├── Models/ # DTOs and data models
│ └── Program.cs # Application entry point
├── aidocumentrag.client/ # Angular frontend
│ ├── src/app/components/ # UI components (6 components)
│ ├── src/app/services/ # Angular services (5 services)
│ └── src/environments/ # Environment configuration
└── Data/ # Sample documentation files
- OpenAI API Key: Set via
OPENAI_API_KEY
environment variable - Ollama Integration: Local Ollama server at
http://localhost:11434
- File Management: Configurable through
appsettings.json
- Default source/destination paths
- Maximum file size limits
- Allowed file extensions
- CORS: Development origins configured for ports 58585 and 4200
- Ports: HTTPS on 7040, HTTP on 5002
- API URL: Configured in
environment.ts
for HTTPS port 7040 - Proxy Configuration: Set up for development API calls
- Angular Version: 19.2.0 with modern build tools
Handles the core document processing workflow:
- Directory copying and file processing
- Metadata extraction and storage
- File repository management with in-memory storage
- File upload, deletion, and renaming operations
Manages multi-provider AI interactions:
- OpenAI GPT-4o-mini integration
- Ollama local model support
- Streaming and non-streaming responses
- Error handling and logging
Provides intelligent document summarization:
- Single and multi-document summary generation
- Intelligent caching system
- Performance optimization through state management
Enables comprehensive note management:
- Single and multi-document note generation
- Full CRUD operations for notes
- Cross-document analysis capabilities
- Search and filtering functionality
Provides intelligent document discovery:
- Real-time filtering across multiple criteria
- File type keyword matching
- Size and date range queries
- Client-side search optimization
Enables document-focused conversations:
- Single and multi-document chat modes
- Conversation persistence per document set with local storage
- Export functionality for chat history
- Multi-provider AI model support
- Context-aware prompt building
- User Authentication: No user management or authentication system
- Database Persistence: All data is stored in-memory (lost on restart)
- File Versioning: No version control for uploaded documents
- Collaborative Features: No multi-user collaboration capabilities
- Advanced Analytics: No usage statistics or document analytics
- WebSocket Support: No real-time collaboration features
- File Encryption: No encryption for sensitive documents
- Backup/Restore: No automated backup system for conversations and notes