Skip to content

DSXiangLi/DAAgent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DAAgent - Intelligent Data Analysis Agent based on LangGraph and MCP

Logo Description
DAAgent is an intelligent data analysis agent that combines LangGraph with MCP's tool-calling mechanism to automatically execute data analysis tasks, generate code, run code, and provide multi-step executed code and visualization results in Jupyter Notebook format.

Project Structure

├── src/
│   ├── agent/          # Core agent logic
│   │   ├── graph/      # Langgraph workflow definitions
│   │   ├── prompts/    # Prompt templates
│   │   └── utils/      # Utility functions
│   ├── app/            # Application examples
│   │   └── demo/       # Demo workflows
│   └── mcp_servers/    # Sandbox server implementations
├── tests/              # Test files and sample data
└── .env.example        # Environment configuration example

💡 Core Features

1. Intelligent Analysis Plan Generation

The system can automatically generate detailed data analysis plans based on user-provided data, including data exploration, statistical analysis, and visualization schemes. Through well-designed prompt templates, it guides LLMs to generate structured analysis ideas.

2. Secure Code Execution

Leveraging E2B Code Interpreter's secure sandbox environment, it can safely execute generated Python code, preventing malicious code execution and system resource abuse. It supports capturing and parsing code execution results.

3. Powerful Visualization Capabilities

It supports generating various data visualization charts, including bar charts, line charts, scatter plots, etc., to help users intuitively understand data characteristics and analysis results.

4. Analysis Record Export

It can export the complete analysis process and results in Notebook format, facilitating users to review, modify, and share later.

🛠️ Technology Stack

  • Langchain/Langgraph: For building state graphs and workflow orchestration of intelligent agents
  • E2B Code Interpreter: Providing secure code execution sandbox environment
  • FastMCP/MCP: Implementing tool-calling mechanism
  • LLM models such as DeepSeek: Providing natural language processing and code generation capabilities
  • Python: Main development language

🚀 Quick Start

Environment Requirements

  • Python 3.10+ environment
  • E2B API Key (for sandbox service)
  • LLM API Key (supporting models like DeepSeek)

Installation Steps

  1. Clone the project repository

    git clone https://github.com/yourusername/DAAgent.git
    cd DAAgent
  2. Install dependencies

    pip install -r requirements.txt
  3. Set up environment variables

    cp .env.example .env

    Edit the .env file and fill in your API keys and other configuration information.

  4. Start the MCP server

    python -m src.mcp_servers.server
  5. Run the agent demo

    python -m src.app.demo

Workflow

  1. Initialization : Create a secure sandbox environment and pre-install necessary Python libraries
  2. Data Upload : User uploads data files to be analyzed
  3. Plan Generation : Generate detailed analysis plans based on data content
  4. Code Execution : Execute generated analysis code in the sandbox
  5. Result Processing : Collect code execution results and visualization charts
  6. Report Generation : Generate complete analysis reports

Tips: README was generated by AI. Please submit issues for any errors or omissions.

About

Data Analysis Agent

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published