How raghupatik/leasedocumentintelligence works
Lease Document Intelligence is an API-backed lease abstraction application. Its main flow accepts lease PDFs, stores documents and metadata, extracts cited fields with confidence scores, and sends low-confidence results to human review. The README also describes field-definition management, search, audit/versioning, amendment awareness, and batch ingestion. The sampled controllers and services support the upload and review links; search and parts of extraction wiring are represented from documented capabilities and repository paths, so uncertain call edges are omitted.
Main entry points: LeaseController.cs Lease API · CosmosDocumentMetadataRepository.cs Metadata repository · AzureAISearchService.cs Vector search · ReviewQueueService.cs Review queue service
Components 25
Document intake
- Document validation
LeaseDocumentIntelligence.Infrastructure/Services/DocumentProcessingService.cs - Blob storage service
LeaseDocumentIntelligence.Infrastructure/Services/BlobStorageService.cs - Azure Blob Storage
AI abstraction
- Document processing
LeaseDocumentIntelligence.Infrastructure/Services/DocumentProcessingService.cs - Field extraction
LeaseDocumentIntelligence.Infrastructure/Services/ExtractionService.cs - Foundry AI
LeaseDocumentIntelligence.Infrastructure/Services/FoundryAIService.cs - Vector search
LeaseDocumentIntelligence.Infrastructure/Services/AzureAISearchService.cs - Embedding service
LeaseDocumentIntelligence.Infrastructure/Services/EmbeddingService.cs
Quality review
- Review queue service
LeaseDocumentIntelligence.Infrastructure/Services/ReviewQueueService.cs
Lease data
- Metadata repository
LeaseDocumentIntelligence.Infrastructure/Data/CosmosDocumentMetadataRepository.cs - Cosmos DB metadata
- Field definitions repository
LeaseDocumentIntelligence.Infrastructure/Data/CosmosFieldDefinitionRepository.cs - Field definition store
- Lease document repository
LeaseDocumentIntelligence.Infrastructure/Data/LeaseDocumentRepository.cs - Lease document state
- Azure AI Search
API and configuration
- Lease API
LeaseDocumentIntelligence.API/Controllers/LeaseController.cs - Field definitions API
LeaseDocumentIntelligence.API/Controllers/FieldDefinitionsController.cs - Review API
LeaseDocumentIntelligence.API/Controllers/ReviewController.cs - Search API
LeaseDocumentIntelligence.API/Controllers/SearchController.cs - Application startup
LeaseDocumentIntelligence/Program.cs - Service registration
LeaseDocumentIntelligence.Infrastructure/DependencyInjection/ServiceCollectionExtensions.cs
Other components
- Lease analyst
- Human reviewer
- Azure OpenAI
Connections 22
- Lease analyst → Lease API: uploads lease
- Lease API → Document validation: validates file
- Lease API → Blob storage service: uploads document
- Blob storage service → Azure Blob Storage: writes blob
- Lease API → Metadata repository: creates metadata
- Metadata repository → Cosmos DB metadata: writes metadata
- Lease API → Document processing: processes document
- Lease API → Metadata repository: updates extraction
- Field definitions API → Field definitions repository: manages definitions
- Field definitions repository → Field definition store: reads and writes
- Document processing → Field extraction: extracts fields
- Field extraction → Foundry AI: requests extraction
- Human reviewer → Review API: reviews fields
- Review API → Review queue service: dispatches review
- Review queue service → Metadata repository: reads review status
- Review queue service → Lease document repository: updates document
- Lease document repository → Lease document state: reads and writes
- Search API → Vector search: searches leases
- Vector search → Embedding service: requests vectors
- Embedding service → Azure OpenAI: generates embeddings
- Vector search → Azure AI Search: queries index
- Application startup → Service registration: registers services