Metadata-Version: 2.4
Name: target-synthesis-agent
Version: 1.0.16
Summary: AI-powered target variable creation and synthesis agent
Author-email: StepFunction AI <team@stepfunction.ai>
Maintainer-email: StepFunction AI <team@stepfunction.ai>
License-Expression: MIT
Project-URL: Homepage, https://github.com/stepfnAI/target_synthesis_agent
Project-URL: Documentation, https://github.com/stepfnAI/target_synthesis_agent#readme
Project-URL: Repository, https://github.com/stepfnAI/target_synthesis_agent.git
Project-URL: Bug Tracker, https://github.com/stepfnAI/target_synthesis_agent/issues
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: sfn-blueprint>=0.6.6
Requires-Dist: pandas>=1.5.0
Requires-Dist: numpy>=1.21.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: scikit-learn>=1.5.2
Requires-Dist: numba>=0.57.0
Requires-Dist: llvmlite>=0.40.0
Requires-Dist: shap>=0.45.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.20.0; extra == "dev"
Requires-Dist: black>=22.0.0; extra == "dev"
Requires-Dist: flake8>=5.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest>=7.0.0; extra == "test"
Requires-Dist: pytest-cov>=4.0.0; extra == "test"
Requires-Dist: pytest-asyncio>=0.20.0; extra == "test"

# Target Synthesis Agent

An intelligent AI-powered agent for generating and synthesizing target variables for machine learning tasks. This tool analyzes data characteristics and business context to create optimal target variables for various ML applications.

## 🚀 Features

- **AI-Powered Analysis**: Leverages advanced LLM models to analyze data and business context
- **Multiple Data Sources**: Works with both SQL databases and pandas DataFrames
- **Customizable Workflows**: Supports various ML approaches and synthesis strategies
- **Comprehensive Testing**: Includes a complete test suite for reliability
- **Extensible Architecture**: Easy to extend with custom components and integrations

## 📦 Installation

### Prerequisites
- Python 3.10+
- Git
- [uv](https://github.com/astral-sh/uv) package manager (recommended)

### Setup

1. **Clone the repository**
   ```bash
   git clone https://github.com/stepfnAI/target_synthesis_agent.git
   cd target_synthesis_agent/
   git checkout dev
   ```

2. **Set up the virtual environment and install dependencies**
   ```bash
   uv venv --python=3.10 venv
   source venv/bin/activate
   uv pip install -e ".[dev]"
   ```

3. **Clone and install the blueprint dependency**
   ```bash
   cd ..
   git clone https://github.com/stepfnAI/sfn_blueprint.git
   cd sfn_blueprint
   git switch dev
   uv pip install -e .
   cd ../target_synthesis_agent
   ```

4. **Set up environment variables**
   ```bash   
   # Optional: Configure LLM provider (default: openai)
   export LLM_PROVIDER="your_llm_provider"
   
   # Optional: Configure LLM model (default: gpt-4)
   export LLM_MODEL="your_llm_model"
   
   # Required: Your LLM API key
   export LLM_API_KEY="your_llm_api_key"
   ```

## 🛠️ Usage

### Basic SQL Usage
```bash
python examples/sql_basic_usage.py
```

## 🧪 Testing

Run the complete test suite:
```bash
pytest tests/ -s
```

Or run individual test files:
```bash
pytest tests/conftest.py -s
pytest tests/test_agent.py -s
pytest tests/test_utils.py -s
```

## 🏗️ Architecture

The Target Synthesis Agent is built with a modular architecture:

- **Core Components**:
  - `agent.py`: Main SQL-based implementation
  - `models.py`: Data models and schemas
  - `utils.py`: Utility functions and helpers
  - `constants.py`: Configuration and prompts

- **Dependencies**:
  - `sfn-blueprint`: Core framework and utilities
  - `pandas`: Data manipulation
  - `sqlalchemy`: Database interactions
  - `scikit-learn`: ML utilities

## 🤝 Contributing

We welcome contributions! Please follow these steps:

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## 📧 Contact

For questions or support, please contact [support@stepfunction.ai](mailto:support@stepfunction.ai)

## 🙏 Acknowledgments

- Built with ❤️ by StepFunction AI
- Uses [sfn-blueprint](https://github.com/stepfnAI/sfn_blueprint) for core functionality
- Inspired by modern MLOps best practices
