{"id":29313040,"url":"https://github.com/montraydavis/aidocumentrag","last_synced_at":"2026-04-19T03:05:16.682Z","repository":{"id":302490896,"uuid":"1012293696","full_name":"montraydavis/AIDocumentRAG","owner":"montraydavis","description":"A full-stack document management and AI chat application that enables users to upload, manage, and chat with their documents using AI. Built with Semantic Kernel, ASP.NET Core Web API backend, and Angular frontend.","archived":false,"fork":false,"pushed_at":"2025-07-02T16:34:51.000Z","size":165,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-02T17:38:17.848Z","etag":null,"topics":["angular","artificial-intelligence","rag-chatbot","semantic-kernel"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/montraydavis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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-07-02T05:50:28.000Z","updated_at":"2025-07-02T16:37:08.000Z","dependencies_parsed_at":"2025-07-02T17:49:17.014Z","dependency_job_id":null,"html_url":"https://github.com/montraydavis/AIDocumentRAG","commit_stats":null,"previous_names":["montraydavis/aidocumentrag"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/montraydavis/AIDocumentRAG","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/montraydavis%2FAIDocumentRAG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/montraydavis%2FAIDocumentRAG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/montraydavis%2FAIDocumentRAG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/montraydavis%2FAIDocumentRAG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/montraydavis","download_url":"https://codeload.github.com/montraydavis/AIDocumentRAG/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/montraydavis%2FAIDocumentRAG/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264049081,"owners_count":23549405,"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","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":["angular","artificial-intelligence","rag-chatbot","semantic-kernel"],"created_at":"2025-07-07T09:14:00.667Z","updated_at":"2026-04-19T03:05:16.669Z","avatar_url":"https://github.com/montraydavis.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# AIDocumentRAG\n\nA 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.\n\n## Overview\n\nAIDocumentRAG 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.\n\n![Screenshot_01](./Assets/01.png)\n\n## Features\n\n### Document Management\n\n- **File Processing**: Automatic copying and metadata extraction from source directories\n- **Multiple Format Support**: PDF, Word documents (.docx, .doc), Excel files (.xlsx, .xls), text files (.txt), and more\n- **Metadata Tracking**: File size, creation date, modification date, character count, and file extension\n- **Search Functionality**: Real-time search across file names, types, sizes, and dates\n- **Multi-Select Mode**: Select and work with multiple documents simultaneously\n- **File Upload**: Direct file upload support with drag-and-drop interface\n- **File Operations**: Rename, delete, and retrieve file content\n- **File Status Tracking**: System initialization and file management status\n\n### AI Chat Interface\n\n- **Multi-Provider Support**: OpenAI GPT models and Ollama local models\n- **Document-Aware Conversations**: Chat about specific documents or multiple documents at once\n- **Conversation History**: Persistent chat history per document/document set with local storage\n- **Streaming Responses**: Real-time AI response streaming for better user experience\n- **Context-Aware Prompts**: Automatic document context injection into chat prompts\n- **Export Functionality**: Export chat conversations as JSON files\n- **Model Selection**: Choose between different AI models and providers\n\n### Document Summarization\n\n- **Single Document Summaries**: Generate summaries for individual documents\n- **Multi-Document Summaries**: Batch summary generation for multiple documents\n- **Caching System**: Intelligent caching of summaries to improve performance\n- **Summary State Management**: Track loading states and summary availability\n\n### Note Generation\n\n- **Single Document Notes**: Generate structured notes for individual documents\n- **Multi-Document Notes**: Create cross-document analysis and comparative notes\n- **Note Management**: Full CRUD operations for notes (create, read, update, delete)\n- **Note Search**: Search across all generated notes\n- **Note Categories and Tags**: Organize notes with categories and tagging system\n- **Cross-Document Context**: Analyze relationships between multiple documents\n\n### User Interface\n\n- **Fluent Design**: Modern UI following Microsoft Fluent Design principles\n- **Responsive Layout**: Grid-based layout that adapts to different screen sizes\n- **Real-time Updates**: Live document status and loading indicators\n- **Search Integration**: Integrated search with filtering and result highlighting\n- **Tabbed Interface**: Separate tabs for chat and note generation\n- **Drag and Drop**: Intuitive file upload with visual feedback\n\n## Architecture\n\n### Backend (ASP.NET Core)\n\n- **Controllers**:\n  - `FileManagementController`: Handles document operations (initialize, upload, list, retrieve, delete, rename)\n  - `AIChatController`: Manages AI chat interactions (regular and streaming) with multi-provider support\n  - `DocumentSummaryController`: Generates and retrieves document summaries\n  - `NoteGenerationController`: Manages note generation and CRUD operations\n- **Services**:\n  - `FileManagementService`: Core document processing and repository management\n  - `AIChatService`: Multi-provider AI integration with Semantic Kernel\n  - `DocumentSummaryService`: Document summarization with caching\n  - `NoteGenerationService`: Note generation and management\n- **Models**: Comprehensive request/response DTOs with API responses\n\n### Frontend (Angular)\n\n- **Components**:\n  - `DocumentsQuickViewComponent`: Sidebar for document browsing and selection\n  - `ChatViewComponent`: Main chat interface with conversation management and multi-provider support\n  - `NoteGenerationComponent`: Note generation interface with form controls\n  - `FileUploadComponent`: File upload with drag-and-drop support\n  - `LoadingDialogComponent`: System initialization and loading states\n- **Services**:\n  - `FileManagementService`: Backend API integration\n  - `DocumentSearchService`: Client-side search functionality\n  - `AIChatService`: Multi-provider AI chat API integration\n  - `DocumentSummaryService`: Summary management with caching\n  - `NoteGenerationService`: Note generation and management\n\n## API Endpoints\n\n### File Management\n\n- `GET /api/filemanagement/status` - System status and initialization state\n- `POST /api/filemanagement/initialize` - Initialize with source/destination paths\n- `POST /api/filemanagement/upload` - Upload individual files\n- `GET /api/filemanagement/files` - List all managed files\n- `GET /api/filemanagement/files/{fileName}` - Get specific file metadata\n- `GET /api/filemanagement/files/{fileName}/content` - Get file content\n- `DELETE /api/filemanagement/files/{fileName}` - Delete specific file\n- `POST /api/filemanagement/files/{fileName}/rename` - Rename files\n\n### AI Chat\n\n- `GET /api/aichat/ollama/models` - Get available Ollama models\n- `POST /api/aichat/chat` - Send chat message (synchronous)\n- `POST /api/aichat/chat/stream` - Send chat message (streaming response)\n\n### Document Summarization\n\n- `GET /api/documentsummary/{fileName}` - Get summary for specific document\n- `POST /api/documentsummary/multiple` - Get summaries for multiple documents\n\n### Note Generation\n\n- `POST /api/notegeneration/generate` - Generate note for single document\n- `POST /api/notegeneration/generate-multi` - Generate multi-document note\n- `GET /api/notegeneration/all` - Get all notes\n- `GET /api/notegeneration/{noteId}` - Get specific note by ID\n- `GET /api/notegeneration/document/{fileName}` - Get notes for specific document\n- `GET /api/notegeneration/documents/multiple` - Get notes for multiple documents\n- `GET /api/notegeneration/cross-document/{documentNames}` - Get cross-document notes\n- `GET /api/notegeneration/search` - Search notes by query\n- `PUT /api/notegeneration/{noteId}` - Update existing note\n- `DELETE /api/notegeneration/{noteId}` - Delete specific note\n- `DELETE /api/notegeneration/document/{fileName}` - Delete all notes for document\n\n## Technology Stack\n\n### Backend\n\n- **Framework**: ASP.NET Core (.NET 9.0)\n- **AI Integration**: Microsoft Semantic Kernel with OpenAI and Ollama support\n- **Architecture**: Clean architecture with SOLID principles\n- **Patterns**: Repository pattern, dependency injection, async/await\n- **Markdown Processing**: Markdig for content formatting\n\n### Frontend\n\n- **Framework**: Angular 19 with TypeScript\n- **UI Library**: Fluent UI Web Components\n- **State Management**: RxJS observables and local storage\n- **Styling**: CSS with Fluent Design variables and animations\n- **Icons**: FontAwesome for file type icons\n\n### Development Tools\n\n- **API Testing**: HTTP files for endpoint testing\n- **Configuration**: Environment-based settings\n- **CORS**: Configured for development origins\n- **Package Manager**: Yarn for dependency management\n\n## Project Structure\n\n```markdown\nAIDocumentRAG/\n├── AIDocumentRAG.Server/          # ASP.NET Core Web API\n│   ├── Controllers/               # API controllers (4 controllers)\n│   ├── Services/                  # Business logic services\n│   │   ├── ChatInference/        # AI chat and document summary\n│   │   ├── FileManagement/       # File operations and processing\n│   │   └── NoteGeneration/       # Note generation and management\n│   ├── Models/                    # DTOs and data models\n│   └── Program.cs                 # Application entry point\n├── aidocumentrag.client/          # Angular frontend\n│   ├── src/app/components/        # UI components (6 components)\n│   ├── src/app/services/          # Angular services (5 services)\n│   └── src/environments/          # Environment configuration\n└── Data/                          # Sample documentation files\n```\n\n## Configuration\n\n### Backend Configuration\n\n- **OpenAI API Key**: Set via `OPENAI_API_KEY` environment variable\n- **Ollama Integration**: Local Ollama server at `http://localhost:11434`\n- **File Management**: Configurable through `appsettings.json`\n  - Default source/destination paths\n  - Maximum file size limits\n  - Allowed file extensions\n- **CORS**: Development origins configured for ports 58585 and 4200\n- **Ports**: HTTPS on 7040, HTTP on 5002\n\n### Frontend Configuration\n\n- **API URL**: Configured in `environment.ts` for HTTPS port 7040\n- **Proxy Configuration**: Set up for development API calls\n- **Angular Version**: 19.2.0 with modern build tools\n\n## Key Components\n\n### FileManagementService\n\nHandles the core document processing workflow:\n\n- Directory copying and file processing\n- Metadata extraction and storage\n- File repository management with in-memory storage\n- File upload, deletion, and renaming operations\n\n### AIChatService\n\nManages multi-provider AI interactions:\n\n- OpenAI GPT-4o-mini integration\n- Ollama local model support\n- Streaming and non-streaming responses\n- Error handling and logging\n\n### DocumentSummaryService\n\nProvides intelligent document summarization:\n\n- Single and multi-document summary generation\n- Intelligent caching system\n- Performance optimization through state management\n\n### NoteGenerationService\n\nEnables comprehensive note management:\n\n- Single and multi-document note generation\n- Full CRUD operations for notes\n- Cross-document analysis capabilities\n- Search and filtering functionality\n\n### Search System\n\nProvides intelligent document discovery:\n\n- Real-time filtering across multiple criteria\n- File type keyword matching\n- Size and date range queries\n- Client-side search optimization\n\n### Chat System\n\nEnables document-focused conversations:\n\n- Single and multi-document chat modes\n- Conversation persistence per document set with local storage\n- Export functionality for chat history\n- Multi-provider AI model support\n- Context-aware prompt building\n\n## Missing Features (Not Yet Implemented)\n\n- **User Authentication**: No user management or authentication system\n- **Database Persistence**: All data is stored in-memory (lost on restart)\n- **File Versioning**: No version control for uploaded documents\n- **Collaborative Features**: No multi-user collaboration capabilities\n- **Advanced Analytics**: No usage statistics or document analytics\n- **WebSocket Support**: No real-time collaboration features\n- **File Encryption**: No encryption for sensitive documents\n- **Backup/Restore**: No automated backup system for conversations and notes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmontraydavis%2Faidocumentrag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmontraydavis%2Faidocumentrag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmontraydavis%2Faidocumentrag/lists"}