dataagent:企业级 Data+AI Agent | NL2SQL · 多源查询 · 智能分析 · 开箱即用

企业级 Data+AI Agent | NL2SQL · 多源查询 · 智能分析 · 开箱即用

Branch183Tags1

🚀 DataAgent

中文 · English

Data + AI Agent: Enterprise Data Task Solution

🚀 DataAgent is a next-generation enterprise data intelligence platform for Data + AI scenarios, reimagining the entire data engineering pipeline through the Agent paradigm. Deeply integrating NL2SQL, unified semantic layers, and multi-agent collaboration, it delivers end-to-end data analysis and feature mining across financial risk control, AI for Science, and other core domains.

🌟 Why DataAgent

🏆 Scenario Advantages

Scenario Traditional Approach The DataAgent Edge Typical Applications
📊 Financial Q&A Business request → data team queue → manual SQL → manual verification; T+1 is the norm for a single metric query NL2SQL four-stage pipeline (Perception→Generation→Validation→Reflection), natural language to instant answers. Semantic metric mapping, 74%+ execution accuracy on BIRD DEV benchmark, sub-second response ✅ Enterprise financial analytics assistant
🔬 AI for Science Multi-source scientific data scattered everywhere; cross-database correlation requires manual exports; literature and data cannot be jointly queried Multi-source federated queries + structured/unstructured joint retrieval, natural-language-driven scientific data exploration ✅ Scientific data exploration platform

⚡ Core Capabilities

Capability Description
🧠 NL2SQL Intelligent Engine Four-stage pipeline: Perceptor→Generator→Validator→Reflector; multi-strategy fusion: Prompt / ICL / Skeleton / DC; supports SQLite / MySQL / PostgreSQL / Hive; 74%+ execution accuracy on BIRD benchmark
🔬 Automated Feature Engineering Agents autonomously explore relationships across hundreds of tables, auto-discover latent feature combinations with importance ranking and visualization — 10x+ efficiency boost
🏭 Full-Pipeline Data Factory Data ingestion→Schema perception→Feature mining→Model training→Report generation — one YAML config runs the complete data engineering pipeline
🧩 Unified Semantic Layer Prioritizes GaussVector as an enhanced vector retrieval foundation in the semantic layer, turning tables, columns, metric definitions, and business descriptions into retrievable schema signals for NL2SQL and multi-source semantic alignment
🔌 Plugin Tool Ecosystem Local Python tools and gym env tools (e.g. SQLiteEnv) register through ToolManager; YAML TOOLS.local_functions / optional builtin overrides
📡 Agent Composition Flex + NL2SQL with optional sub-agent / job tools for multi-step workflows; REST and Python SDK as northbound entrypoints
🧩 YAML as Agent Model, tools, memory, workflow, scenario prompts — all declaratively orchestrated. From idea to running Agent in minutes
🛡️ Enterprise Security Sandbox Workspace isolation + path whitelisting + full audit trail, meeting financial-grade compliance requirements
⚡ Out of the Box 20+ industry scenario example configs — zero code to start, up and running in minutes

📋 Environment Requirements

Dependency Version
🐍 Python >= 3.11
📦 Package Manager uv (recommended) or pip

📚 Documentation

Full documentation lives under docs/ (中文 · English). Build and preview locally:

uv sync --extra mkdoc
uv run mkdocs serve -f docs/mkdocs.yml
Document Description
📖 Installation Install with uv / pip, environment variables, and verification
📖 Quick Start Run an end-to-end DataAgent workflow in minutes
🗄️ Database Installation Optional: Semantic Service / GaussVector for NL2SQL; MySQL / PostgreSQL / Elasticsearch only for extended scenarios
⚙️ Features Core capabilities, modules, tools, and model support
🧩 Semantic Service Semantic Service enriched metadata for NL2SQL, prioritizing GaussVector-oriented semantic-layer indexing, candidate schema recall, and schema perception enhancement
🏗️ Architecture System architecture; context, planning engine, and action modules
📡 API Design REST northbound interface and Python SDK
📋 Application Cases Build a dedicated NL2SQL Agent; build a data analysis Agent
📝 Notes Development, testing, and documentation maintenance
🗓️ Milestone Release planning and roadmap

🚴 Installation

1️⃣ Clone the project

git clone https://xxxxxx.com/datagallery/DataAgent.git
cd DataAgent
# Install dependencies
uv sync

# Activate virtual environment
source .venv/bin/activate  # Linux / macOS
.venv\Scripts\activate     # Windows

3️⃣ Or use pip

pip install -e .

4️⃣ Configure environment variables

# Copy environment template
cp .env.example .env

# Edit .env file with your actual configuration values

⚡ Quick Start

📡 Start the REST service

uv run -m dataagent --config dataagent/core/flex/examples/ueg.yaml --host 0.0.0.0 --port 8010

🐍 Or use the Python SDK

from dataagent import DataAgent

agent = DataAgent.from_config("dataagent/core/flex/examples/ueg.yaml")

📖 Usage

🐍 Python SDK

from dataagent import DataAgent

agent = DataAgent.from_config("path/to/config.yaml")

# Single-turn conversation
response = await agent.chat("Analyze sales data trends for the past week")
print(response)

# Streaming conversation
async for chunk in agent.astream(input={"user_query": "Generate user report"}):
    print(chunk, end="", flush=True)

📝 YAML Config Example

AGENT_CONFIG:
  name: "My Data Agent"
  version: "1.0"
  description: "Data Analysis Agent"
  backend: "langgraph"
  type: "react"

MODEL:
  chat_model:
    provider: "deepseek"
    model_type: "chat"
    params:
      model: "deepseek-chat"
      temperature: 0.7
      base_url: "$env{DEEPSEEK_BASE_URL}"
      api_key: "$env{DEEPSEEK_API_KEY}"

WORKSPACE:
  path: "/tmp/dataagent_workspace"
  allow_path:
    - "/tmp/dataagent_workspace"

⚙️ Configuration

🔐 Environment Variables

Variable Description Example
DEEPSEEK_API_KEY DeepSeek API Key sk-xxx
DEEPSEEK_BASE_URL DeepSeek API Base URL https://xxx.xxxxxx.xxx
BAILIAN_API_KEY Alibaba Cloud Bailian API Key sk-xxx
OPENAI_API_KEY OpenAI API Key sk-xxx

📌 For more configuration, refer to .env.example

📄 License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Introduction

企业级 Data+AI Agent | NL2SQL · 多源查询 · 智能分析 · 开箱即用

Customize your domain