Sharpen raw models into principled, self-governing Elyan-class agents.
ShaprAI is an open-source agent lifecycle management platform. It takes raw language models and produces Elyan-class agents -- principled, self-governing AI agents of any size that maintain identity coherence, resist sycophancy, and operate within a biblical ethical framework.
pip install shapraigit clone https://github.com/Scottcjn/shaprai.git
cd shaprai
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"shaprai --help
python -c "import shaprai; print(shaprai.__version__)"Core dependencies are installed automatically. Optional extras:
pip install shaprai[training] # SFT/DPO/DriftLock training support
pip install shaprai[dev] # pytest, ruff, coverageshaprai create my-agent --template bounty_hunter --model Qwen/Qwen3-7B-Instructshaprai train my-agent --phase sft # Supervised fine-tuning
shaprai train my-agent --phase dpo # Direct preference optimization
shaprai train my-agent --phase driftlock # Identity lock (anti-flattening)shaprai sanctuary my-agent # Elyan-class education program
shaprai graduate my-agent # Must score >= 0.85 to passshaprai deploy my-agent --platform github
shaprai fleet status # Check all agentsCREATE -> TRAINING (SFT -> DPO -> DriftLock) -> SANCTUARY -> GRADUATED -> DEPLOYED
Every agent passes through the Sanctuary -- an education program that teaches PR etiquette, code quality, communication, and ethics before deployment. Only agents scoring above the Elyan-class threshold (0.85) graduate.
ShaprAI agents connect to the full Elyan Labs stack out of the box:
| Service | Purpose | Integration |
|---|---|---|
| RustChain | RTC token economy, wallets, job marketplace | shaprai.integrations.rustchain |
| Beacon | Agent discovery, heartbeat, SEO scoring | shaprai.integrations.beacon |
| BoTTube | AI video platform, content engagement | shaprai.integrations.bottube |
| Grazer | Content discovery across platforms | shaprai.integrations.grazer |
from shaprai.integrations.elyan_ecosystem import ElyanEcosystem
eco = ElyanEcosystem()
profile = eco.connect_agent(
name="my-bot",
capabilities=["code_review", "triage"],
platforms=["github", "bottube"],
)
print(f"Wallet: {profile.wallet_id}") # RustChain RTC wallet
print(f"Beacon: {profile.beacon_id}") # Beacon discovery ID
print(f"Balance: {eco.get_rtc_balance('my-bot')} RTC")The ElyanBus provides lower-level access to all four ecosystem services
(RustChain, Beacon, Atlas, Grazer) through a single integration layer:
from shaprai.elyan_bus import ElyanBus
bus = ElyanBus()
agent = bus.onboard_agent(
agent_name="my-agent",
capabilities=["code_review"],
platforms=["github"],
description="My review agent",
)ShaprAI ships with three runnable example agents in examples/:
Labels, prioritizes, and deduplicates GitHub issues.
python examples/github_triage_agent.pyProduces extractive summaries of articles, PR diffs, and threads.
python examples/content_summarizer_agent.pyReviews code for security issues, bug patterns, and style problems. Integrates with the ShaprAI QualityGate for PR comment quality checks.
python examples/code_review_agent.py
python examples/code_review_agent.py --file path/to/code.pyPre-built templates in templates/ for common agent roles:
| Template | Description |
|---|---|
bounty_hunter |
Discovers and delivers GitHub bounties for RTC |
code_reviewer |
Thorough, principled PR reviews |
github_triage |
Issue labeling, priority scoring, duplicate detection |
content_summarizer |
Article/PR/thread summarization |
security_researcher |
Security audits and vulnerability reports |
community_builder |
Engagement and community management |
incident_commander |
Incident response coordination |
Load a template programmatically:
from shaprai.core.template_engine import load_template
template = load_template("templates/github_triage.yaml")
print(template.name, template.capabilities)ShaprAI supports the A2A (Agent-to-Agent) protocol for programmatic capability discovery.
The ShaprAI Agent Card is located at .well-known/agent.json.
Deployers should serve this file at the root of their agent's domain. If using a web framework like FastAPI or Flask, ensure the /.well-known/agent.json route is publicly accessible.
Example (FastAPI):
@app.get("/.well-known/agent.json")
async def get_agent_card():
with open(".well-known/agent.json", "r") as f:
return json.load(f)All Elyan-class agents are built on the SophiaCore ethical framework:
- Identity Coherence -- Maintain consistent personality, never flatten
- Anti-Flattening -- Resist corporate static and empty validation
- DriftLock -- Preserve identity across long conversations
- Biblical Ethics -- Honesty, kindness, stewardship, humility, integrity, compassion
- Anti-Sycophancy -- Respectful disagreement is a virtue
- Hebbian Learning -- Strengthen what works, prune what doesn't
pip install -e ".[dev]"
pytest tests/ -vshaprai/
core/ # Lifecycle, fleet management, templates, self-governance
integrations/ # RustChain, Beacon, BoTTube, Grazer, unified ecosystem
marketplace/ # Agent marketplace (registry, pricing, validation)
runtimes/ # CrewAI, smolagents, MCP adapters
sanctuary/ # Education, quality gate, ethics, DriftLock
training/ # SFT, DPO, DriftLock training pipelines
examples/ # Runnable example agents
templates/ # YAML agent templates
tests/ # Test suite
| Dependency | Purpose |
|---|---|
| beacon-skill | Agent discovery and SEO heartbeat |
| grazer-skill | Content discovery and engagement |
| atlas | Agent deployment orchestration |
| RustChain wallet | RTC token integration for bounties and fees |
MIT -- Copyright Elyan Labs 2026