How mohamed-dahy/querymind works
QueryMind is an AI data analyst for company databases. A user asks in the web canvas or HTTP API; the API invokes the agent, which selects relevant schema context, generates and validates SQL, runs it read-only, checks and summarizes the result, and retains conversation context for follow-ups. Distinct supporting capabilities include semantic definitions and example-query retrieval, workspace database and LLM-key management, authentication and audit, and the explorer and evaluation lab. Relationships below follow the README and shown source references; unsampled subsystems are included where documented, without asserting unverified internal calls.
Main entry points: routes.py HTTP API · pipeline.py Agent pipeline · retrieval.py Schema retrieval · executor.py Read-only execution
Components 21
User experience
- Question canvas
web/src/canvas/CanvasProvider.tsx - Data explorer UI
web/src/explorer/GlossaryPage.tsx - Evaluation lab UI
web/src/evals/EvalsFrame.tsx
API and workspace
- HTTP API
src/querymind/api/routes.py - Login and identity
src/querymind/auth/tokens.py - Workspace settings
src/querymind/api/connections.py - Audit trail
src/querymind/store/audit.py - Conversation history
src/querymind/store/conversations.py - Evaluation service
src/querymind/api/evals.py
Question answering
- Agent pipeline
src/querymind/agent/pipeline.py - Schema context
src/querymind/db/schema.py - Business definitions
src/querymind/semantic/dictionary.py - Schema retrieval
src/querymind/semantic/retrieval.py - LLM providers
src/querymind/llm/factory.py - Answer and confidence
src/querymind/agent/schemas.py
Data and safeguards
- SQL validation
src/querymind/safety/sql_validator.py - Row permissions
src/querymind/safety/row_scope.py - Read-only execution
src/querymind/db/executor.py - Company database
- Search index
src/querymind/semantic/index.py
Other components
- Analyst
Connections 23
- Analyst → Question canvas: asks
README.md - Question canvas → HTTP API: sends question
README.md - HTTP API → Agent pipeline: invokes
src/querymind/api/routes.py - HTTP API → Login and identity: authenticates
src/querymind/api/routes.py - HTTP API → Conversation history: loads and saves
src/querymind/api/routes.py - HTTP API → Audit trail: records activity
src/querymind/api/routes.py - HTTP API → Workspace settings: serves settings
src/querymind/api/main.py - HTTP API → Evaluation service: serves evaluations
src/querymind/api/main.py - Agent pipeline → Schema context: loads schema
src/querymind/agent/pipeline.py - Agent pipeline → Schema retrieval: selects tables
src/querymind/agent/pipeline.py - Agent pipeline → Business definitions: uses definitions
src/querymind/agent/pipeline.py - Agent pipeline → LLM providers: generates SQL
README.md - Agent pipeline → SQL validation: validates SQL
README.md - Agent pipeline → Read-only execution: runs query
src/querymind/agent/pipeline.py - Read-only execution → Company database: reads
- Read-only execution → Row permissions: applies scope
- Agent pipeline → Answer and confidence: returns result
src/querymind/agent/pipeline.py - Schema retrieval → Search index: searches
src/querymind/semantic/retrieval.py - Schema retrieval → LLM providers: embeds query
src/querymind/semantic/retrieval.py - Analyst → Data explorer UI: explores data
README.md - Analyst → Evaluation lab UI: reviews scores
README.md - Data explorer UI → HTTP API: requests data
- Evaluation lab UI → HTTP API: requests evaluations