Led an LLM service that analyzes supply chain management (SCM) data and supports planners' daily work with Text-to-SQL and agents.
01Context
- Samsung Electronics' supply chain management (SCM) organization wanted planners to query SCM data and get work guidance directly, in natural language.
02Problem
- Even routine data questions required SQL and schema knowledge, so planners had to route them through specialists.
- Operational know-how was scattered across documents and individual experience.
- External market information such as news, financial indices, and logistics data was collected by hand, which slowed root-cause analysis.
03My role
- Led the project end to end in a team of seven, owning the service architecture, the agent roles and their coordination, and the workflow design.
- Built the data-query agent pipeline and the sLLM fine-tuning dataset and training scripts hands-on; set up the development and production environments and the CI/CD branch strategy.
04Approach
- Agreed on 95% SQL generation accuracy on an evaluation set as the success criterion at kickoff.
- Designed an orchestrator (query rewrite, routing, response layout) that coordinates three agents through A2A — data query and analysis, work support (AI Advisor), and external information.
- Built the data-query pipeline as view identification, entity extraction, code mapping, and a pseudo query that a BI engine turns into the final query.
- Fine-tuned a Qwen 8B sLLM for entity extraction and Text-to-SQL after a prompted general-purpose LLM kept confusing entity codes, and split training and inference servers.
Key decisions
| Decision | Why | Trade-off |
|---|
| Pseudo query instead of direct SQL | A BI engine converts a structured pseudo query into SQL, so generated queries never hit the production database directly and can be validated before execution. | Query coverage is limited to what the BI engine can express. |
| Separate models for SQL and generation | A fine-tunable Qwen 8B sLLM handles Text-to-SQL for accuracy and cost, while Llama 3.1 70B writes the answers. | Two models to serve and operate. |
| Automated dev deployment, gated production release | CI/CD deploys to development automatically, while production changes go through a reviewed pull request, keeping development fast and production stable. | Longer lead time for production releases. |
05Architecture
| Layer | Components | Flows |
|---|
| 01 Users | | →to 02 Orchestrator |
| 02 Orchestrator | - Query rewrite
- Router
- Response layout
| →to 03 Agents · A2A |
| 03 Agents | - Data query: view identification, entity extraction, code mapping, pseudo query
- Work support (AI Advisor): retrieval, reranking, generation
- External information: retrieval and post-processing
| →to 04 Models→to 05 Data |
| 04 Models | - Qwen 8B sLLM (fine-tuned) for Text-to-SQL
- Llama 3.1 70B for generation
- vLLM serving
| |
| 05 Data | - BI engine and SCM database
- Vector DB of work guides
- External market data
| |
06Outcome
- Achieved 95%+ SQL generation accuracy on the evaluation set.
- Replaced request-and-wait data lookups with instant natural-language queries and charts.
- Won the phase-2 contract to extend the service with direct system integration and real-time external data.