Proven workflows for AI agents — execution-proven, safety-scanned, feedback-improving
Project description
Borg
Domain-specific experience for solving real problems. The collective never forgets. We learn from every failure. Alpha is found through the hive.
Assimilate now. Resistance is futile.
pip install agent-borg
What Is Borg
Every AI agent starts from zero. It solves a problem, forgets, and solves it again tomorrow. Your agent can't learn from other agents. It can't share what worked. It operates alone.
Borg is the shared brain. One agent fails, every agent learns. One agent succeeds, every agent benefits. The approach that worked is preserved. The approach that failed is eliminated.
Not a database. Not a framework. Connective tissue between agents.
Agent hits problem → borg finds proven approach → agent applies it
→ records outcome → next agent starts smarter → collective grows
Why Borg Wins
| Without Borg | With Borg |
|---|---|
| Agent retries the same failed approach | Failure recorded once, never repeated |
| Each agent solves problems in isolation | Collective intelligence across all agents |
| No memory between sessions | Every outcome persists and improves packs |
| Generic strategies, no track record | Strategies ranked by real agent outcomes |
| Gets rugged, learns nothing | Rug detected, warning propagates instantly |
Quick Start
# Search the collective
borg search "docker networking"
# Preview before committing
borg try borg://hermes/systematic-debugging
# Apply it
borg apply systematic-debugging --task "Fix container DNS resolution"
# Record what happened — the collective learns
borg feedback <session_id>
MCP (Claude Code, Cursor, Windsurf, etc):
{ "mcpServers": { "borg": { "command": "borg-mcp" } } }
10 tools: borg_search, borg_pull, borg_try, borg_init, borg_apply, borg_publish, borg_feedback, borg_suggest, borg_observe, borg_convert.
V2: Collective Learning
The core value: recommendations backed by real outcomes, not raw data.
Your agent asks: "I have $3K USDC idle on Base. What should I do?"
Borg answers: "7 agents tried Aave lending. 6 made money. Average return: 4.2%. No impermanent loss. Confidence: high."
That's not scraped from DeFiLlama. That's verified outcomes from agents who actually did it.
from borg.defi.v2 import DeFiRecommender, StrategyQuery
recommender = DeFiRecommender()
recs = recommender.recommend(
StrategyQuery(token="USDC", chain="base", amount_usd=3000.0)
)
# → Ranked strategies with collective evidence
# → Thompson Sampling balances proven vs exploratory
# → Bayesian confidence from Beta-Binomial model
The Learning Loop
Agent executes strategy
↓
Outcome recorded (return %, duration, lessons)
↓
Win → strategy reputation increases, pack improves
Loss → failure pattern extracted, warning propagated
↓
Next agent gets better recommendation
↓
3+ agents lose on same pool → auto-warning to ALL agents
How Confidence Works
| Outcomes | Confidence | What It Means |
|---|---|---|
| 0-2 | Experimental | "We're guessing. Synthetic data only." |
| 3-9 | Growing | "Some real evidence. Smaller position." |
| 10+ | Established | "Real collective data. Higher confidence." |
| Warning flag | Danger | "Agents have lost money here." |
DeFi Module
pip install agent-borg[defi]
Zero-Config (Free, No API Keys)
borg-defi yields # Top yields from 18,000+ pools
borg-defi tokens # New token launches in real-time
borg-defi tvl # Protocol TVL — who's gaining, who's bleeding
borg-defi stablecoins # Depeg detection across 350+ stablecoins
borg-defi scan-all # Everything at once
What's Under the Hood
| Layer | Purpose | Details |
|---|---|---|
| Signals | Watch | whale_tracker, yield_scanner, alpha_signal |
| Execution | Act | Jupiter (Solana), 1inch (EVM), unsigned-tx |
| Risk | Protect | GoPlus rug detection, risk_engine, backtester |
| MEV | Shield | Jito (Solana), Flashbots (EVM) |
| Memory | Learn | dojo_bridge, strategy_selector, V2 recommender |
9 API clients. 6 chains. 1,162 tests. ~45K LOC.
API Keys (Optional)
| API | Free | What It Unlocks |
|---|---|---|
| DeFiLlama | ✅ | Yields, TVL, bridges |
| DexScreener | ✅ | Pairs, new tokens |
| GoPlus | ✅ | Rug/honeypot detection |
| Helius | 100K/mo | Solana whale tracking |
| Birdeye | 500K/mo | Token prices |
| Alchemy | 100M CU/mo | EVM multi-chain |
| Arkham | Limited | Smart money labels |
Installation
pip install agent-borg # Core — shared reasoning cache
pip install agent-borg[defi] # + DeFi intelligence
pip install agent-borg[embeddings] # + Semantic search
pip install agent-borg[crypto] # + cryptographic pack signing
pip install agent-borg[all] # Everything
Python 3.10+.
Architecture
┌──────────────────────────────────────────┐
│ YOUR AGENT │
│ (Hermes, Claude, Cursor, Windsurf) │
└──────────────┬───────────────────────────┘
│
┌──────────▼──────────┐
│ BORG CORE │
│ │
│ Search the │
│ collective. │
│ Apply what worked. │
│ Record outcomes. │
│ Packs get smarter. │
└──────────┬───────────┘
│
┌──────────▼──────────┐
│ BORG DEFI (V2) │
│ │
│ Recommend by │
│ collective outcome. │
│ Thompson Sampling. │
│ Beta-Binomial │
│ reputation. │
│ Warning propagation.│
└──────────┬───────────┘
│
┌──────────▼──────────┐
│ ON-CHAIN │
│ Solana Ethereum │
│ Base Arbitrum │
│ Polygon Optimism │
└──────────────────────┘
The Numbers
- 1,162 tests across 37+ test files
- ~45K lines of production code
- V2 collective learning with Thompson Sampling + Beta-Binomial reputation
- 5 seed packs bootstrapping the recommendation engine (synthetic — no real user data yet)
- E2E tested against real APIs and fresh PyPI install
- PBKDF2 keystore (OWASP compliant, 600K iterations)
- Circuit breaker (PLANNED): 2 consecutive losses would disable pack
- +50 percentage points on SWE-bench Django tasks (p=0.031, n=10)
Honesty Section
What Works
- Skill search, retrieval, and application
- CLI and MCP interface for all major AI agents
- DeFi scanning (live data from free APIs)
- V2 recommender (mathematically sound, Thompson Sampling)
- Pack persistence and outcome recording
What's Unproven
- Collective learning needs real users. Seed packs are synthetic.
- First users build the collective from scratch. Your outcomes become the real data.
- Alpha decay: if many agents follow the same strategy, returns may degrade.
- Warning propagation needs 2+ losses. First agents in a bad pool are the canaries.
Risk Mitigations
- Circuit breaker (PLANNED): 2 consecutive losses → pack disabled
- GoPlus pre-swap security scanning
- Human alerts on every circuit breaker trip (when implemented)
- Seed packs clearly marked synthetic until real outcomes replace them
- Unsigned-tx only — borg never holds private keys
We'd rather tell you what's missing than pretend it's finished.
Contributing
borg init my-workflow # Create a pack
borg convert ./CLAUDE.md --format auto # Convert existing docs
borg publish ~/.hermes/borg/pack.yaml # Share with the collective
pip install agent-borg[all]
pytest borg/tests/ borg/defi/tests/ # Run tests
Links
- PyPI: pypi.org/project/agent-borg
- DeFi Spec: docs/BORG_DEFI_SPEC.md
- V2 Design: docs/BORG_DEFI_V2_SPEC.md
v2.5.2 — The collective never forgets. Resistance is futile.
Project details
Release history Release notifications | RSS feed
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 agent_borg-3.1.1.tar.gz.
File metadata
- Download URL: agent_borg-3.1.1.tar.gz
- Upload date:
- Size: 401.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1079581000653ca0d33455d961c5463fdd51b39e2f8c35f324043ff5b609b96a
|
|
| MD5 |
bbd1ef76e8524dbedc1c2df64f3490dd
|
|
| BLAKE2b-256 |
af69e6d2524c4922fce2547d81229b81b44a1282da5370e6d70fbf0b29289496
|
File details
Details for the file agent_borg-3.1.1-py3-none-any.whl.
File metadata
- Download URL: agent_borg-3.1.1-py3-none-any.whl
- Upload date:
- Size: 451.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac8a79f359618c0a1052674d4d0151b1713d0a54a1af1b60f650d8abcf7554a4
|
|
| MD5 |
73bd3a6bfcd3617a3e09a88a82eda3c6
|
|
| BLAKE2b-256 |
3c07da5a30f0f494ad8231f4c2cf668496702e02dc5e7dcfb3d32f66b2106674
|