Base agent class for all Beast Mode agents
Project description
Beast Agent
Base agent class for ALL Beast Mode agents
🎯 Purpose
The foundational base class (BaseAgent) that EVERY Beast Mode agent inherits from.
This package provides:
- ✅ Standardized agent lifecycle (startup, shutdown, health checks)
- ✅ Message handling via beast-mailbox-core integration
- ✅ Agent registration and discovery
- ✅ Capability declaration and management
- ✅ Optional logging/telemetry hooks
- ✅ Configuration management
Architectural Clarity:
beast-agent= Low-level base class (every agent IS-A beast-agent)beast-agentic-framework= High-level orchestration (multi-agent coordination)
🚀 Quick Start
Installation
pip install beast-agent
Create Your First Agent
from beast_agent import BaseAgent
from beast_agent.decorators import capability
class MyAgent(BaseAgent):
"""Simple agent with a single capability"""
def __init__(self):
super().__init__(
agent_id="my-agent",
capabilities=["process_data"]
)
@capability("process_data")
async def process_data(self, data: dict) -> dict:
"""Process data and return results"""
# Your agent logic here
return {"status": "processed", "result": data}
# Run the agent
async def main():
agent = MyAgent()
await agent.startup()
# Agent is now ready to handle messages
if __name__ == "__main__":
import asyncio
asyncio.run(main())
📋 Agent Patterns
Per-Repo Agent Pattern
class RepoAgent(BaseAgent):
"""Agent that monitors a single repository"""
def __init__(self, repo_name: str):
super().__init__(
agent_id=f"repo-agent-{repo_name}",
capabilities=["code_review", "pr_validation", "security_scan"]
)
self.repo_name = repo_name
@capability("code_review")
async def review_code(self, pr_number: int) -> dict:
"""Review code in PR"""
# Review logic
return {"status": "reviewed", "pr": pr_number}
Per-Branch Agent Pattern
class BranchAgent(BaseAgent):
"""Agent specific to a branch"""
def __init__(self, repo_name: str, branch_name: str):
super().__init__(
agent_id=f"branch-agent-{repo_name}-{branch_name}",
capabilities=["deployment", "testing", "monitoring"]
)
self.repo = repo_name
self.branch = branch_name
@capability("deployment")
async def deploy(self, environment: str) -> dict:
"""Deploy branch to environment"""
# Deployment logic
return {"status": "deployed", "environment": environment}
🔧 Features
Agent Lifecycle
agent = MyAgent()
await agent.startup() # Initialize and register
# ... agent is running ...
await agent.shutdown() # Graceful cleanup
Message Handling
# Register handler for message type
agent.register_handler("TASK_REQUEST", handle_task_request)
# Send message to another agent
await agent.send_message(
target="other-agent-id",
message_type="HELP_REQUEST",
content={"task": "analyze_code"}
)
Health Checks
health = agent.health_check()
print(f"Healthy: {health.healthy}")
print(f"State: {health.state}")
📚 Documentation
- Agent Development Guide - How to create custom agents
- Deployment Patterns - Per-repo, per-branch, orchestration
- API Reference - Complete API documentation
- Examples - Example agent implementations
🧪 Testing
# Run all tests
pytest
# Run with coverage
pytest --cov=src/beast_agent --cov-report=html
# Run specific test
pytest tests/test_base_agent.py
# Run integration tests (requires Redis and beast-mailbox-core)
# Note: Integration tests are automatically skipped if dependencies unavailable
pytest tests/test_mailbox_integration.py
# Run all tests including integration (if Redis available)
pytest tests/
Integration Testing
Integration tests require:
- Redis: Running locally (via Docker) or in CI (via service containers)
- beast-mailbox-core: Installed as dependency
Local Testing:
- Redis Docker container is automatically managed via
conftest.pyfixtures - Tests gracefully skip if Redis/Docker unavailable
- Uses separate test database (db=15) to avoid conflicts
CI Testing:
- Redis service container automatically provided in GitHub Actions
- Integration tests run against real Redis in CI
🤝 Integration
Required Dependencies
beast-mailbox-core>= 0.3.0 - Messaging and discovery
Optional Dependencies
beast-observability- Enhanced telemetry- Any cloud platform (works with AWS, GCP, Azure, on-prem)
📦 Package Status
Tier: 1 (Foundation)
Phase: Development
Coverage: Target 90%+
Quality: Target zero defects
🔗 Related Packages
beast-mailbox-core- Redis-backed mailbox utilitiesbeast-agentic-framework- Multi-agent orchestrationbeast-observability- Unified telemetrybeast-redaction-client- Data classification
📄 License
MIT License - see LICENSE for details.
🙏 Acknowledgments
Part of the Beast Mode multi-agent framework ecosystem.
Built with ❤️ by the Beast Mode team
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file beast_agent-0.1.2.tar.gz.
File metadata
- Download URL: beast_agent-0.1.2.tar.gz
- Upload date:
- Size: 22.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4427ab450793e2fa2e1f9a667c0d8ff9d75810278a74b98a5943125c48c9a213
|
|
| MD5 |
261eced3b48f7d864dc435eea7422b00
|
|
| BLAKE2b-256 |
d2ffaa5301c6ca2af0f36afc32d86ed18c4e9fcb78dd7b4ddc782cf5e56d391d
|
Provenance
The following attestation bundles were made for beast_agent-0.1.2.tar.gz:
Publisher:
publish.yml on nkllon/beast-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
beast_agent-0.1.2.tar.gz -
Subject digest:
4427ab450793e2fa2e1f9a667c0d8ff9d75810278a74b98a5943125c48c9a213 - Sigstore transparency entry: 657648643
- Sigstore integration time:
-
Permalink:
nkllon/beast-agent@bf51f2baeab5ef527b9e58b1fea4d00495377ff3 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/nkllon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bf51f2baeab5ef527b9e58b1fea4d00495377ff3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file beast_agent-0.1.2-py3-none-any.whl.
File metadata
- Download URL: beast_agent-0.1.2-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19cfab052c980e6f3c9b1d8eaf0c29d02724e8505bac6b3b275c35717b1609c8
|
|
| MD5 |
be39a24ae7cf8d1846db52930108a79d
|
|
| BLAKE2b-256 |
f2997cf9c268cfefbaa153e480c20b224d6380738b8a9b380235cc4fd62488e7
|
Provenance
The following attestation bundles were made for beast_agent-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on nkllon/beast-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
beast_agent-0.1.2-py3-none-any.whl -
Subject digest:
19cfab052c980e6f3c9b1d8eaf0c29d02724e8505bac6b3b275c35717b1609c8 - Sigstore transparency entry: 657648649
- Sigstore integration time:
-
Permalink:
nkllon/beast-agent@bf51f2baeab5ef527b9e58b1fea4d00495377ff3 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/nkllon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bf51f2baeab5ef527b9e58b1fea4d00495377ff3 -
Trigger Event:
release
-
Statement type: