How dishitaghuge01/archintel works
Purpose and Top-Level Entry Points
The repository contains two independent analytical tracks:
• Construction-cost experimentation via a linear-regression notebook and CSV dataset: cost_prediction_model/linear_regression.ipynb, cost_prediction_model/dataset1.csv.
• A floorplan design-quality service that analyzes SVG plans, calculates a Design Quality Index (DQI), recommends improvements, and supports AI Q&A: quality_check_model/app.py, quality_check_model/pipeline.py.
The operational entry points are the FastAPI application and CLI pipeline; notebooks are the training/exploration path.
API and Session Boundary
The backend web boundary is FastAPI, initialized in quality_check_model/app.py with endpoint routing in quality_check_model/api/routes.py. Request/response contracts are separated into quality_check_model/schemas/requests.py and quality_check_model/schemas/responses.py.
Configuration, logging, and request/session lifecycle concerns are centralized under quality_check_model/core/config.py, quality_check_model/core/logging.py, and quality_check_model/core/session.py. This is the boundary for environment-backed settings, including the Groq credential.
Floorplan Analysis Orchestration
quality_check_model/pipeline.py is the primary control-flow coordinator. It transforms an SVG input into analysis results through parsing, geometry extraction, room-connectivity analysis, feature scoring, DQI calculation, and suggestions.
The pipeline delegates SVG interpretation to quality_check_model/svg_parser.py; downstream geometry and graph operations are encapsulated in quality_check_model/utils/geometry_utils.py and quality_check_model/utils/graph_utils.py. Parsed room polygons and metadata form the core intermediate domain model.
Feature and Spatial Analysis
Geometric, aggregate, and graph-derived measures are computed through quality_check_model/utils/feature_utils.py and quality_check_model/spatial_syntax_features.py. The spatial layer treats rooms as an adjacency graph and derives connectivity, depth, and integration metrics.
Persisted/reference feature datasets are partitioned by concern:
quality_check_model/features/geometry_features.csv,
quality_check_model/features/spatial_syntax_features.csv, and
quality_check_model/features/functional_zoning_features.csv.
These support notebook-driven dataset development as well as the runtime scoring concepts.
DQI Scoring and Recommendations
quality_check_model/dqi_calculation.py combines efficiency, zoning, lighting/ventilation, proportions, and circulation into the 0–10 DQI and quality classification. This is the deterministic scoring boundary between raw features and user-facing quality results.
quality_check_model/suggestion_engine.py converts weak feature/DQI dimensions into actionable recommendations. It consumes analysis/scoring outputs rather than parsing or graph implementation details.
AI Insight Integration
The optional conversational path is implemented by quality_check_model/floorplan_ai_assistant.py, with domain context assembled in quality_check_model/context_builder.py. It calls the external Groq LLM service and requires environment-provided API configuration, represented locally by quality_check_model/.env.local.
This path should remain downstream of deterministic analysis: floorplan results and context are supplied to the LLM, while the LLM provides explanatory or interactive insights rather than being the source of DQI truth.
Frontend and Delivery Runtime
A separate Vite/React TypeScript frontend is rooted at quality_check_model/frontend/src/main.tsx and composed from quality_check_model/frontend/src/App.tsx. Upload, analysis presentation, and chat are distinct UI stages in quality_check_model/frontend/src/components/UploadScreen.tsx, quality_check_model/frontend/src/components/AnalysisView.tsx, and quality_check_model/frontend/src/components/ChatPanel.tsx.
The frontend API boundary is concentrated in quality_check_model/frontend/src/lib/api.ts and quality_check_model/frontend/src/hooks/use-api.ts. It submits plans/questions to the FastAPI service and renders DQI, insights, and conversational responses without embedding analysis logic.
Main entry points: routes.py API routes · dqi_calculation.py DQI calculation · context_builder.py Floorplan context builder · floorplan_ai_assistant.py AI assistant
Components 21
Cost Experimentation
- Regression notebook · Training and exploration path.
cost_prediction_model/linear_regression.ipynb - Construction cost data
cost_prediction_model/dataset1.csv
Floorplan Backend
- FastAPI app
quality_check_model/app.py - API routes
quality_check_model/api/routes.py - Request / response schemas
quality_check_model/schemas/requests.py - Analysis pipeline · Coordinates deterministic SVG-to-DQI analysis.
quality_check_model/pipeline.py - SVG parser
quality_check_model/svg_parser.py - Room polygons & metadata · Core parsed floorplan representation.
- Geometry & adjacency utilities
quality_check_model/utils/geometry_utils.py - Feature analysis
quality_check_model/utils/feature_utils.py - Spatial syntax analysis · Derives connectivity, depth, and integration.
quality_check_model/spatial_syntax_features.py - DQI calculation · Produces 0–10 score and quality classification.
quality_check_model/dqi_calculation.py - Suggestion engine
quality_check_model/suggestion_engine.py - Reference feature datasets · Geometry, spatial-syntax, and zoning feature references.
quality_check_model/features/geometry_features.csv - Settings & session lifecycle · Environment-backed configuration includes Groq credentials.
quality_check_model/core/config.py
AI Insights
- Floorplan context builder
quality_check_model/context_builder.py - AI assistant · Uses Groq only for explanatory and conversational insights.
quality_check_model/floorplan_ai_assistant.py - Groq LLM service
React Frontend
- React application
quality_check_model/frontend/src/App.tsx - Upload, analysis & chat UI
quality_check_model/frontend/src/components/AnalysisView.tsx - Frontend API client
quality_check_model/frontend/src/lib/api.ts
Connections 24
- Construction cost data → Regression notebook: explored by
- React application → Upload, analysis & chat UI: renders
- Upload, analysis & chat UI → Frontend API client: submits plans and questions
- Frontend API client → FastAPI app: HTTP API
- FastAPI app → API routes: hosts
- API routes → Request / response schemas: validates with
- API routes → Analysis pipeline: runs analysis
- API routes → AI assistant: handles Q&A
- Settings & session lifecycle → FastAPI app: configures
- Settings & session lifecycle → AI assistant: supplies credentials
- Analysis pipeline → SVG parser: parses SVG
- SVG parser → Room polygons & metadata: produces
- Room polygons & metadata → Geometry & adjacency utilities: spatial input
- Geometry & adjacency utilities → Feature analysis: geometry measures
- Geometry & adjacency utilities → Spatial syntax analysis: room adjacency
- Feature analysis → DQI calculation: feature measures
- Spatial syntax analysis → DQI calculation: connectivity metrics
- DQI calculation → Suggestion engine: weak dimensions
- Reference feature datasets → Feature analysis: reference concepts
- Analysis pipeline → Floorplan context builder: analysis results
- DQI calculation → Floorplan context builder: DQI result
- Suggestion engine → Floorplan context builder: recommendations
- Floorplan context builder → AI assistant: domain context
- AI assistant → Groq LLM service: LLM request