How shakil1819/interactive-estimation-system-using-llm-based-rag-approach works
Project Type and Purpose
• This is a full-stack prototype “Interactive Estimation System” that guides a user through a conversational flow to gather service information (e.g., roofing) and returns a structured cost estimate.
• The backend is a FastAPI service leveraging Langgraph/Langchain and OpenAI for conversation management and information extraction. The frontend is a Streamlit app for real-time user interaction.
File Structure
• Top-level:
– Dockerfile, docker-compose.yml, run scripts (run.py, run.sh, run.ps1) for containerized or local startup.
– setup.py, setup.cfg for packaging.
– ARCHITECTURE.md, INSTALL.md, USER_GUIDE.md for documentation.
– config.json and .env.example for estimation parameters and API keys.
• backend/app:
– main.py defines FastAPI endpoints.
– graph.py defines the conversational graph via Langgraph.
– estimator.py encapsulates estimation logic.
– models.py defines Pydantic schemas.
– llm_service.py wraps calls to the OpenAI API.
– utils.py contains helpers for question templates and session management.
• frontend:
– app.py is the Streamlit UI.
– image folder holds static assets.
• backend/tests and pytest.ini: test suite with unit tests for each module.
README for Additional Insights
• The system uses an in-memory dictionary per session (no persistent DB yet).
• Real-time feedback through Streamlit–FastAPI communication.
• Dynamic questioning via Langgraph, with state transitions.
• Configurable estimation logic driven by config.json.
Final Advice
• Be exhaustive: capture every module that plays a role in request handling, conversation management, and estimation.
• Both synchronous flows (HTTP calls) and asynchronous/long-running interactions (LLM calls).
• Keep it modular so new services (e.g., persistent storage, computer vision) can be slotted in easily.