ezyagent


Nameezyagent JSON
Version 0.0.12 PyPI version JSON
download
home_pagehttps://github.com/santhosh/
Summaryagent framework designed to make AI agent development simple
upload_time2024-12-20 13:06:33
maintainerNone
docs_urlNone
authorKammari Santhosh
requires_python<4.0,>=3.10
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # EzyAgent: A Modern, Simple, and Powerful BaseAgent Framework

## Overview
EzyAgent is a next-generation agent framework designed to make AI agent development simple, observable, and reliable. By learning from the limitations of existing frameworks, we've created a solution that prioritizes developer experience while providing enterprise-grade features.

## 🌟 Key Features

### Simple Yet Powerful

```python
from ezyagentsdf import BaseAgent

# Create an agent in one line
agent = BaseAgent("gpt-4")

# Start chatting
response = await agent.chat("Explain quantum computing")


# Add tools easily
@agent.tool
async def search(query: str) -> str:
    """Search the web."""
    return await web_search(query)
```

### First-Class Async Support
```python
# Stream responses
async with BaseAgent() as agent:
    async for message in agent.stream_chat("Write a long story"):
        print(message)
        
# Parallel operations
async def process_queries(queries: List[str]):
    async with BaseAgent() as agent:
        tasks = [agent.chat(q) for q in queries]
        responses = await asyncio.gather(*tasks)
```

### Advanced Logging & Observability
```python
# Comprehensive logging setup
agent.logger.configure(
    format="json",
    outputs={
        "console": {"level": "INFO"},
        "file": {
            "path": "agent.log",
            "level": "DEBUG"
        },
        "cloudwatch": {
            "group": "agents",
            "stream": "production"
        }
    },
    metrics=["tokens", "latency", "costs"],
    trace_requests=True
)

# Access logs and metrics
print(agent.logger.get_metrics())
print(agent.logger.get_recent_traces())
```

### Robust Error Handling
```python
try:
    response = await agent.chat("Complex query")
except AgentError as e:
    print(f"Error Type: {e.error_type}")
    print(f"Provider Error: {e.provider_error}")
    print(f"Context: {e.context}")
    print(f"How to fix: {e.remediation}")
    print(f"Debug trace: {e.debug_info}")
```

### Intelligent State Management
```python
# Built-in memory and state management
agent.memory.save_state("user_preferences", preferences)
agent.memory.add_context("User is a developer")

# Access conversation history
history = agent.memory.get_chat_history()
context = agent.memory.get_relevant_context("query")

# Persistent storage
await agent.memory.save_to_disk("agent_state.json")
await agent.memory.load_from_disk("agent_state.json")
```

### Universal Provider Support
```python
# Easy provider switching
agent = BaseAgent(provider="openai")
agent = BaseAgent(provider="anthropic")
agent = BaseAgent(provider="ollama")

# Multiple providers with fallback
agent = BaseAgent(
    providers=["anthropic", "openai"],
    fallback_strategy="sequential"
)

# Custom provider configuration
agent = BaseAgent(
    provider="openai",
    config={
        "max_retries": 3,
        "timeout": 30,
        "rate_limit": 100
    }
)
```

## Why EzyAgent?

### Problems with Existing Frameworks

#### 1. Langchain
- ❌ Complex setup and steep learning curve
- ❌ Confusing abstractions
- ❌ Poor error handling
- ❌ Limited async support
- ✅ Extensive tool ecosystem
- ✅ Good documentation

#### 2. AutoGen
- ❌ Complex configuration
- ❌ Limited logging
- ❌ Difficult debugging
- ✅ Good multi-agent support
- ✅ Built-in caching

#### 3. Pydantic-AI
- ❌ Limited provider support
- ❌ Basic logging
- ❌ No state management
- ✅ Strong type validation
- ✅ Clean data structures

#### 4. LlamaIndex
- ❌ Complex for simple uses
- ❌ Heavy resource usage
- ❌ Confusing documentation
- ✅ Great RAG support
- ✅ Good data ingestion

#### 5. PhiData
- ❌ Limited features
- ❌ Basic logging
- ❌ Limited providers
- ✅ Simple API
- ✅ Clean implementation

### EzyAgent's Solutions

#### 1. Development Experience
- One-line setup
- Clear, concise API
- Comprehensive documentation
- Type hints everywhere
- Informative error messages
- IDE autocomplete support

#### 2. Observability
- Structured logging
- Request tracing
- Cost tracking
- Performance metrics
- Debug mode
- Custom metric support

#### 3. Reliability
- Automatic retries
- Smart rate limiting
- Provider fallbacks
- Error recovery strategies
- Validation checks

#### 4. Flexibility
- Easy extension
- Custom tools
- Provider agnostic
- State management
- Memory systems
- Custom implementations

#### 5. Performance
- Async by default
- Efficient resource usage
- Built-in caching
- Streaming support
- Parallel operations

## Architecture

```plaintext
ezyagent/
├── core/
│   ├── baseagent.py          # Base agent classes
│   ├── memory.py         # State management
│   ├── tools.py          # Tool management
│   └── providers/        # LLM providers
├── logging/
│   ├── logger.py         # Logging core
│   ├── formatters.py     # Log formatters
│   ├── handlers.py       # Output handlers
│   └── monitors.py       # Metrics
├── utils/
│   ├── errors.py         # Error handling
│   ├── validation.py     # Input validation
│   └── helpers.py        # Utilities
└── examples/             # Usage examples
```

## Installation

```bash
pip install ezyagent
```

## Quick Start

```python
from ezyagentsdf import BaseAgent

# Create an agent
agent = BaseAgent("gpt-4")

# Enable logging
agent.logger.configure(format="json", outputs=["console"])


# Add a tool
@agent.tool
async def search(query: str) -> str:
    """Search the web."""
    return await web_search(query)


# Chat with the agent
async def main():
    response = await agent.chat("Find recent news about AI")
    print(response)


# Run
asyncio.run(main())
```

## Documentation

Full documentation is available at [docs.ezyagent.dev](https://docs.ezyagent.dev)

## License

MIT License - feel free to use in your own projects!

## Contributing

We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/santhosh/",
    "name": "ezyagent",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Kammari Santhosh",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/74/89/e1ffd2d1a37b2acb1003438ea3e9a7d0f801696e2228270a2d0bba54f731/ezyagent-0.0.12.tar.gz",
    "platform": null,
    "description": "# EzyAgent: A Modern, Simple, and Powerful BaseAgent Framework\n\n## Overview\nEzyAgent is a next-generation agent framework designed to make AI agent development simple, observable, and reliable. By learning from the limitations of existing frameworks, we've created a solution that prioritizes developer experience while providing enterprise-grade features.\n\n## \ud83c\udf1f Key Features\n\n### Simple Yet Powerful\n\n```python\nfrom ezyagentsdf import BaseAgent\n\n# Create an agent in one line\nagent = BaseAgent(\"gpt-4\")\n\n# Start chatting\nresponse = await agent.chat(\"Explain quantum computing\")\n\n\n# Add tools easily\n@agent.tool\nasync def search(query: str) -> str:\n    \"\"\"Search the web.\"\"\"\n    return await web_search(query)\n```\n\n### First-Class Async Support\n```python\n# Stream responses\nasync with BaseAgent() as agent:\n    async for message in agent.stream_chat(\"Write a long story\"):\n        print(message)\n        \n# Parallel operations\nasync def process_queries(queries: List[str]):\n    async with BaseAgent() as agent:\n        tasks = [agent.chat(q) for q in queries]\n        responses = await asyncio.gather(*tasks)\n```\n\n### Advanced Logging & Observability\n```python\n# Comprehensive logging setup\nagent.logger.configure(\n    format=\"json\",\n    outputs={\n        \"console\": {\"level\": \"INFO\"},\n        \"file\": {\n            \"path\": \"agent.log\",\n            \"level\": \"DEBUG\"\n        },\n        \"cloudwatch\": {\n            \"group\": \"agents\",\n            \"stream\": \"production\"\n        }\n    },\n    metrics=[\"tokens\", \"latency\", \"costs\"],\n    trace_requests=True\n)\n\n# Access logs and metrics\nprint(agent.logger.get_metrics())\nprint(agent.logger.get_recent_traces())\n```\n\n### Robust Error Handling\n```python\ntry:\n    response = await agent.chat(\"Complex query\")\nexcept AgentError as e:\n    print(f\"Error Type: {e.error_type}\")\n    print(f\"Provider Error: {e.provider_error}\")\n    print(f\"Context: {e.context}\")\n    print(f\"How to fix: {e.remediation}\")\n    print(f\"Debug trace: {e.debug_info}\")\n```\n\n### Intelligent State Management\n```python\n# Built-in memory and state management\nagent.memory.save_state(\"user_preferences\", preferences)\nagent.memory.add_context(\"User is a developer\")\n\n# Access conversation history\nhistory = agent.memory.get_chat_history()\ncontext = agent.memory.get_relevant_context(\"query\")\n\n# Persistent storage\nawait agent.memory.save_to_disk(\"agent_state.json\")\nawait agent.memory.load_from_disk(\"agent_state.json\")\n```\n\n### Universal Provider Support\n```python\n# Easy provider switching\nagent = BaseAgent(provider=\"openai\")\nagent = BaseAgent(provider=\"anthropic\")\nagent = BaseAgent(provider=\"ollama\")\n\n# Multiple providers with fallback\nagent = BaseAgent(\n    providers=[\"anthropic\", \"openai\"],\n    fallback_strategy=\"sequential\"\n)\n\n# Custom provider configuration\nagent = BaseAgent(\n    provider=\"openai\",\n    config={\n        \"max_retries\": 3,\n        \"timeout\": 30,\n        \"rate_limit\": 100\n    }\n)\n```\n\n## Why EzyAgent?\n\n### Problems with Existing Frameworks\n\n#### 1. Langchain\n- \u274c Complex setup and steep learning curve\n- \u274c Confusing abstractions\n- \u274c Poor error handling\n- \u274c Limited async support\n- \u2705 Extensive tool ecosystem\n- \u2705 Good documentation\n\n#### 2. AutoGen\n- \u274c Complex configuration\n- \u274c Limited logging\n- \u274c Difficult debugging\n- \u2705 Good multi-agent support\n- \u2705 Built-in caching\n\n#### 3. Pydantic-AI\n- \u274c Limited provider support\n- \u274c Basic logging\n- \u274c No state management\n- \u2705 Strong type validation\n- \u2705 Clean data structures\n\n#### 4. LlamaIndex\n- \u274c Complex for simple uses\n- \u274c Heavy resource usage\n- \u274c Confusing documentation\n- \u2705 Great RAG support\n- \u2705 Good data ingestion\n\n#### 5. PhiData\n- \u274c Limited features\n- \u274c Basic logging\n- \u274c Limited providers\n- \u2705 Simple API\n- \u2705 Clean implementation\n\n### EzyAgent's Solutions\n\n#### 1. Development Experience\n- One-line setup\n- Clear, concise API\n- Comprehensive documentation\n- Type hints everywhere\n- Informative error messages\n- IDE autocomplete support\n\n#### 2. Observability\n- Structured logging\n- Request tracing\n- Cost tracking\n- Performance metrics\n- Debug mode\n- Custom metric support\n\n#### 3. Reliability\n- Automatic retries\n- Smart rate limiting\n- Provider fallbacks\n- Error recovery strategies\n- Validation checks\n\n#### 4. Flexibility\n- Easy extension\n- Custom tools\n- Provider agnostic\n- State management\n- Memory systems\n- Custom implementations\n\n#### 5. Performance\n- Async by default\n- Efficient resource usage\n- Built-in caching\n- Streaming support\n- Parallel operations\n\n## Architecture\n\n```plaintext\nezyagent/\n\u251c\u2500\u2500 core/\n\u2502   \u251c\u2500\u2500 baseagent.py          # Base agent classes\n\u2502   \u251c\u2500\u2500 memory.py         # State management\n\u2502   \u251c\u2500\u2500 tools.py          # Tool management\n\u2502   \u2514\u2500\u2500 providers/        # LLM providers\n\u251c\u2500\u2500 logging/\n\u2502   \u251c\u2500\u2500 logger.py         # Logging core\n\u2502   \u251c\u2500\u2500 formatters.py     # Log formatters\n\u2502   \u251c\u2500\u2500 handlers.py       # Output handlers\n\u2502   \u2514\u2500\u2500 monitors.py       # Metrics\n\u251c\u2500\u2500 utils/\n\u2502   \u251c\u2500\u2500 errors.py         # Error handling\n\u2502   \u251c\u2500\u2500 validation.py     # Input validation\n\u2502   \u2514\u2500\u2500 helpers.py        # Utilities\n\u2514\u2500\u2500 examples/             # Usage examples\n```\n\n## Installation\n\n```bash\npip install ezyagent\n```\n\n## Quick Start\n\n```python\nfrom ezyagentsdf import BaseAgent\n\n# Create an agent\nagent = BaseAgent(\"gpt-4\")\n\n# Enable logging\nagent.logger.configure(format=\"json\", outputs=[\"console\"])\n\n\n# Add a tool\n@agent.tool\nasync def search(query: str) -> str:\n    \"\"\"Search the web.\"\"\"\n    return await web_search(query)\n\n\n# Chat with the agent\nasync def main():\n    response = await agent.chat(\"Find recent news about AI\")\n    print(response)\n\n\n# Run\nasyncio.run(main())\n```\n\n## Documentation\n\nFull documentation is available at [docs.ezyagent.dev](https://docs.ezyagent.dev)\n\n## License\n\nMIT License - feel free to use in your own projects!\n\n## Contributing\n\nWe welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "agent framework designed to make AI agent development simple",
    "version": "0.0.12",
    "project_urls": {
        "Homepage": "https://github.com/santhosh/",
        "Repository": "https://github.com/santhosh/"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f569f779eefd1c8c516ee2dbcc5de48f70bac8152c6d37d90d0cf1ca1799798e",
                "md5": "376b02e2d62a89a66f57acea0673224e",
                "sha256": "680dad1e1cfd8feb3a8fd2f320d5162f10e5d5586e74ecdf2624b482dde9df2a"
            },
            "downloads": -1,
            "filename": "ezyagent-0.0.12-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "376b02e2d62a89a66f57acea0673224e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 44878,
            "upload_time": "2024-12-20T13:06:30",
            "upload_time_iso_8601": "2024-12-20T13:06:30.555146Z",
            "url": "https://files.pythonhosted.org/packages/f5/69/f779eefd1c8c516ee2dbcc5de48f70bac8152c6d37d90d0cf1ca1799798e/ezyagent-0.0.12-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7489e1ffd2d1a37b2acb1003438ea3e9a7d0f801696e2228270a2d0bba54f731",
                "md5": "106030d76361e02fb50b3dde9b0ec7f5",
                "sha256": "4060e37f334e7db3e8d37b824480c1119c2eb7fb6d0c2b84200a81ad73dbc806"
            },
            "downloads": -1,
            "filename": "ezyagent-0.0.12.tar.gz",
            "has_sig": false,
            "md5_digest": "106030d76361e02fb50b3dde9b0ec7f5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 31189,
            "upload_time": "2024-12-20T13:06:33",
            "upload_time_iso_8601": "2024-12-20T13:06:33.346478Z",
            "url": "https://files.pythonhosted.org/packages/74/89/e1ffd2d1a37b2acb1003438ea3e9a7d0f801696e2228270a2d0bba54f731/ezyagent-0.0.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-20 13:06:33",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "ezyagent"
}
        
Elapsed time: 3.16262s