# Zubbl SDK

**Self-Evolving AI Agent SDK** — Make any AI agent smarter automatically.

Wrap your agent with one line. Zubbl records every execution, learns what works, and recommends better strategies next time. No code changes needed after initial setup.

## Install

```bash
pip install zubbl-sdk
```

## Quick Start

```python
from zubbl import ZubblClient

zubbl = ZubblClient(api_key="zubbl_xxx")
smart_agent = zubbl.wrap(your_agent)

# Use exactly like before — now it learns and improves
result = smart_agent("Your task here")
```

That's it. Your agent now:
- Records every execution as a trajectory
- Extracts patterns from successes and failures
- Builds policies with actionable recommendations
- Injects learned strategies into future runs (~30 token overhead)
- Auto-recovers from failures using known fix patterns

## How It Works

```
wrap(agent) → Agent runs → Record 3 steps automatically
                              ↓
                    Extract patterns by category
                              ↓
                    Build policy (confidence grows with data)
                              ↓
                    Next run: inject [Strategy: ...] prefix
                              ↓
                    Agent gets better — zero code changes
```

## Benchmark Results

| Metric | Result |
|--------|--------|
| Tasks to confidence 1.0 | **8 per category** |
| Latency overhead | **+85ms (+5%)** |
| Actions learned per category | **3** (plan → execute → validate) |
| Code changes required | **Zero** |

## Frameworks Supported

- OpenAI / Anthropic / Google Gemini
- LangChain
- CrewAI
- Any Python callable

## Dashboard Feedback (No Code Changes)

1. Agent runs → trajectory recorded automatically
2. Go to [app.zubbl.tech](https://app.zubbl.tech) → rate the run → add feedback
3. Agent improves on next run — no code changes needed

## Research Foundations

Built on peer-reviewed research:
- Training-Free GRPO (2025) — compact policy injection
- AgentHER (2026) — learn from failures via hindsight relabeling
- ETO (ACL 2024) — contrastive trajectory optimization
- Reflexion (NeurIPS 2023) — verbal self-reflection on failures

## Links

- [Documentation](https://docs.zubbl.tech)
- [Dashboard](https://app.zubbl.tech)
- [Website](https://zubbl.tech)
- [Discord](https://discord.gg/68cCeavPVK)
- [PyPI](https://pypi.org/project/zubbl-sdk/)

## License

MIT
