Metadata-Version: 2.4
Name: agentapps
Version: 0.2.5
Summary: AgentApps — A flexible multi-agent orchestration framework with visual Flow Builder
Home-page: https://github.com/91abdul/agentapps
Author: AgentApps Team
Author-email: 
Project-URL: Bug Reports, https://github.com/91abdul/agentapps/issues
Project-URL: Source, https://github.com/91abdul/agentapps
Project-URL: Documentation, https://github.com/91abdul/agentapps#readme
Keywords: agents,ai,llm,orchestration,multi-agent,openai,flow-builder,visual,gemini,grok
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: openai
Requires-Dist: ddgs
Requires-Dist: beautifulsoup4
Requires-Dist: requests
Requires-Dist: fastapi>=0.100.0
Requires-Dist: uvicorn[standard]>=0.24.0
Requires-Dist: python-multipart
Provides-Extra: gemini
Requires-Dist: google-genai; extra == "gemini"
Provides-Extra: ssl
Requires-Dist: cryptography; extra == "ssl"
Provides-Extra: all
Requires-Dist: google-genai; extra == "all"
Requires-Dist: cryptography; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# AgentApps

A flexible multi-agent orchestration framework for building intelligent agent applications with a **visual Flow Builder**.

## Features

- 🤖 **Simple Agent Creation** - Clean, intuitive
- 👥 **Team Collaboration** - Multiple agents working together
- 🔄 **Sequential Workflows** - Automatic multi-step execution
- 🛠️ **Built-in Tools** - Web search, scraping, calculations
- 🎯 **Custom Tools** - Easy tool creation
- 📊 **Streaming Support** - Real-time responses
- 🔍 **Web Search** - DuckDuckGo integration
- 🌐 **Web Scraping** - Extract content from any URL
- 🌟 **Multi-Model Support** - OpenAI, Google Gemini, or XAI Grok

## Links

- GitHub: https://github.com/91Abdul/agentapps
- PyPI: https://pypi.org/project/agentapps
- Issues: https://github.com/91Abdul/agentapps/issues
- Discord: https://discord.gg/xAUYb2vujP
- Group: https://www.linkedin.com/groups/14471903/ 

## Installation
```bash
pip install agentapps
```

## Quick Start — Flow Builder UI

```bash
agentapps-flow
```

This starts the server and automatically opens the visual Flow Builder in your browser at `http://localhost:7860`.

```bash
# Custom port
agentapps-flow --port 8080

# Don't open browser automatically  
agentapps-flow --no-browser

# Dev mode with hot-reload
agentapps-flow --reload
```

## Secure login

##### 1. CLI flag
agentapps-flow --password mysecretpassword

##### 2. Environment variable (recommended for servers)
export AGENTAPPS_PASSWORD=mysecretpassword
agentapps-flow

##### 3. No password set — auto-generates one and prints it to console
agentapps-flow
##### ╔══════════════════════════════════════════════╗
##### ║  🔑 Auto-generated password:                 ║
##### ║     xK9mP2nQvR4sT7uW                         ║


This installs all dependencies:
- `openai` - OpenAI|Grok API client
- `ddgs` - DuckDuckGo search
- `beautifulsoup4` - HTML parsing
- `google.genai` - Google API client
- `requests` - HTTP requests


## Supported Models

| Provider | Class | Model IDs |
|----------|-------|-----------|
| OpenAI   | `OpenAIChat` | `gpt-4o`, `gpt-4-turbo`, `gpt-3.5-turbo` |
| Gemini   | `GeminiChat` | `gemini-2.0-flash`, `gemini-1.5-pro` |
| xAI Grok | `GrokChat`   | `grok-3`, `grok-3-mini` |


## Quick Start with OpenAI
```python
from agentapps import Agent
from agentapps.model import OpenAIChat
from agentapps.tools import SearchSummaryTool

# Create an agent
agent = Agent(
    name="Research Assistant",
    role="Search and analyze information",
    model=OpenAIChat(id="gpt-4", api_key="your-openai-key"),
    tools=[SearchSummaryTool()],
    instructions=["Always include sources"],
    show_tool_calls=True
)

# Use it!
agent.print_response("What is the latest news about AI?")
```
**Get OpenAI API Key:** https://platform.openai.com/api-keys

## Quick Start with Gemini
```python
from agentapps import Agent
from agentapps.model import GeminiChat
from agentapps.tools import SearchSummaryTool

# Create an agent
agent = Agent(
    name="Research Assistant",
    role="Search and analyze information",
    model=GeminiChat(id="gemini-2.0-flash-exp", api_key="your-google-api-key"),
    tools=[SearchSummaryTool()],
    instructions=["Always include sources"],
    show_tool_calls=True
)

# Use it!
agent.print_response("What is the latest news about AI?")
```

**Installation:**
```bash
pip install agentapps google-genai
```

**Get Gemini API Key:** https://makersuite.google.com/app/apikey


## Quick Start with Grok XAI
```python
from agentapps import Agent
from agentapps.model import GrokChat
from agentapps.tools import SearchSummaryTool

# Create an agent
agent = Agent(
    name="Research Assistant",
    role="Search and analyze information",
    model=GrokChat(id="grok-3-mini", api_key="your-xai-api-key"),
    tools=[SearchSummaryTool()],
    instructions=["Always include sources"],
    show_tool_calls=True
)

# Use it!
agent.print_response("What is the latest news about AI?")
```

**Get Grok API Key:** https://console.x.ai

---


## Available Tools

### SearchSummaryTool
Search the web and get detailed snippets:
```python
from agentapps.tools import SearchSummaryTool

agent = Agent(
    name="Searcher",
    model=OpenAIChat(id="gpt-4", api_key="key"),
    tools=[SearchSummaryTool()]
)
```

### WebScraperTool
Scrape content from URLs:
```python
from agentapps.tools import WebScraperTool

agent = Agent(
    name="Scraper",
    model=OpenAIChat(id="gpt-4", api_key="key"),
    tools=[WebScraperTool()]
)
```

### CalculatorTool
Perform calculations:
```python
from agentapps.tools import CalculatorTool

agent = Agent(
    name="Calculator",
    model=OpenAIChat(id="gpt-4", api_key="key"),
    tools=[CalculatorTool()]
)
```

## Team Agents

Create teams that work together sequentially:
```python
from agentapps import Agent
from agentapps.model import OpenAIChat
from agentapps.tools import SearchSummaryTool, WebScraperTool

# Create specialist agents
search_agent = Agent(
    name="Search Agent",
    role="Search the web",
    model=OpenAIChat(id="gpt-4", api_key="your-key"),
    tools=[SearchSummaryTool()]
)

scraper_agent = Agent(
    name="Scraper Agent",
    role="Read web pages",
    model=OpenAIChat(id="gpt-4", api_key="your-key"),
    tools=[WebScraperTool()]
)

# Create team with sequential workflow
team = Agent(
    team=[search_agent, scraper_agent],
    instructions=[
        "First, search for relevant URLs",
        "Then, scrape content from those URLs",
        "Finally, provide comprehensive answer"
    ],
    show_tool_calls=True
)

# Team automatically: searches → scrapes → answers
team.print_response("Research NVIDIA's latest AI developments")
```

## Custom Tools

Create your own tools easily:
```python
from agentapps import Tool

class WeatherTool(Tool):
    def __init__(self):
        super().__init__(
            name="get_weather",
            description="Get weather for a city"
        )
    
    def execute(self, city: str) -> str:
        # Your implementation
        return f"Weather in {city}: Sunny, 72°F"
    
    def get_parameters(self):
        return {
            "type": "object",
            "properties": {
                "city": {"type": "string", "description": "City name"}
            },
            "required": ["city"]
        }

# Use it
agent = Agent(
    name="Weather Agent",
    model=OpenAIChat(id="gpt-4", api_key="key"),
    tools=[WeatherTool()]
)
```

## Examples

### Stock Analysis
```python
agent = Agent(
    name="Stock Analyst",
    role="Analyze stocks",
    model=OpenAIChat(id="gpt-4", api_key="key"),
    tools=[SearchSummaryTool()],
    instructions=["Include price targets and analyst ratings"]
)

agent.print_response("Analyze NVDA stock with latest news and recommendations")
```

### Research Assistant
```python
research_team = Agent(
    team=[search_agent, scraper_agent],
    instructions=[
        "Search for academic sources",
        "Read full articles",
        "Provide comprehensive summary with citations"
    ]
)

research_team.print_response("What are the latest breakthroughs in quantum computing?")
```

## API Reference

### Agent
```python
Agent(
    name: str = "Agent",
    role: str = "General Assistant",
    model: Model = None,
    tools: List[Tool] = None,
    instructions: List[str] = None,
    team: List[Agent] = None,
    show_tool_calls: bool = False,
    markdown: bool = False,
    temperature: float = None
)
```

### Methods

- `run(message: str, stream: bool = False)` - Execute agent
- `print_response(message: str, stream: bool = False)` - Print response
- `clear_history()` - Clear conversation history
- `add_tool(tool: Tool)` - Add a tool
- `get_info()` - Get agent information

## HTTPS / SSL

Secure HTTPS is required for production webhooks (Jira, Zapier, Slack, etc.). There are three ways to enable it.

### Option 1 — Auto self-signed certificate (easiest)

Generates a certificate automatically on first run and reuses it on every restart. Stored in `~/.agentapps/ssl/`.

```bash
pip install cryptography
agentapps-flow --ssl-self-signed
```

The browser will show a one-time security warning. Click **Advanced → Proceed** to continue. External services like Jira work fine with self-signed certs when accessed via a tunnel (ngrok, Cloudflare Tunnel, etc.).

### Option 2 — Bring your own certificate (Let's Encrypt / purchased)

```bash
agentapps-flow --ssl-cert /path/to/cert.pem --ssl-key /path/to/key.pem
```

Both `--ssl-cert` and `--ssl-key` are required together. The certificate must be in PEM format.

**Getting a free Let's Encrypt certificate:**

```bash
# Install certbot
pip install certbot

# Issue certificate (requires port 80 open and a domain pointing to your server)
certbot certonly --standalone -d yourdomain.com

# Then run:
agentapps-flow \
  --ssl-cert /etc/letsencrypt/live/yourdomain.com/fullchain.pem \
  --ssl-key  /etc/letsencrypt/live/yourdomain.com/privkey.pem
```

### Option 3 — Standard HTTPS port (443)

```bash
agentapps-flow --port 443 --ssl-cert cert.pem --ssl-key key.pem
# or
agentapps-flow --port 443 --ssl-self-signed
```

> **Note:** On Linux/macOS, binding to port 443 requires root or `sudo`. Consider using a reverse proxy (nginx, Caddy) for production instead.

### Using with ngrok (recommended for local webhooks)

ngrok provides a public HTTPS URL that tunnels to your local server — no certificate needed on your end:

```bash
# Terminal 1 — start the flow builder
agentapps-flow

# Terminal 2 — start ngrok tunnel
ngrok http 7860
```

Use the `https://xxxx.ngrok-free.app` URL ngrok provides as your webhook base URL.

### Webhook URL format

```
https://your-domain.com/webhook/<project-name>?token=<bearer-token>
```

Tokens are generated in the Flow Builder under **☰ Menu → 🔗 Webhooks**.

### All CLI flags

| Flag | Default | Description |
|------|---------|-------------|
| `--port` | `7860` | Port to listen on |
| `--host` | `0.0.0.0` | Host to bind to |
| `--no-browser` | off | Don't auto-open browser |
| `--reload` | off | Hot-reload on file changes (dev mode) |
| `--ssl-self-signed` | off | Auto-generate self-signed certificate |
| `--ssl-cert` | — | Path to SSL certificate `.pem` file |
| `--ssl-key` | — | Path to SSL private key `.pem` file |

## Requirements

- Python >= 3.8
- OpenAI API key or Gemini or Grok XAI

## License

MIT License

## Contributing

Contributions welcome! Please feel free to submit a Pull Request.

