didilili/shopkeeper-agent
📊 电商数仓智能问数 AI Agent,最适合用于系统学习 LangGraph 的实战项目:基于 LangGraph、FastAPI、Qdrant、Elasticsearch、MySQL 与 React,完整实现元数据知识库、混合检索、自然语言生成 NL2SQL 生成校验、SQL 执行与流式查询展示。前后端完整代码全栈可跑,Docker 环境一键部署,配套 ai-agents-from-zero 免费教程与章节代码分支。适合系统学习大模型应用、数据分析 Agent 和企业级 AI 工程落地。
What it solves
This project addresses the common challenges in business data analysis where users need to query databases using natural language but lack SQL expertise. It solves the issues of "hallucinations" and incorrect data retrieval (such as selecting the wrong tables or fields) by implementing a structured, multi-stage reasoning pipeline rather than relying on a simple, direct LLM-to-SQL prompt.
How it works
The system uses a sophisticated agentic workflow built with LangGraph. It first constructs a metadata knowledge base by indexing table schemas, metrics, and field values across MySQL, Qdrant (for semantic vector search), and Elasticsearch (for keyword-based value search). When a user asks a question, the agent performs a multi-path retrieval to gather relevant context, generates and validates SQL, executes the query, and streams the results back to a React frontend.
Who it’s for
It is designed for developers who want to learn how to build production-grade AI agents. It is particularly useful for those looking to master LangGraph, integrate multiple data stores (MySQL, Qdrant, Elasticsearch) into a single AI application, and understand the full lifecycle of an agentic project from data preparation to frontend delivery.
Highlights
- Multi-stage Reasoning: Moves beyond simple prompt engineering by using LangGraph to orchestrate retrieval, SQL generation, validation, and correction.
- Hybrid Retrieval: Combines semantic search (Qdrant) and keyword search (Elasticsearch) to ensure accurate mapping of natural language to database schemas and values.
- Full-Stack Implementation: Includes a complete, runnable codebase with a FastAPI backend, React frontend, and Docker-based infrastructure.
- Educational Focus: Accompanied by a comprehensive, chapter-by-chapter tutorial series that maps directly to Git branches for hands-on learning.
- Engineering Best Practices: Demonstrates professional patterns like dependency injection, structured configuration, and request-id logging for tracing.
Related
- Project
- Project
- Project
- Project