Skip to content

claudeomosa/DocumentSummarizer

Repository files navigation

Document Summarizer

A Blazor Server application that provides AI-powered document summarization with support for multiple AI providers (OpenAI, Azure OpenAI, Claude).

Current Status

Implemented Features

  1. Core Architecture

    • Clean service-based architecture with dependency injection
    • Abstraction layer for AI providers (IAISummarizationService)
    • Document processing orchestrator for multiple file formats
    • Settings persistence service
  2. AI Provider Support

    • OpenAI (GPT-4, GPT-3.5-turbo, etc.)
    • Azure OpenAI Service
    • Anthropic Claude (Claude 3 models)
    • Google Gemini (infrastructure ready)
  3. Document Processing

    • PDF documents (via iText7)
    • Word documents/DOCX (via DocumentFormat.OpenXml)
    • Text files (.txt, .md, .log)
  4. User Interface

    • Main document upload and summarization page
    • Settings page for AI provider configuration
    • Document type selection (10 types including contracts, proposals, RFPs, etc.)
    • Custom instruction support
    • Real-time processing status
    • Summary results display with metadata
  5. Document Types Supported

    • General documents
    • Technical proposals
    • Contracts
    • Request for Proposals (RFPs)
    • Tenders
    • Compliance documents
    • Financial reports
    • Technical specifications
    • Meeting minutes
    • Research papers

Quick Start

Prerequisites

  • .NET 9.0 SDK
  • API key for at least one AI provider (OpenAI, Azure OpenAI, or Claude)

Running the Application

  1. Navigate to the project directory:

    cd /Users/claude-cognativ/Projects/DocumentSummarizer
  2. Run the application:

    dotnet run
  3. Open your browser to the URL displayed (typically https://localhost:5001 or http://localhost:5000)

  4. Configure an AI provider:

    • Click on "Settings" in the navigation menu
    • Add your AI provider credentials (API key, model name, etc.)
    • Test the connection to verify settings
    • Set as default provider
  5. Summarize a document:

    • Return to the home page
    • Select a document file (PDF, DOCX, or TXT)
    • Choose the appropriate document type
    • Optionally add custom instructions
    • Click "Generate Summary"

Test Document

A sample contract is included in:

/Users/claude-cognativ/Projects/DocumentSummarizer/TestDocuments/sample-contract.txt

Configuration

OpenAI Setup

Azure OpenAI Setup

  • Endpoint: Your Azure OpenAI resource endpoint (e.g., https://your-resource.openai.azure.com/)
  • API Key: From Azure Portal
  • Model: Your deployment name (not the model name)
  • Same temperature and token recommendations

Claude Setup

  • API Key: Get from https://console.anthropic.com/
  • Model: claude-3-opus-20240229, claude-3-sonnet-20240229, claude-3-haiku-20240307
  • Same temperature and token recommendations

Project Structure

DocumentSummarizer/
├── Components/
│   ├── Pages/
│   │   ├── Home.razor              # Main document upload/summarization page
│   │   ├── Settings.razor          # AI provider configuration
│   │   └── Error.razor
│   ├── Layout/
│   │   ├── MainLayout.razor
│   │   └── NavMenu.razor
│   └── App.razor
├── Models/
│   ├── AIProvider.cs               # Enum of supported providers
│   ├── AIProviderSettings.cs      # Provider configuration model
│   ├── AppSettings.cs             # Application settings model
│   ├── DocumentType.cs            # Enum of document types
│   ├── SummarizationRequest.cs    # Request model
│   └── SummarizationResult.cs     # Result model
├── Services/
│   ├── IAISummarizationService.cs         # AI service interface
│   ├── OpenAISummarizationService.cs      # OpenAI implementation
│   ├── AzureOpenAISummarizationService.cs # Azure OpenAI implementation
│   ├── ClaudeSummarizationService.cs      # Claude implementation
│   ├── AISummarizationServiceFactory.cs   # Service factory
│   ├── IDocumentProcessingService.cs      # Document processor interface
│   ├── PdfDocumentProcessor.cs            # PDF processing
│   ├── WordDocumentProcessor.cs           # DOCX processing
│   ├── TextDocumentProcessor.cs           # Text file processing
│   ├── DocumentProcessingOrchestrator.cs  # Processing coordinator
│   └── SettingsService.cs                 # Settings persistence
├── TestDocuments/
│   └── sample-contract.txt
├── Program.cs                      # Application entry point with DI setup
├── appsettings.json               # Application configuration
└── DocumentSummarizer.csproj      # Project file

Settings storage: /Users/claude-cognativ/Projects/DocumentSummarizer/AppData/appsettings.user.json

What Works

  • Document upload (PDF, DOCX, TXT)
  • Text extraction from all supported formats
  • AI-powered summarization with provider selection
  • Document type-aware prompts (10 types)
  • Custom instruction support
  • API key configuration and testing
  • Settings persistence
  • Multiple provider support
  • Real-time processing feedback
  • Error handling and user feedback

What Still Needs Work (Future Enhancements)

  1. Production Readiness

    • Add comprehensive error handling edge cases
    • Implement proper logging throughout
    • Add unit and integration tests
    • Security hardening (API key encryption at rest)
    • Rate limiting and request throttling
  2. UI/UX Polish

    • Improve styling and visual design
    • Add drag-and-drop file upload
    • Better mobile responsiveness
    • Copy-to-clipboard for summaries
    • Download summary as file
  3. Advanced Features

    • Document history and saved summaries
    • Batch processing of multiple documents
    • Comparison between different AI provider results
    • Cost tracking and usage analytics
    • Support for larger documents (chunking strategy)
    • OCR for image-based PDFs
    • Additional file formats (PPT, Excel, etc.)
  4. Enterprise Features

    • User authentication and authorization
    • Multi-tenant support
    • Database persistence (replace file-based settings)
    • API endpoint for programmatic access
    • Audit logging
    • Admin dashboard

Known Limitations

  • Maximum file size: 10 MB (configurable in settings)
  • Image-based PDFs not supported (no OCR)
  • Very large documents may exceed token limits
  • No batch processing capability yet
  • Settings stored in plain JSON file (not production-ready for API keys)

Build Information

  • Framework: .NET 9.0
  • Render Mode: Blazor Server (Interactive Server)
  • Build Status: Successfully compiles with 0 warnings

Dependencies

  • iText7 (8.0.5) - PDF processing
  • DocumentFormat.OpenXml (3.1.0) - Word document processing
  • Newtonsoft.Json (13.0.3) - JSON serialization
  • ASP.NET Core 9.0 - Web framework

About

A Blazor Server application that provides AI-powered document summarization with support for multiple AI providers (OpenAI, Azure OpenAI, Claude).

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages