How nachiket1904/sap-copilot works
SAP Copilot is an early-stage assistant intended to answer plain-English questions about SAP-style purchase orders and flag anomalies such as unusual amounts and delayed payments. The documented end-to-end workflow is CSV data → SQLite → text-to-SQL retrieval → an LLM-generated answer, with Groq or Gemini selectable as provider. In the sampled code, CSV loading and schema description are implemented, but text-to-SQL execution, answer orchestration, and a user-facing entry point are not; the workflow edges below reflect documented design where noted.
Main entry points: client.py Provider client · text_to_sql.py Text-to-SQL · loader.py CSV loader · mock_sap Mock SAP CSVs
Components 11
Enterprise data
- Mock SAP CSVs
data/mock_sap - CSV loader
src/data_layer/loader.py - SQLite database
Question retrieval
- Schema description
src/retrieval/text_to_sql.py - Text-to-SQL
src/retrieval/text_to_sql.py - Anomaly questions
src/retrieval
LLM providers
- Provider client
src/llm/client.py - Groq
- Gemini
- Natural-language answer
Other components
- Questioner
Connections 10
- Mock SAP CSVs → CSV loader: reads
- CSV loader → SQLite database: loads tables
- Schema description → SQLite database: inspects schema
- Questioner → Text-to-SQL: asks question
- Text-to-SQL → Schema description: uses schema
- Text-to-SQL → Provider client: requests answer
- Provider client → Groq: calls if selected
- Provider client → Gemini: calls if selected
- Provider client → Natural-language answer: returns text
- Questioner → Anomaly questions: asks about