Skip to main content

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

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

# 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

# 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

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

# 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

# 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

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

pip install ezyagent

Quick Start

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

License

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

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

Metadata

Release files for ezyagent 0.0.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ezyagent 0.0.13
File Size Uploaded Provenance
ezyagent-0.0.13.tar.gz 31.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ezyagent 0.0.13
File Interpreter ABI Platform
ezyagent-0.0.13-py3-none-any.whl Python 3 none any Details

Total release size: 76.1 kB

Release files / ezyagent-0.0.13.tar.gz

Download URL ezyagent-0.0.13.tar.gz
Size 31.2 kB
Tags Source
SHA-256 checksum
How to use checksums
14118431150283857297e6db7cfb7a73c21ab7d613ecfcc2ace90c5b73f4166d
BLAKE2b-256 checksum
How to use checksums
40c6c73e4a853eeb9161149f5bf8655953a07088e94cafcdccc2e07b874bf5b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.11.0rc1 Linux/6.8.0-49-generic

Release files / ezyagent-0.0.13-py3-none-any.whl

Download URL ezyagent-0.0.13-py3-none-any.whl
Size 44.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00af092add443f31c95c21d778978772042eecfe2038262a9c243ae38a61e504
BLAKE2b-256 checksum
How to use checksums
27b40e75f0e04669db34e85e64c8b0dbb42f59eacf2df9c032fac04a9ca49282
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.11.0rc1 Linux/6.8.0-49-generic

Security for ezyagent 0.0.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page