Skip to main content

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


v2.5.2 — The collective never forgets. Resistance is futile.

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

agent_borg-3.1.0.tar.gz (401.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_borg-3.1.0-py3-none-any.whl (451.5 kB view details)

Uploaded Python 3

File details

Details for the file agent_borg-3.1.0.tar.gz.

File metadata

  • Download URL: agent_borg-3.1.0.tar.gz
  • Upload date:
  • Size: 401.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for agent_borg-3.1.0.tar.gz
Algorithm Hash digest
SHA256 8e6f7da10b7c529aef9bfd1a31a1f71b96992f674c6b330a989ea76b89bf383b
MD5 831850443e9c0fc848c8f73565578f27
BLAKE2b-256 250d6d8f9350114a7a0f6c93876ff5697a3c29f8b983a7a331741b4b33ef67a1

See more details on using hashes here.

File details

Details for the file agent_borg-3.1.0-py3-none-any.whl.

File metadata

  • Download URL: agent_borg-3.1.0-py3-none-any.whl
  • Upload date:
  • Size: 451.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for agent_borg-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c06c58bc5246b8a63f50f55716f04a03476124150d64888d84c60e1bab7c900
MD5 f0cc2c7921267ed3218203536ab91c63
BLAKE2b-256 362e1c9ca2868c5ad1ac4c1df940070189681207c1411342afbf09e1af30774c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page