How surjithk73/hpe_49 works
QueryCraft turns analyst questions into validated SQL, executes them against a selected HPE NonStop database, and presents results with charts and downloadable reports. The README documents a planner/metric-verification clarification stage before SQL generation; the backend entry point owns the broader request pipeline. The graph also includes database/cache management and audit capabilities. Some subsystem wiring is based on the README because the relevant source excerpts were not provided.
Main entry points: main.py REST API · Dashboard.tsx Query dashboard · api.ts API client · QueryInput.tsx Query input
Components 25
Analyst experience
- Query dashboard
frontend/src/pages/Dashboard.tsx - Query input
frontend/src/components/QueryInput.tsx - Results and charts
frontend/src/components/ResultsTable.tsx - SQL preview
frontend/src/components/SQLPreview.tsx - Report download
frontend/src/components/ReportDownload.tsx - Database manager
frontend/src/pages/DatabaseManager.tsx - Cache management
frontend/src/pages/CacheManagement.tsx
API orchestration
- API client
frontend/src/lib/api.ts - REST API
backend/main.py
Query pipeline
- Query normalizer
backend/pipeline/normalizer.py - Intent planner
backend/pipeline/planner.py - Intent verifier
backend/pipeline/intent_spec.py - Schema linker
backend/pipeline/schema_linker.py - Schema loader
backend/pipeline/schema_loader.py - Example retrieval
backend/pipeline/few_shot_retriever.py - Instruction builder
backend/pipeline/prompt_builder.py - SQL generator
backend/pipeline/sql_generator.py - SQL validator
backend/pipeline/validator.py - Query executor
backend/pipeline/executor.py - Report generator
backend/pipeline/report_generator.py
Data and operations
- Query cache
backend/pipeline/cache.py - Audit log
backend/audit/query_log.py
Other components
- Analyst
- PostgreSQL
- LLM providers
Connections 29
- Analyst → Query dashboard: uses
- Query dashboard → Query input: accepts query
- Query input → API client: submits query
- API client → REST API: HTTP request
- REST API → Query normalizer: normalizes
- REST API → Intent planner: plans intent
- Intent planner → LLM providers: requests plan
- REST API → Intent verifier: checks completeness
- REST API → Schema linker: links schema
- Schema linker → Schema loader: reads schema
- REST API → Example retrieval: retrieves examples
- REST API → Instruction builder: builds instructions
- REST API → SQL generator: generates SQL
- SQL generator → LLM providers: requests SQL
- REST API → SQL validator: validates SQL
- REST API → Query executor: executes SQL
- Query executor → PostgreSQL: queries
- REST API → Query cache: checks and stores
- REST API → Audit log: logs query
- REST API → Report generator: generates export
- REST API → Query dashboard: returns results
- Query dashboard → Results and charts: shows rows
- Query dashboard → SQL preview: shows SQL
- Query dashboard → Report download: offers export
- Analyst → Database manager: manages databases
- Database manager → API client: calls database API
- Analyst → Cache management: manages cache
- Cache management → API client: calls cache API
- REST API → PostgreSQL: manages selected data