How pavan-ak1/hackrx-llm works
Project type and purpose
• From the file tree and README, this is a Python-based backend service (likely using FastAPI) named “HackRx-LLM.”
• It exposes HTTP endpoints under two domains: “documents” and “queries,” and implements Pydantic models, service logic, and routers.
• The purpose is to ingest and manage documents and to answer natural-language queries—presumably by calling out to an LLM or vector-store in the background.
File structure
• Top-level:
• README.md, requirements.txt, venv
• app/
• Under app/:
• main.py – entry point that creates and mounts the FastAPI app and routers
• routers/ – document_routes.py & query_routes.py define HTTP endpoints
• services/ – document_services.py & query_services.py contain business logic (e.g., store/retrieve docs, call LLM)
• models/ – document_models.py & query_models.py define request/response schemas (Pydantic)
• No explicit database folder or config—likely services talk to an external DB or vector store, and to an LLM API.
README for additional insights
• The README only gives the project name “HackRx-LLM.”
Elements
• Request flow from Client → API → Router → Service → External
• Response flow back
• API Layer (e.g., blue)
• Business Logic (e.g., green)
• Data/Models (e.g., orange)
• External Services (e.g., gray)
Detailed capture of essential elements
• That ‘document_models.py’ and ‘query_models.py’ are used by both routers and services for type validation.
• That ‘main.py’ wires everything together.
Putting it all together:
Client → FastAPI App → [Router → Service → External] → back to Client