Metadata-Version: 2.4
Name: genaitor
Version: 1.0.1
Summary: A platform for AI Agents and AI Agents products generation.
Author-email: Yan Barros <yanbarrosyan@gmail.com>
License: MIT
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: transformers>=4.30.0
Requires-Dist: pdfplumber>=0.11.6
Requires-Dist: python-pptx==1.0.2
Requires-Dist: python-docx>=1.1.2
Requires-Dist: pandas>=2.2.3
Requires-Dist: Pillow>=10.4.0
Requires-Dist: pytesseract>=0.3.13
Requires-Dist: moviepy>=2.1.2
Requires-Dist: SpeechRecognition>=3.14.2
Requires-Dist: pydub>=0.25.1
Requires-Dist: langchain>=0.0.300
Requires-Dist: langchain-community>=0.0.10
Requires-Dist: requests>=2.32.3
Requires-Dist: absl-py>=2.1.0
Requires-Dist: grpcio>=1.50.0
Requires-Dist: matplotlib>=3.5.0
Requires-Dist: tenacity>=8.0.0
Requires-Dist: python-dotenv>=1.0.1
Requires-Dist: SQLAlchemy>=2.0.40
Requires-Dist: PyPDF2>=3.0.1
Requires-Dist: torch>=2.2.1
Requires-Dist: datasets>=3.3.2
Requires-Dist: trl>=0.16.1
Requires-Dist: peft>=0.15.1
Requires-Dist: rasterio>=1.4.3
Requires-Dist: bs4>=0.0.2
Requires-Dist: google-genai>=1.11.0
Requires-Dist: google-generativeai>=0.8.4
Requires-Dist: streamlit>=1.44.0
Requires-Dist: tifffile>=2025.3.13
Requires-Dist: opencv-python>=4.11.0.86
Requires-Dist: ezdxf>=1.4.0
Requires-Dist: numpy>=1.26.4
Requires-Dist: h5py>=3.13.0
Requires-Dist: netCDF4>=1.7.2
Requires-Dist: astropy>=7.0.1
Requires-Dist: astropy-iers-data>=0.2025.3.31.0.36.18
Requires-Dist: trimesh>=4.6.4
Requires-Dist: avro>=1.12.0
Requires-Dist: scipy>=1.15.2
Requires-Dist: open3d>=0.19.0
Requires-Dist: aiohttp>=3.11.13
Requires-Dist: fastapi>=0.115.11
Requires-Dist: tiktoken>=0.9.0
Requires-Dist: openai>=1.66.3
Requires-Dist: anthropic>=0.49.0
Requires-Dist: colorama>=0.4.6


<p align="center">
  <img src="logo.png" alt="Genaitor Logo" width="300"/>
</p>

# GenAItor

A platform for AI Agents and AI Agents products generation.

## Overview

GenAItor is a cutting-edge platform designed to generate AI agents and related products that help automate complex tasks and processes. It leverages state-of-the-art machine learning libraries and tools to deliver flexible and scalable AI solutions.

To install the required dependencies, follow these steps:

1. Clone the repository:
   ```bash
   git clone https://github.com/enterpriselm/genaitor.git
   cd genaitor
   ```

2. Create a virtual environment (optional but recommended):
   ```bash
   python -m venv venv
   source venv/bin/activate  # On Windows use `venv\Scripts\activate`
   ```

3. **Important:**  
   This project is best run with **Python 3.12** to ensure compatibility and avoid potential errors.

4. Install the required packages:
   ```bash
   pip install -e .
   ```

5. Add API_KEY for llm (Gemini set as main, but you can use Anthropic, OpenAI, DeepSeek, Grok, Ollama or a custom LLM model):
   ```bash
   echo "API_KEY=your_gemini_api_key" >> .env
   ```

## General Framework Architecture

<p align="center">
  <img src="ELM.pdf_20250427_112621_0000.png" alt="General Diagram" width="600"/>
</p>

## Features

- Generate AI agents for a variety of use cases.
- Modular architecture with components such as `core`, `llm`, `utils`, and `presets`.
- Support for multiple data processing and communication protocols.
- Integration with popular libraries like Transformers, Langchain, and more.

## Usage

### Basic Example

Here’s a simple example of how to create an agent that answers questions using a generative model:

```python
from genaitor.core import Agent, Task
from genaitor.llm import GeminiProvider, GeminiConfig

# Define a custom task
class QuestionAnsweringTask(Task):
    def __init__(self, description: str, goal: str, output_format: str, llm_provider):
        super().__init__(description, goal, output_format)
        self.llm = llm_provider

    def execute(self, input_data: str):
        prompt = f"""
    Task: {self.description}
    Goal: {self.goal}
    Question: {input_data}
    Please provide a response following the format:
    {self.output_format}
    """
        return self.llm.generate(prompt)

# Configure the LLM provider
llm_provider = GeminiProvider(GeminiConfig(api_key="your_api_key"))

# Create an agent
agent = Agent(name="QA Agent", task=QuestionAnsweringTask("Answering questions", "Provide accurate answers", "Text format", llm_provider))

# Execute a task
result = agent.task.execute("What is AI?")
print(result)
```

### Multi-Agent Example

Here’s a simple example of how to create a flow using multiple agents:

```python
import asyncio
from genaitor.core import (
    Agent, Task, Orchestrator, Flow,
    ExecutionMode, AgentRole, TaskResult
)
from genaitor.llm import GeminiProvider, GeminiConfig

# Define a base task (you could use different tasks for each agent)
class LLMTask(Task):
    def __init__(self, description: str, goal: str, output_format: str, llm_provider):
        super().__init__(description, goal, output_format)
        self.llm = llm_provider

    def execute(self, input_data: str) -> TaskResult:
        prompt = f"""
Task: {self.description}
Goal: {self.goal}

Input: {input_data}

Please provide a response following the format:
{self.output_format}
"""
        try:
            response = self.llm.generate(prompt)
            return TaskResult(
                success=True,
                content=response,
                metadata={{"task_type": self.description}}
            )
        except Exception as e:
            return TaskResult(
                success=False,
                content=None,
                error=str(e)
            )

# Configure the LLM provider
llm_provider = GeminiProvider(GeminiConfig(api_key="your_api_key"))

# Generating two specific tasks
qa_task = LLMTask(
    description="Question Answering",
    goal="Provide clear and accurate responses",
    output_format="Concise and informative",
    llm_provider=llm_provider
)

summarization_task = LLMTask(
    description="Text Summarization",
    goal="Summarize lengthy content into key points",
    output_format="Bullet points or short paragraph",
    llm_provider=llm_provider
)

# Create agents
qa_agent = Agent(
    role=AgentRole.SPECIALIST,
    tasks=[qa_task],
    llm_provider=llm_provider
)
summarization_agent = Agent(
    role=AgentRole.SUMMARIZER,
    tasks=[summarization_task],
    llm_provider=llm_provider
)

orchestrator = Orchestrator(
    agents={{"qa_agent": qa_agent, "summarization_agent": summarization_agent}},
    flows={{"default_flow": Flow(agents=["qa_agent", "summarization_agent"], context_pass=[True,True])}},
    mode=ExecutionMode.SEQUENTIAL
)

result_process = orchestrator.process_request('What is the impact of AI on modern healthcare?', flow_name='default_flow')
result = asyncio.run(result_process)
print(result)
```

## Demo Videos

Here are some demo videos showcasing Genaitor in action:
- [Apps Generation](https://youtu.be/aJboXG3RvsA)
- [OCR and Power Apps Automatization](https://youtu.be/VvIb7x3PJWQ)
- [Satellite Images Analysis](https://youtu.be/hsjanmnCxJ4)
- [PINNeAPPle](https://youtu.be/AbYr3F_v5OA)

## FAQ

Why should I use this framework over others like LangChain, LangGraph, CrewAI or LlamaIndex?

While popular frameworks like LangChain, LangGraph, and LlamaIndex are powerful, they are primarily designed as general-purpose agentic frameworks.
Our framework is specifically optimized for Scientific Machine Learning (SciML) applications and offers the following key advantages:

- Specific focus on Scientific Machine Learning:

Unlike generalist frameworks, we prioritize workflows tailored for scientific and physics-based AI tasks, where agent behavior often requires structured reasoning and domain-specific knowledge handling.

- Greater control and transparency:
Our design provides developers with direct access to agent modeling and lifecycle management.
You are not tied to predefined abstractions or "black-box" architectures, allowing full customization to match scientific workflows.

- Reduced learning curve:
Our framework minimizes unnecessary complexity.
Users can build efficient agents with a much simpler and more intuitive interface, without needing to dive deep into multiple layers of abstractions before achieving results.


Is this framework compatible with LangChain or LlamaIndex?

Our framework is independent but compatible with most libraries from the ecosystem.
You can integrate components like LlamaIndex for document retrieval or LangChain tools if needed, while still maintaining full control over the agent lifecycle inside our framework.

What kind of Scientific Machine Learning tasks is this framework suited for?

This framework is designed for tasks such as:

- Physics-informed problem solving

- Scientific reasoning and simulation control

- AI-driven research assistants for scientific domains

- Autonomous agents for data-driven discovery processes

- Interaction with physical simulation APIs, datasets, and analytical tools


If your use case involves structured reasoning, scientific models, or physics-based tasks, this framework provides the flexibility and precision you need.

## Contribution Guidelines

We welcome contributions! To contribute:

1. Fork the repository.
2. Create a new branch (`git checkout -b feature-name`).
3. Make your changes and commit (`git commit -m 'Add new feature'`).
4. Push to the branch (`git push origin feature-name`).
5. Create a pull request.

## License

This project is licensed under the MIT License.

## Contact

For any questions or suggestions, feel free to open an issue or contact the maintainers at enterpriselearningmachines@gmail.com or the main author Yan Barros at https://www.linkedin.com/in/yan-barros-yan

You can also check our landing-page to more news:

enterpriselm.github.io/home
