File size: 3,239 Bytes
2cc0a25
 
 
 
 
 
 
 
 
 
 
49dbbe9
 
2cc0a25
 
527e1d3
 
 
 
 
 
 
 
 
2cc0a25
b2ca056
9861912
b2ca056
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94bb6a1
b2ca056
 
 
9861912
b2ca056
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
title: DataForge
emoji: πŸ’¬
colorFrom: yellow
colorTo: purple
sdk: gradio
sdk_version: 5.0.1
app_file: app.py
pinned: false
license: mit
short_description: CodeAct Agent to process large data set
tags: 
    - agent-demo-track
---

## πŸŽ₯ Demo Video

**Watch DataForge in Action:** 

[![DataForge Demo](https://img.youtube.com/vi/f5jp2i3engM/maxresdefault.jpg)](https://www.youtube.com/watch?v=f5jp2i3engM)

🎬 **[Click here to watch the full demo on YouTube](https://www.youtube.com/watch?v=f5jp2i3engM)**

---

# πŸ” DataForge - AI Assistant with File Analysis

An intelligent AI assistant that combines conversational chat capabilities with advanced file analysis using CodeAct agents. Built with Gradio, LangChain, and LangGraph.

## ✨ Features

### πŸ’¬ Chat Assistant
- Interactive AI chatbot powered by OpenAI GPT-4
- Customizable system messages and parameters
- Real-time streaming responses
- Conversation history support

### πŸ“ File Analysis
- **Upload & Analyze**: Support for various file formats (.txt, .log, .csv, .json, .xml, .py, .js, .html, .md)
- **Smart Analysis**: Automatic file type detection and tailored analysis
- **CodeAct Integration**: Uses LangGraph CodeAct agents for deep file analysis
- **Comprehensive Insights**: Provides security analysis, performance insights, error detection, and statistical summaries

## πŸš€ Getting Started

### Prerequisites
- Python 3.11+
- OpenAI API Key

### Installations

1. Create and activate virtual environment:
```bash
uv venv --python 3.11 
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
```

2. Install dependencies:
```bash
uv pip install -r requirements.txt
```

3. Set up environment variables:
```bash
# Create .env file and add your OpenAI API key
OPENAI_API_KEY=your_openai_api_key_here
```

### Running the Application
```bash
python app.py
```

The application will start a Gradio interface accessible at `http://localhost:7860`

## πŸ“Š File Analysis Capabilities

### Supported File Types
- **Log files** (.log, .txt): Security analysis, performance bottlenecks, error detection
- **Data files** (.csv, .json): Data quality assessment, statistical analysis
- **Code files** (.py, .js, .html): Structure analysis, best practices review
- **Configuration files** (.xml, .md): Content analysis and recommendations

### Analysis Features
- **Security Analysis**: Detect threats, suspicious activities, and security patterns
- **Performance Insights**: Identify bottlenecks and performance issues
- **Error Analysis**: Categorize and analyze errors and warnings
- **Statistical Summary**: Basic statistics and data distribution
- **Pattern Recognition**: Identify trends and anomalies
- **Actionable Recommendations**: Suggested actions based on analysis

## πŸ§ͺ Testing

A sample server log file (`sample_server.log`) is included for testing the file analysis functionality.

## πŸ› οΈ Technical Architecture

- **Frontend**: Gradio for web interface
- **Backend**: LangChain for AI orchestration
- **Analysis Engine**: LangGraph CodeAct agents with PyodideSandbox
- **File Processing**: Custom FileInjectedPyodideSandbox for secure file analysis
- **Model**: OpenAI GPT-4 for both chat and analysis

## πŸ“„ License

MIT License