How hrittikaaa/muktoain-sd works
MuktoAin is a bilingual Bangladesh legal-aid platform. Citizens submit a legal problem; the platform retrieves relevant statute sections, generates a cited explanation or document draft, and routes drafts through mandatory verified-lawyer review before PDF download. The map also includes search, payments, notifications, and administrative oversight. README documents the overall retrieval and product flows; sampled source confirms orchestration, vector and keyword retrieval, review behavior, PDF export, and selected web wiring, but not every controller-to-service call.
Main entry points: AppDbContext.cs SQL Server · AiOrchestrationService.cs AI orchestration · SimilaritySearchService.cs Vector retrieval · CaseService.cs Case management
Components 26
Citizen legal aid
- Case endpoints
src/MuktoAin.Web/Controllers/CaseController.cs - Case management
src/MuktoAin.Application/Services/CaseService.cs - AI orchestration
src/MuktoAin.Application/Services/AiOrchestrationService.cs - Prompt assembly
src/MuktoAin.Application/Services/PromptAssembler.cs
Legal retrieval
- RAG context
src/MuktoAin.Application/Services/RagContextBuilder.cs - Vector retrieval
src/MuktoAin.Infrastructure/VectorStore/SimilaritySearchService.cs - Keyword retrieval
src/MuktoAin.Infrastructure/Search/KeywordSearchService.cs - Gemini embeddings
src/MuktoAin.Infrastructure/Ai/GeminiEmbeddingService.cs - Qdrant store
src/MuktoAin.Infrastructure/VectorStore/QdrantVectorStore.cs - Search endpoints
src/MuktoAin.Web/Controllers/SearchController.cs
Lawyer workflow
- Lawyer endpoints
src/MuktoAin.Web/Controllers/LawyerController.cs - Draft review
src/MuktoAin.Application/Services/LawyerReviewService.cs - Document service
src/MuktoAin.Application/Services/DocumentService.cs - Document templates
src/MuktoAin.Application/Documents/DocumentGenerator.cs - PDF export
src/MuktoAin.Infrastructure/Documents/PdfExportService.cs
Platform services
- SQL Server
src/MuktoAin.Infrastructure/Data/AppDbContext.cs - Gemini generation
src/MuktoAin.Infrastructure/Ai/GeminiClient.cs - Payment endpoints
src/MuktoAin.Web/Controllers/PaymentController.cs - Payment handling
src/MuktoAin.Application/Services/PaymentService.cs - Payment gateways
src/MuktoAin.Infrastructure/Payments/PaymentGatewayResolver.cs - Notifications
src/MuktoAin.Application/Services/NotificationService.cs
Administration
- Admin endpoints
src/MuktoAin.Web/Controllers/AdminController.cs - Admin analytics
src/MuktoAin.Application/Services/AdminAnalyticsService.cs - Acts management
src/MuktoAin.Application/Services/ActsManagementService.cs
Other components
- Citizens
- Verified lawyers
Connections 30
- Citizens → Case endpoints: describe problem
- Case endpoints → Case management: submit case
- Case management → AI orchestration: request explanation
- AI orchestration → RAG context: retrieve context
- RAG context → Vector retrieval: primary search
- RAG context → Keyword retrieval: fallback search
- Vector retrieval → Gemini embeddings: embed query
- Vector retrieval → Qdrant store: search vectors
- Vector retrieval → SQL Server: load sections
- Keyword retrieval → SQL Server: full-text search
- AI orchestration → Prompt assembly: assemble prompt
- AI orchestration → Gemini generation: generate answer
- AI orchestration → SQL Server: save references
- Search endpoints → SQL Server: search Acts
- Citizens → Lawyer endpoints: track case
- Verified lawyers → Lawyer endpoints: review drafts
- Lawyer endpoints → Draft review: claim and decide
- Draft review → SQL Server: persist review
- Draft review → Case management: transition status
- Case management → Document service: manage drafts
- Document service → Document templates: generate draft
- Citizens → PDF export: download approved
- Document service → PDF export: export finalized
- Payment endpoints → Payment handling: process payment
- Payment handling → Payment gateways: resolve gateway
- Payment gateways → SQL Server: record order
- Payment handling → Notifications: notify parties
- Admin endpoints → Admin analytics: view analytics
- Admin endpoints → Acts management: manage corpus
- Admin endpoints → SQL Server: admin data