How n-kishore1983/ai-hoa-support works
AI HOA Support ingests governing-document PDFs, extracts and chunks their text, indexes them for hybrid retrieval, and exposes search through an MCP tool for agents. At startup, the configured folder loader checks Redis for duplicate files, reads PDF pages, and delegates chunk storage; OCR detection and fallback handle image-based content. For questions, the support service searches the vector store and Lucerne, fuses matches, and prompts a chat model to produce a grounded response. README documents external stores and MCP capabilities; some integration wiring is configuration-driven and not shown in the excerpts.
Main entry points: HoaSupportService.java MCP support tool · HoaDocumentLoader.java PDF folder loader · AppConfig.java Service configuration · SemanticDocumentSplitter.java Semantic chunking
Components 17
Document ingestion
- PDF folder loader
src/main/java/com/learning/init/HoaDocumentLoader.java - Semantic chunking
src/main/java/com/learning/services/SemanticDocumentSplitter.java - OCR detection
src/main/java/com/learning/services/PdfOcrDetector.java - Document payload
src/main/java/com/learning/domain/HoaDocumentPayload.java
Hybrid retrieval
- MCP support tool
src/main/java/com/learning/services/HoaSupportService.java - Lucerne writer
src/main/java/com/learning/services/LucerneDocumentWriter.java - Lucerne search
src/main/java/com/learning/services/LucerneSearch.java
Application integration
- Spring Boot app
src/main/java/com/learning/AiHoaSupportApplication.java - Token usage advisor
src/main/java/com/learning/advisors/TokenUsageAdvisor.java - Service configuration
src/main/java/com/learning/AppConfig.java
Model services
- Embedding model
- Chat model
Other components
- Resident / agent
- HOA PDF folder
- Redis cache
- Chroma vector store
- Grounded answer
Connections 20
- Resident / agent → MCP support tool: calls MCP tool
README.md - MCP support tool → Grounded answer: returns excerpts / answer
README.md - HOA PDF folder → PDF folder loader: provides PDFs
src/main/java/com/learning/init/HoaDocumentLoader.java - Spring Boot app → PDF folder loader: initializes loader
src/main/java/com/learning/init/HoaDocumentLoader.java - PDF folder loader → Redis cache: checks checksum
src/main/java/com/learning/init/HoaDocumentLoader.java - PDF folder loader → MCP support tool: delegates chunk storage
src/main/java/com/learning/init/HoaDocumentLoader.java - PDF folder loader → OCR detection: checks image content
src/main/java/com/learning/init/HoaDocumentLoader.java - MCP support tool → OCR detection: checks OCR content
src/main/java/com/learning/services/HoaSupportService.java - MCP support tool → Semantic chunking: splits text
src/main/java/com/learning/services/HoaSupportService.java - Semantic chunking → Embedding model: embeds sentences
src/main/java/com/learning/services/SemanticDocumentSplitter.java - MCP support tool → Chroma vector store: adds chunks / searches
README.md - MCP support tool → Lucerne writer: writes chunks
src/main/java/com/learning/services/HoaSupportService.java - MCP support tool → Lucerne search: searches BM25
src/main/java/com/learning/services/HoaSupportService.java - MCP support tool → Redis cache: records checksum
src/main/java/com/learning/services/HoaSupportService.java - MCP support tool → Chat model: prompts model
src/main/java/com/learning/services/HoaSupportService.java - MCP support tool → Token usage advisor: configures advisor
src/main/java/com/learning/services/HoaSupportService.java - Service configuration → Lucerne writer: creates writer
src/main/java/com/learning/AppConfig.java - Service configuration → Lucerne search: creates searcher
src/main/java/com/learning/AppConfig.java - Service configuration → Embedding model: configures provider
src/main/java/com/learning/AppConfig.java - Service configuration → Chat model: configures provider
src/main/java/com/learning/AppConfig.java