How amoghk04/genhat works
Project type and purpose
• GenHat is a full-stack document intelligence platform.
• Frontend: Electron + TypeScript app providing a PDF viewer, interactive chat UI, file management.
• Backend: Python FastAPI service for PDF parsing, hybrid retrieval (BM25 + embeddings), AI analysis (Google Gemini), and text-to-speech (Azure).
File structure
• Top-level:
• Backend/ – FastAPI project (app.py, server.py, pdf_extractor.py, prompt_cache.py, temp_manager.py, requirements.txt) and a src/ folder divided into extract/, retrieval/, output/, utils/, plus a run_pipeline.py.
• Frontend/ – Electron app (index.html, main.js, package.json, src/api.ts, pdfViewer.ts, renderer.ts), plus integration/testing docs.
• setup.sh, run.sh – orchestration scripts.
• Patterns:
• Clear separation of concerns in Backend (extraction, retrieval, formatting).
• REST API boundary between Frontend and Backend.
• Pipeline runner module (run_pipeline.py).
• File-based caching and vector store under src/retrieval.
README for additional insights
• Confirms architecture: Frontend↔Backend over HTTP.
• Backend modules: PDF Parser → Content Chunker → Heading Extractor → Hybrid Retriever → Formatter → Gemini API/Azure Speech.
• Data persistence: local file cache, vector database for embeddings.
• External dependencies: Gemini API, Azure Speech.