# shopkeeper-agent

An e-commerce data-warehouse question-answering agent built as a teaching project for learning LangGraph, combining a metadata knowledge base, hybrid retrieval, and staged natural-language-to-SQL generation with execution and streaming results.

shopkeeper-agent answers natural-language questions about e-commerce warehouse data by first building a metadata knowledge base of tables, fields, metrics and field values, then retrieving relevant fields, metrics and value ranges through hybrid search before generating SQL. A vector database handles semantic retrieval of fields and metrics, Elasticsearch handles full-text retrieval of field values, and MySQL stores the complete, authoritative structured metadata.

A LangGraph workflow orchestrates the multi-stage process of retrieval, context assembly, SQL generation, validation, correction and execution, streaming the resulting analysis back to a React frontend over server-sent events. The backend is organized with FastAPI, LangGraph, a repository layer and a client manager, and the project is distributed with a matching free tutorial series and per-chapter git branches so a learner can follow the project's evolution step by step.

Website: https://didilili.github.io/ai-agents-from-zero/#/%E5%AE%9E%E6%88%98%E9%A1%B9%E7%9B%AE-%E7%94%B5%E5%95%86%E9%97%AE%E6%95%B0/0-%E5%89%8D%E8%A8%80
